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

Issue to install python libraries inside locust container when using the locust docker image version 2.8.1 #2015

Closed
teixeira-fernando opened this issue Feb 14, 2022 · 2 comments · Fixed by #2016
Labels

Comments

@teixeira-fernando
Copy link

Describe the bug

When I started to use the latest 2.8.1 locust docker image, I had some issues when trying to install other python libraries inside the container, with my own Dockerfile. When I used the version 2.7.3, everything worked fine.

The error that is returned says that there is a permission issue in the installation process:

[2022-02-14T08:04:31.832Z] ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/opt/venv/lib/python3.9/site-packages/dotenv'

Expected behavior

We should be able to install other python libraries inside the locust container using the pip command.

Actual behavior

[2022-02-14T08:04:17.739Z] + docker-compose up --scale worker=4 --force-recreate --exit-code-from=master
[2022-02-14T08:04:18.003Z] /usr/lib/python2.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.25.3) or chardet (2.2.1) doesn't match a supported version!
[2022-02-14T08:04:18.003Z]   RequestsDependencyWarning)
[2022-02-14T08:04:18.952Z] using --exit-code-from implies --abort-on-container-exit
[2022-02-14T08:04:18.952Z] Creating network "loadtest_default" with the default driver
[2022-02-14T08:04:18.952Z] Building worker
[2022-02-14T08:04:19.214Z] Step 1/4 : FROM locustio/locust
[2022-02-14T08:04:20.611Z] latest: Pulling from locustio/locust
[2022-02-14T08:04:30.628Z] Digest: sha256:8a5ee67f76fa08fbf1126be514d2d11a9dd580d2168815edf26e55d0d5014e65
[2022-02-14T08:04:30.628Z] Status: Downloaded newer image for locustio/locust:latest
[2022-02-14T08:04:30.628Z]  ---> 4f8ce510a092
[2022-02-14T08:04:30.628Z] Step 2/4 : RUN pip3 install python-dotenv
[2022-02-14T08:04:30.628Z]  ---> Running in 8cc93894c9be
[2022-02-14T08:04:31.569Z] Collecting python-dotenv
[2022-02-14T08:04:31.569Z]   Downloading python_dotenv-0.19.2-py2.py3-none-any.whl (17 kB)
[2022-02-14T08:04:31.832Z] Installing collected packages: python-dotenv
[2022-02-14T08:04:31.832Z] ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/opt/venv/lib/python3.9/site-packages/dotenv'
[2022-02-14T08:04:31.832Z] Check the permissions.
[2022-02-14T08:04:31.832Z] 
[2022-02-14T08:04:32.094Z] WARNING: You are using pip version 21.2.4; however, version 22.0.3 is available.
[2022-02-14T08:04:32.094Z] You should consider upgrading via the '/opt/venv/bin/python -m pip install --upgrade pip' command.
[2022-02-14T08:04:32.358Z] Service 'worker' failed to build: The command '/bin/sh -c pip3 install python-dotenv' returned a non-zero code: 1

Steps to reproduce

This is my Docker file that I used to reproduce the error:

FROM locustio/locust
RUN pip3 install python-dotenv
RUN pip3 install locust-plugins

If you try to build it, it will take the latest version 2.8.1, and the error described above will happen.

Environment

  • OS: Windows 10 Enterprise (OS build 19042.1466)
  • Python version: Not applicable
  • Locust version: 2.8.1
@teixeira-fernando teixeira-fernando changed the title Issue to install python libraries when using the locust docker image version 2.8.1 Issue to install python libraries inside locust container when using the locust docker image version 2.8.1 Feb 14, 2022
@teixeira-fernando
Copy link
Author

I can see that there were some changes introduced in the locust Dockerfile comparing the versions 2.8.1 and 2.7.3. Maybe we can start the investigation from there: 2.7.3...2.8.1

@cyberw
Copy link
Collaborator

cyberw commented Feb 14, 2022

Huh. I tested that, but must have messed my test up somehow. I'll release 2.8.2 shortly with this fix...

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

Successfully merging a pull request may close this issue.

2 participants