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

python 3.7 environment using setup-python broken in 20200705.1 #1202

Closed
1 of 6 tasks
ltalirz opened this issue Jul 8, 2020 · 23 comments
Closed
1 of 6 tasks

python 3.7 environment using setup-python broken in 20200705.1 #1202

ltalirz opened this issue Jul 8, 2020 · 23 comments
Assignees
Labels
awaiting-deployment Code complete; awaiting deployment and/or deployment in progress bug Something isn't working investigate Collect additional information, like space on disk, other tool incompatibilities etc. question Further information is requested

Comments

@ltalirz
Copy link

ltalirz commented Jul 8, 2020

Describe the bug
Builds using the setup-python Github Action end up with "inconsistent" python environment, only for runners with virtual environment version 20200705.1 (20200625.0 was/is working fine).

Area for Triage:

Question, Bug, or Feature?:
Bug

Virtual environments affected

  • macOS 10.15
  • Ubuntu 16.04 LTS
  • Ubuntu 18.04 LTS
  • Ubuntu 20.04 LTS
  • Windows Server 2016 R2
  • Windows Server 2019

(only Ubuntu 18.04 tested)

Expected behavior
Uninstalling pyyaml package should work without errors.

Actual behavior

Uninstalling the pyyaml package results in

FileNotFoundError: [Errno 2] No such file or directory: '/opt/hostedtoolcache/Python/3.7.8/x64/lib/python3.7/site-packages/PyYAML-5.3.1-py3.7-linux-x86_64.egg'

Note: This has been observed only when requesting a python environment (3.7) that was not yet installed on the runner.
When requesting python 3.8 using setup-python, this issue does not occur (in this case, pip considers pyyaml not to be installed).

Failing run with 20200705.1 : https://github.com/aiidateam/aiida-core/pull/4208/checks?check_run_id=850446697#step:5:495
Successful run with 20200625.0: https://github.com/sphuber/aiida_core/runs/850405963#step:5:452
Successful run with 20200705.1 (after switching from python3.7 to python3.8 env): https://github.com/aiidateam/aiida-core/pull/4229/checks?check_run_id=850252814#step:5:452

P.S. I'm aware that I'm not providing a "minimum working example" here - I'm currently pressed for time.
I hope this can still help pinpoint the issue in case others experience the same (and I can add more information later if needed).

@maxim-lobanov
Copy link
Contributor

@ltalirz , looks like between these image versions, Python was updated from 3.7.7 to 3.7.8. Probably, it could be the reason for errors.
Could you please try to specify exact version in your yaml to check if rollback to 3.7.7 works for you?

    - name: Set up Python 3.7
      uses: actions/setup-python@v1
      with:
        python-version: 3.7.7

@ltalirz
Copy link
Author

ltalirz commented Jul 8, 2020

Thanks, I've just tried this but I'm afraid this is not supported on the new image:

##[error]Version 3.7.7 with arch x64 not found
Available versions:

2.7.18 (x64)
3.5.9 (x64)
3.6.11 (x64)
3.7.8 (x64)
3.8.3 (x64)

https://github.com/ltalirz/aiida-core/runs/850587893

@ltalirz ltalirz changed the title python environment using setup-python broken in 20200705.1 python 3.7 environment using setup-python broken in 20200705.1 Jul 8, 2020
@maxim-lobanov
Copy link
Contributor

Oh, sorry, it is my mistake, you should specify version v2 to install versions on-flight.

  - name: Set up Python 3.7
      uses: actions/setup-python@v2
      with:
        python-version: 3.7.7

@ltalirz
Copy link
Author

ltalirz commented Jul 8, 2020

No problem - I confirm that rolling back to python 3.7.7 resolves the issue
https://github.com/ltalirz/aiida-core/runs/850614175?check_suite_focus=true#step:5:123

So perhaps the reason I am the only one noticing this is that we were using an outdated version of the setup-python github action?
If I go back to installing version 3.7 (meaning 3.7.8) with v2 of the action, should the problem disappear?

@maxim-lobanov
Copy link
Contributor

No, it won't resolve issue. The main feature of V2 is that it can install previous versions on-flight.

Looks like your code works correctly with Python 3.7.7 but fails with Python 3.7.8.
Could it be related to some updates / breaking changes / updated dependencies on Python side?

@ltalirz
Copy link
Author

ltalirz commented Jul 8, 2020

If my suspicion is correct, then simply calling "pip uninstall pyyaml" should fail.

This is what I get when I just do this:
https://github.com/ltalirz/aiida-core/runs/850664377?check_suite_focus=true#step:5:68

Edit: Ah, I need to make it non-interactive

@ltalirz
Copy link
Author

ltalirz commented Jul 8, 2020

Ok - I was wrong. Uninstalling pyyaml works just fine: https://github.com/ltalirz/aiida-core/runs/850675461?check_suite_focus=true#step:5:52

In this case, I suspect the issue must somehow be related to our dependencies. Thanks for your help!

@ltalirz ltalirz closed this as completed Jul 8, 2020
@maxim-lobanov maxim-lobanov self-assigned this Jul 8, 2020
@maxim-lobanov maxim-lobanov added question Further information is requested and removed needs triage labels Jul 8, 2020
@ltalirz
Copy link
Author

ltalirz commented Jul 8, 2020

Just in case others run into this: The issue is with the installation of the specific pyyaml version we're using (5.1.2):
https://github.com/ltalirz/aiida-core/runs/850699055?check_suite_focus=true#step:5:97

For some reason, this fails on the python 3.7.8 environment (but worked on the previous python 3.7.7 environment)'

Edit: The error only occurs, when uninstalling pyyaml 5.3.1 and installing pyyaml 5.1.2 in the same step.
Doing

        pip uninstall -y pyyaml
        pip install "pyyaml~=5.1.2"

works fine as well, see https://github.com/ltalirz/aiida-core/runs/858336584?check_suite_focus=true

astamminger added a commit to astamminger/aiida-cusp that referenced this issue Jul 9, 2020
PyYAML causes issues only for tests running on python 3.7.
A suggested change to fix this issue is fixing the python 3.7
version to the 3.7.7 minor release since test start to fail
only for 3.7.8

see: actions/runner-images#1202
astamminger added a commit to aiida-cusp/aiida-cusp that referenced this issue Jul 9, 2020
* Fix minimal aiida-core version to 1.3.0

Minimal aiida-core version has to be fixed due to the recently
introduced change in the aiida-core package moving the resources
validation to the scheduler plugin.

see aiidateam/aiida-core#4192

* Fix python version to 3.7.7 in tests

PyYAML causes issues only for tests running on python 3.7.
A suggested change to fix this issue is fixing the python 3.7
version to the 3.7.7 minor release since test start to fail
only for 3.7.8

see: actions/runner-images#1202
@ltalirz
Copy link
Author

ltalirz commented Jul 14, 2020

Just mentioning that the issue with installing pyyaml 5.1.2 over an existing installation of pyyaml 5.3.1 does not seem to occur on the official python 3.7.8 docker containers.

I.e. the following runs fine:

docker pull python:3.7.8
docker run python:3.7.8 /bin/bash -c "python --version && pip install pyyaml==5.3.1 && pip install pyyaml==5.1.2"

Which may indicate that this is a specific issue of the virtual environment 20200705.1 ?

@ltalirz ltalirz reopened this Jul 14, 2020
@maxim-lobanov maxim-lobanov added the investigate Collect additional information, like space on disk, other tool incompatibilities etc. label Jul 14, 2020
@maxim-lobanov maxim-lobanov removed their assignment Jul 14, 2020
@vsafonkin vsafonkin self-assigned this Jul 15, 2020
@vsafonkin
Copy link
Contributor

vsafonkin commented Jul 17, 2020

Hi @ltalirz , looks like pyyaml 5.3.1 is installed during aws-sam-cli installation and it is not working properly, we are investigate how to resolve the issue.

@Borda
Copy link

Borda commented Jul 20, 2020

The same also here - https://github.com/PyTorchLightning/pytorch-lightning/runs/889998403

EDIT: as #1202 (comment) corrected, only one env is failing

@maxim-lobanov
Copy link
Contributor

@Borda , Only "pytest (ubuntu-18.04, 3.7, minimal)" job fails with the same issue in your build. All other jobs failed differently.

philippotto added a commit to scalableminds/webknossos-libs that referenced this issue Jul 21, 2020
bulldozer-boy bot pushed a commit to scalableminds/webknossos-libs that referenced this issue Jul 23, 2020
…se bug (#222)

* add various improvements to nifti conversion
* fix transpose error in high-level tiff api
* refactor and clean up convert-nifti code further
* format
* refactor wkw constants
* allow to flip nifti data again with --flip_axes
* refactor bounding box parsing
* format
* format
* try to fix CI by downgrading pyyaml

see: actions/runner-images#1202
* remove pyyaml dependency
* fix linting
* fix transpose again
* format
nickguletskii added a commit to nickguletskii/ori3nt8 that referenced this issue Jul 26, 2020
@vsafonkin vsafonkin added awaiting-deployment Code complete; awaiting deployment and/or deployment in progress bug Something isn't working labels Jul 27, 2020
@DataGreed
Copy link

DataGreed commented Jul 27, 2020

Is there any workaround for this? I have PyYAML==5.1.2 in my requirements.txt file and I run into this issue, too. What's even more annoying is that other jobs testing my project on other python versions got cancelled because this one fails.

@DataGreed
Copy link

DataGreed commented Jul 27, 2020

Okay, in my case the error line read:

File "/opt/hostedtoolcache/Python/3.7.8/x64/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1731, in zipinfo
    return self._zip_manifests.load(self.loader.archive)
  File "/opt/hostedtoolcache/Python/3.7.8/x64/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1688, in load
    mtime = os.stat(path).st_mtime
FileNotFoundError: [Errno 2] No such file or directory: '/opt/hostedtoolcache/Python/3.7.8/x64/lib/python3.7/site-packages/PyYAML-5.3.1-py3.7-linux-x86_64.egg'
##[error]Process completed with exit code 1.

I had this in requirements.txt:

PyYAML==5.1.2

Changing it to:

PyYAML==5.3.1

Solved my problem.

Seems that one of the installed packages required PyYAML==5.3.1, but for some reason my requirements file had older version (actually it was generated by pip freeze, so I have no idea how it happened).

@Borda
Copy link

Borda commented Jul 27, 2020

Well, is it general pip issue or just this CI, if so we do not force users to install a newer version just because if CI tests, right?

@miketimofeev
Copy link
Contributor

@Borda @DataGreed we fixed the issue with python 3.7 a few days ago and started image deployment today. It usually takes 3-4 days to propagate to all the environments. Thank you for your patience.

@DataGreed
Copy link

@miketimofeev большое спасибо :)

@zgoda
Copy link

zgoda commented Jul 30, 2020

Is this new normal?

ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.
Successfully installed Babel-2.8.0 Bootstrap-Flask-1.4 Faker-4.1.1 Flask-1.1.2 Flask-Babel-1.0.0 Flask-Login-0.5.0 Flask-WTF-0.14.3 Jinja2-2.11.2 MarkupSafe-1.1.1 PeeWee-3.13.3 SecretStorage-3.1.2 WTForms-2.3.1 argon2-cffi-20.1.0 blinker-1.4 cffi-1.14.1 coverage-5.2.1 cryptography-3.0 decorator-4.4.2 factory-boy-2.12.0 inflection-0.5.0 iniconfig-1.0.0 itsdangerous-1.1.0 jeepney-0.4.3 keyring-21.2.1 keyrings.cryptfile-1.3.4 markdown-3.2.2 more-itertools-8.4.0 packaging-20.4 pluggy-0.13.1 py-1.9.0 pycparser-2.20 pycryptodome-3.9.8 pyparsing-2.4.7 pytest-6.0.0 pytest-cov-2.10.0 pytest-factoryboy-2.0.3 pytest-flask-1.0.0 pytest-mock-3.2.0 python-dateutil-2.8.1 python-dotenv-0.14.0 python-magic-0.4.18 sentry-sdk-0.16.2 text-unidecode-1.3 texttable-1.6.2 toml-0.10.1 validators-0.16.0

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

aws-sam-cli 1.0.0 requires Flask~=1.0.2, but you'll have flask 1.1.2 which is incompatible.
aws-sam-cli 1.0.0 requires python-dateutil<2.8.1,~=2.6, but you'll have python-dateutil 2.8.1 which is incompatible.

@miketimofeev
Copy link
Contributor

@zgoda could you please provide the command, which produced such output?

@zgoda
Copy link

zgoda commented Jul 30, 2020

It's a log from one of my workflows running on Python 3.7 runtime, can't recall exactly which one but https://github.com/zgoda/bip/runs/929067312 has the same output.

Basically Python 3.7 runtime has a lot of either outdated or pre-release packages installed, like:

2020-07-30T18:56:03.2115932Z   Attempting uninstall: itsdangerous
2020-07-30T18:56:03.2171330Z     Found existing installation: itsdangerous 2.0.0a1
2020-07-30T18:56:03.2177836Z     Uninstalling itsdangerous-2.0.0a1:
2020-07-30T18:56:03.2617111Z       Successfully uninstalled itsdangerous-2.0.0a1
2020-07-30T18:56:03.2780445Z   Attempting uninstall: MarkupSafe
2020-07-30T18:56:03.2846347Z     Found existing installation: MarkupSafe 2.0.0a1
2020-07-30T18:56:03.2854577Z     Uninstalling MarkupSafe-2.0.0a1:
2020-07-30T18:56:03.3272337Z       Successfully uninstalled MarkupSafe-2.0.0a1
2020-07-30T18:56:03.3367490Z   Attempting uninstall: Jinja2
2020-07-30T18:56:03.3425437Z     Found existing installation: Jinja2 3.0.0a1
2020-07-30T18:56:03.3436269Z     Uninstalling Jinja2-3.0.0a1:
2020-07-30T18:56:03.3853792Z       Successfully uninstalled Jinja2-3.0.0a1

Flask 1.0.4 and python-dateutil 2.8.0 are installed with aws-sam-cli but anyway they should not be in a runtime used to run tests.

@miketimofeev
Copy link
Contributor

@zgoda yeah, this is the same issue with aws-sam packages. It will be fixed on the next week's deployment.

@miketimofeev
Copy link
Contributor

@ltalirz we've completed image deployment. Could you check everything is fine now, please?

@ltalirz
Copy link
Author

ltalirz commented Aug 6, 2020

Thanks @miketimofeev - looks to me like the issue is resolved!

@ltalirz ltalirz closed this as completed Aug 6, 2020
astamminger added a commit to astamminger/aiida-cusp that referenced this issue Mar 9, 2022
* Fix minimal aiida-core version to 1.3.0

Minimal aiida-core version has to be fixed due to the recently
introduced change in the aiida-core package moving the resources
validation to the scheduler plugin.

see aiidateam/aiida-core#4192

* Fix python version to 3.7.7 in tests

PyYAML causes issues only for tests running on python 3.7.
A suggested change to fix this issue is fixing the python 3.7
version to the 3.7.7 minor release since test start to fail
only for 3.7.8

see: actions/runner-images#1202
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-deployment Code complete; awaiting deployment and/or deployment in progress bug Something isn't working investigate Collect additional information, like space on disk, other tool incompatibilities etc. question Further information is requested
Projects
None yet
Development

No branches or pull requests

7 participants