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

SNOW-1013234: Fix config permissions warning message #1855

Closed
sfc-gh-pczajka opened this issue Jan 19, 2024 · 1 comment · Fixed by #1856
Closed

SNOW-1013234: Fix config permissions warning message #1855

sfc-gh-pczajka opened this issue Jan 19, 2024 · 1 comment · Fixed by #1856

Comments

@sfc-gh-pczajka
Copy link
Contributor

What is the current behavior?

If permissions / owner of config file is incorrect, the command outputs long one-liner containing two commands (chmod and chown) to call to fix the issue.

  1. Many users tend to overlook that there are two commands and give up after one does not fix the issue
  2. In Snowflake CLI on MacOS default config path is inside "Application Support" directory - space inside the path turned out to be problematic for some users
/Users/pczajka/Snowflake/venv3.12/lib/python3.12/site-packages/snowflake/connector/config_manager.py:344: UserWarning: Bad owner or permissions on /Users/pczajka/Library/Application Support/snowflake/config.toml. To change owner, run `chown $USER /Users/pczajka/Library/Application Support/snowflake/config.toml`. To restrict permissions, run `chmod 0600 /Users/pczajka/Library/Application Support/snowflake/config.toml`.
  warn(f"Bad owner or permissions on {str(filep)}{chmod_message}")

What is the desired behavior?

Reformattinmg the message to highlight that there are two commands to call (fix 1) and add quotes around filenames (fix 2).
For example:

/Users/pczajka/Snowflake/venv3.12/lib/python3.12/site-packages/snowflake/connector/config_manager.py:344: UserWarning: Bad owner or permissions on /Users/pczajka/Library/Application Support/snowflake/config.toml.
 * To change owner, run `chown $USER "/Users/pczajka/Library/Application Support/snowflake/config.toml"`.
 * To restrict permissions, run `chmod 0600 "/Users/pczajka/Library/Application Support/snowflake/config.toml"`.
  warn(f"Bad owner or permissions on {str(filep)}{chmod_message}")

How would this improve snowflake-connector-python?

Improve user experience (also improve user experience of Snowflake CLI)

References and other background

No response

@github-actions github-actions bot changed the title Fix config permissions warning message SNOW-1013234: Fix config permissions warning message Jan 19, 2024
@sfc-gh-pczajka
Copy link
Contributor Author

PR: #1856

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant