`setup-autocomplete` in Breeze2 fails with "Permission denied"
See original GitHub issueApache Airflow version
main (development)
What happened
When I run “setup-autocomplete” in the new Breeze with zsh it fails with “permission denied” as it tries to access /.zshrc
:
[jarek:~/code/airflow] static-check-breeze2+ ± ./Breeze2 setup-autocomplete
Installing zsh completion for local user
Activation command scripts are created in this autocompletion path: /home/jarek/code/airflow/.build/autocomplete/Breeze2-complete.zsh
Do you want to add the above autocompletion scripts to your zsh profile? [y/N]: y
This will modify the /.zshrc file
Traceback (most recent call last):
File "/home/jarek/code/airflow/.build/breeze2/venv/bin/Breeze2", line 33, in <module>
sys.exit(load_entry_point('apache-airflow-breeze', 'console_scripts', 'Breeze2')())
File "/home/jarek/code/airflow/.build/breeze2/venv/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/home/jarek/code/airflow/.build/breeze2/venv/lib/python3.8/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/home/jarek/code/airflow/.build/breeze2/venv/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/jarek/code/airflow/.build/breeze2/venv/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/jarek/code/airflow/.build/breeze2/venv/lib/python3.8/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/jarek/code/airflow/dev/breeze/src/airflow_breeze/breeze.py", line 248, in setup_autocomplete
write_to_shell(command_to_execute, script_path, breeze_comment)
File "/home/jarek/code/airflow/dev/breeze/src/airflow_breeze/breeze.py", line 215, in write_to_shell
with open(script_path, 'a') as script_file:
PermissionError: [Errno 13] Permission denied: '/.zshrc'
[jarek:~/code/airflow] static-check-breeze2+ 6s 1 ±
What you expected to happen
I expected the scripts in my ${HOME}
directory to be updated with auto-complete but apparently it tries to update a file in `root’ folder.
How to reproduce
- Have zsh as your shell
- Run
./Breeze2 setup-autocomplete
Operating System
Linux Mint 20.1.3
Versions of Apache Airflow Providers
- Not relevant -
Deployment
Other
Deployment details
No airflow - this is just a development environment.
Anything else
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project’s Code of Conduct
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
oh my zsh - Why do I get permission denied error when ...
I want to create a Zsh plugin for code completion. The autocompletion function should work with a keybinding. When using the keybinding in ......
Read more >Troubleshoot "Permission denied (Publickey)" or ...
I'm receiving "Permission denied (publickey)" or "Authentication failed, permission denied" errors when trying to access my EC2 instance.
Read more >Permission denied (publickey)
With this error message an SSH command to Gerrit is rejected if the SSH authentication is not successful. The SSH protocol can use...
Read more >Container permission denied: How to diagnose this error
Learn what is causing a container permissions error and how to work around the issue without resorting to the --privileged flag.
Read more >How to Fix Shell Script Permission Denied Error in Linux
The shell script permission denied error occurs when the shell script you're trying to run doesn't have the permissions to execute. Linux tells ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ah yeah… This is pretty common thing - happens to me all the time that I assume something without reading in detail the error message. Actually the error message is very clear about it when you read it carefully:
Not
😄
Oh ok. I thought in case of no permission, we should throw appropriate instructions to update .zshrc. I didn’t think the error is in expanding the path at all. 😄