You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "0Interest (via GitHub)" <gi...@apache.org> on 2023/08/25 10:56:12 UTC
[GitHub] [airflow] 0Interest opened a new issue, #33723: Cannot run pip as root
0Interest opened a new issue, #33723:
URL: https://github.com/apache/airflow/issues/33723
### Apache Airflow version
Other Airflow 2 version (please specify below)
### What happened
Airflow version 2.6.2
I am trying in the Dockerfile to install the package python-lzo, which needs to run gcc in the background, however when in the Dockerfile I switch to root user I get the known bug that occurred in Airflow version 2.3, which to my surprise was already fixed and merged.
I do have the _PIP_ADDITIONAL_REQUIREMENTS: '' set, however it still throws the error.
"You are running pip as root. Please use Airflow user to run pip!"
The Dockerfile is along the lines of:
```
from artifactory.spam/airflow:2.6.2-python3.7-1.0.1
USER root
run pip install python-lzo
USER airflow
```
And I've already tried to set the AIRFLOW_UID=50000 and AIRFLOW_GID=0 and do so in the .env file, although I didn't know where to put it, so I put it in the same folder as the docker-compose.yml and Dockerfile folder.
My PC is Windows 10 however the airflow is running on Linux.
Any ideas?
### What you think should happen instead
It should be able to install python-lzo when running pip as root
### How to reproduce
- Set up an Airflow using docker-compose
- In the Dockerfile try to add USER root and then run pip install afterwards
### Operating System
Debian GNU/Linux 11 (bullseye)
### Versions of Apache Airflow Providers
apache-airflow-providers-common-sql==1.3.2
...-ftp==3.3.0
...-http==4.1.0
...-ssh==3.0.0
The airflow python library is 2.5.0 although the airflow image itself is 2.6.2
### Deployment
Docker-Compose
### Deployment details
I am using docker-compose, although the problem is not really related to it, but more of the Dockerfile
### Anything else
Everytime I run `docker-compose build` I either get the error that I can't run pip as root, or when I remove the `USER root` from the Dockerfile then I get an error that "gcc" has permission error... Because python-lzo library has to be installed using high privilege pip.
### Are you willing to submit PR?
- [ ] 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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] boring-cyborg[bot] commented on issue #33723: Cannot run pip as root
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #33723:
URL: https://github.com/apache/airflow/issues/33723#issuecomment-1693176339
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
--
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 #33723: Cannot run pip as root
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed issue #33723: Cannot run pip as root
URL: https://github.com/apache/airflow/issues/33723
--
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