Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Unable to use sdk.Client.Users.Show with insufficient priveleges #2817

Closed
1 task done
candiduslynx opened this issue May 17, 2024 · 7 comments
Closed
1 task done
Labels
bug Used to mark issues with provider's incorrect behavior category:resource resource:user Issue connected to the snowflake_user resource

Comments

@candiduslynx
Copy link

Terraform CLI Version

N/A

Terraform Provider Version

0.90.0

Terraform Configuration

N/A

Category

category:sdk

Object type(s)

resource:user, data_source:users

Expected Behavior

The missing fields should just be left empty

Actual Behavior

The sdk.Users Show method (sdk.Client.Users.Show) fails when using credentials that don't have both OWNERSHIP & MANAGE GRANTS privileges (as required for full output in docs.

2024/05/15 15:27:31 [DEBUG] err: sql: Scan error on column index 10, name "disabled": sql/driver: couldn't convert "null" into type bool

Steps to Reproduce

  1. Create a user A
  2. Create a user B without OWNERSHIP & MANAGE GRANTS privileges on A
  3. Execute sdk.Client.Users.Show

How much impact is this issue causing?

High

Logs

No response

Additional Information

No response

Would you like to implement a fix?

  • Yeah, I'll take it 😎
@candiduslynx candiduslynx added the bug Used to mark issues with provider's incorrect behavior label May 17, 2024
@candiduslynx candiduslynx changed the title [Bug]: Panic on ` [Bug]: Unable to use sdk.Client.Users.Show with insufficient priveleges May 17, 2024
@candiduslynx
Copy link
Author

The issue is caused by several columns being returned as "null" string instead of an actual null sql value (that is received in Go as untyped nil).

@sfc-gh-asawicki
Copy link
Collaborator

Hey @candiduslynx. I will link it to the user resource redesign as part of https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/ROADMAP.md#preparing-essential-ga-objects-for-the-provider-v1.

@sfc-gh-jcieslak sfc-gh-jcieslak added resource:user Issue connected to the snowflake_user resource category:resource labels May 20, 2024
sfc-gh-asawicki added a commit that referenced this issue Aug 23, 2024
sfc-gh-asawicki added a commit that referenced this issue Aug 23, 2024
sfc-gh-asawicki added a commit that referenced this issue Aug 28, 2024
Fix known user resource-connected issues:
- Change the sensitiveness of name and login_name (References: #2662
#2668)
- Handle "null" properly for the nullable bool text attributes in user
(References: #2817)
- Fix diff suppression for default_x in user resource (References:
#2836)
- Update the migration guide (References #2938 #2942)
- Fix incorrect state after failed to alter (References #2970)
- Confirm the problem with the computed disabled attribute (References
#1572)
- Confirm that the problem with the null-out password was already solved
(References #1535)
- Add TODO to handle days to expiry in user (References #1155)

The next 2 PRs will contain:
- adjusting user resource to our rework conventions (also adding
additional fields and handling #1155 and #1572)
- adjusting user datasource (will handle #2902)

User rework will not include handling new types of users (service,
legacy service); this will be done a bit later.
@sfc-gh-asawicki
Copy link
Collaborator

Hey @candiduslynx, the fix was included in #3013 and will be released in v0.95.0 today or tomorrow (we have to wrap up a few other PRs before making a release). Please check the migration guide and report any problems.

@candiduslynx
Copy link
Author

cc: @erezrokah

@sfc-gh-asawicki
Copy link
Collaborator

Hey @arkadiyt.
We have just released v0.95.0 of the provider. It contains a reworked snowflake_user resource. Please consult the migration guide.

@candiduslynx
Copy link
Author

cc @erezrokah once more

@sfc-gh-asawicki
Copy link
Collaborator

Closing the issue due to inactivity. Please create a new one if the issue persists in the newest version of the provider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to mark issues with provider's incorrect behavior category:resource resource:user Issue connected to the snowflake_user resource
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants