You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/01/27 17:23:24 UTC

[GitHub] [airflow] potiuk opened a new issue #21163: `setup-autocomplete` in Breeze2 fails with "Permission denied"

potiuk opened a new issue #21163:
URL: https://github.com/apache/airflow/issues/21163


   ### Apache 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`:
   
   ```
   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?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk edited a comment on issue #21163: `setup-autocomplete` in Breeze2 fails with "Permission denied"

Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on issue #21163:
URL: https://github.com/apache/airflow/issues/21163#issuecomment-1026086718


   > 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. smile
   
   Ah yeah... This is pretty common thin - 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:
   
   ```
   PermissionError: [Errno 13] Permission denied: '/.zshrc'
   ```
   
   Not 
   
   ```
   PermissionError: [Errno 13] Permission denied: '/home/jarek/.zshrc'
   ```
   :D
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on issue #21163: `setup-autocomplete` in Breeze2 fails with "Permission denied"

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #21163:
URL: https://github.com/apache/airflow/issues/21163#issuecomment-1026091302


   > Oh my bad! This makes more sense now @potiuk my bad, I overlooked the error message quickly and spent more time in finding the wrong issue.
   
   Been there, done that ... far too many times :D


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk edited a comment on issue #21163: `setup-autocomplete` in Breeze2 fails with "Permission denied"

Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on issue #21163:
URL: https://github.com/apache/airflow/issues/21163#issuecomment-1026086718


   > 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. smile
   
   Ah yeah... This is pretty common thin - 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:
   
   ```
   PermissionError: [Errno 13] Permission denied: '/.zshrc'
   ```
   
   Not 
   
   ```
   PermissionError: [Errno 13] Permission denied: '/home/jarek/.zshrc'
   ```
   :D
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] Bowrna commented on issue #21163: `setup-autocomplete` in Breeze2 fails with "Permission denied"

Posted by GitBox <gi...@apache.org>.
Bowrna commented on issue #21163:
URL: https://github.com/apache/airflow/issues/21163#issuecomment-1026090237


   > ```
   > PermissionError: [Errno 13] Permission denied: '/.zshrc'
   > ```
   > 
   > 
   >     
   >   
   > 
   > Not
   > 
   > 
   > ```
   > PermissionError: [Errno 13] Permission denied: '/home/jarek/.zshrc'
   > ```
   
   Oh my bad! This makes more sense now @potiuk my bad, I overlooked the error message quickly and spent more time in finding the wrong issue. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on issue #21163: `setup-autocomplete` in Breeze2 fails with "Permission denied"

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #21163:
URL: https://github.com/apache/airflow/issues/21163#issuecomment-1026080234


   > @potiuk Can you tell me how we could handle this issue? Do we have to ask the user to update in this case?
   
   I think the problem lays somewhere with expanding the user path. It looks like that what really happens here - we are trying to patch `/.zshrc` (in root directory) rather than than `~/.zshrc`. So somehow the code used there:
   
   ```
   Path('~').expanduser() / '/.zshrc'
   ```
   Des not work as intended. 
   
   BTW. I already know the reason but wanted to know if you can figure it out :D
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] Bowrna commented on issue #21163: `setup-autocomplete` in Breeze2 fails with "Permission denied"

Posted by GitBox <gi...@apache.org>.
Bowrna commented on issue #21163:
URL: https://github.com/apache/airflow/issues/21163#issuecomment-1025991115


   @potiuk Can you tell me how we could handle this issue? Do we have to ask the user to update in this case?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk edited a comment on issue #21163: `setup-autocomplete` in Breeze2 fails with "Permission denied"

Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on issue #21163:
URL: https://github.com/apache/airflow/issues/21163#issuecomment-1026086718


   > 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. smile
   
   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:
   
   ```
   PermissionError: [Errno 13] Permission denied: '/.zshrc'
   ```
   
   Not 
   
   ```
   PermissionError: [Errno 13] Permission denied: '/home/jarek/.zshrc'
   ```
   :D
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on issue #21163: `setup-autocomplete` in Breeze2 fails with "Permission denied"

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #21163:
URL: https://github.com/apache/airflow/issues/21163#issuecomment-1026086718


   > 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. smile
   
   Ah yeah... This is pretty common :) (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:
   
   ```
   PermissionError: [Errno 13] Permission denied: '/.zshrc'
   ```
   
   Not 
   
   ```
   PermissionError: [Errno 13] Permission denied: '/home/jarek/.zshrc'
   ```
   :D
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk closed issue #21163: `setup-autocomplete` in Breeze2 fails with "Permission denied"

Posted by GitBox <gi...@apache.org>.
potiuk closed issue #21163:
URL: https://github.com/apache/airflow/issues/21163


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] Bowrna commented on issue #21163: `setup-autocomplete` in Breeze2 fails with "Permission denied"

Posted by GitBox <gi...@apache.org>.
Bowrna commented on issue #21163:
URL: https://github.com/apache/airflow/issues/21163#issuecomment-1026084431


   > > @potiuk Can you tell me how we could handle this issue? Do we have to ask the user to update in this case?
   > 
   > I think the problem lays somewhere with expanding the user path. It looks like that what really happens here - we are trying to patch `/.zshrc` (in root directory) rather than than `~/.zshrc`. So somehow the code used there:
   > 
   > ```
   > Path('~').expanduser() / '/.zshrc'
   > ```
   > 
   > Des not work as intended.
   > 
   > BTW. I already know the reason but wanted to know if you can figure it out :D
   
   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. 😄 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org