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

Azure Pipelines failing due to pip error #21691

Closed
stephenmcgruer opened this issue Feb 10, 2020 · 7 comments · Fixed by #21722
Closed

Azure Pipelines failing due to pip error #21691

stephenmcgruer opened this issue Feb 10, 2020 · 7 comments · Fixed by #21722

Comments

@stephenmcgruer
Copy link
Contributor

At time of filing, the last ~10 runs on https://dev.azure.com/web-platform-tests/wpt/_build?definitionId=1&_a=summary fail multiple sub-commands due to:

/bin/bash --noprofile --norc /Users/runner/runners/2.164.7/work/_temp/39d98253-aff3-4b3a-b181-a39efc0fca53.sh
Traceback (most recent call last):
  File "/Users/runner/runners/2.164.7/work/1/s/_venv/bin/pip", line 6, in <module>
    from pip._internal.cli.main import main
ImportError: No module named main
CRITICAL:tools.wpt.utils:('/Users/runner/runners/2.164.7/work/1/s/_venv/bin/pip', 'install', '--prefer-binary', u'requests') exited with return code 1
CRITICAL:tools.wpt.utils:
Traceback (most recent call last):
  File "./wpt", line 12, in <module>
    wpt.main()
  File "/Users/runner/runners/2.164.7/work/1/s/tools/wpt/wpt.py", line 144, in main
    venv = setup_virtualenv(main_args.venv, main_args.skip_venv_setup, props)
  File "/Users/runner/runners/2.164.7/work/1/s/tools/wpt/wpt.py", line 122, in setup_virtualenv
    venv.install(name)
  File "/Users/runner/runners/2.164.7/work/1/s/tools/wpt/virtualenv.py", line 111, in install
    call(self.pip_path, "install", "--prefer-binary", *requirements)
  File "/Users/runner/runners/2.164.7/work/1/s/tools/wpt/utils.py", line 49, in call
    return subprocess.check_output(args)
  File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '('/Users/runner/runners/2.164.7/work/1/s/_venv/bin/pip', 'install', '--prefer-binary', u'requests')' returned non-zero exit status 1

Not sure yet whether this is an Azure Pipelines problem or a WPT problem. cc @mustjab in case, and @foolip mentioned that @jgraham may have recently mentioned dealing with a problem like this elsewhere?

@foolip
Copy link
Member

foolip commented Feb 10, 2020

I don't see any recent changes on master that could obviously have caused this, but maybe the version of pip installed on Azure Pipelines changed.

The recent failure I remember had something to do with pypa/pip#7621 I think.

@foolip
Copy link
Member

foolip commented Feb 10, 2020

https://dev.azure.com/web-platform-tests/wpt/_build/results?buildId=41863&view=logs&j=bf8f5026-3d1f-5955-26be-17f9e1ef0bb3&t=ba27e54b-6052-5ce8-7e19-8f300f61f1be&l=19 shows that pip 19.3.1 is in use.

Unfortunately we don't have the version information for previous runs so we can't tell if it changed recently or not. However, it's doubtful it's because of pypa/pip#7621.

@foolip
Copy link
Member

foolip commented Feb 10, 2020

https://stackoverflow.com/q/60004431 had a similar error and involved pip in a virtualenv, which is also the case here.

@stephenmcgruer I'd suggest experimenting with installing or reinstalling pip to see if that has any effect.

@stephenmcgruer
Copy link
Contributor Author

So 18a3e16 attempted to upgrade pip itself during the run. It was upgraded from pip 19.3.1 to pip-20.0.2.

That did not hit ImportError: No module named main but instead hit:

Successfully built wptrunner
Installing collected packages: wptrunner
  Attempting uninstall: wptrunner
    Found existing installation: wptrunner 1.14
    Can't uninstall 'wptrunner'. No files were found to uninstall.
  ERROR: Can't roll back wptrunner; was not uninstalled
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/requirements'
Consider using the `--user` option or check the permissions.

@stephenmcgruer
Copy link
Contributor Author

Uninstalling and reinstalling pip appeared to have the same effect as upgrading it; permission denied trying to access /usr/local/requirements. It's not clear to me why its going after /usr/local/requirements, rather than .tox/py27/requirements/...

@stephenmcgruer
Copy link
Contributor Author

@foolip I'm heading out of the office now, but the above contains the very little I've learnt over the last hour and a bit. #21697 has a azure pipelines run with a pip reinstall and lots of verbosity turned on in tox, but I still can't make much sense of it.

foolip added a commit that referenced this issue Feb 11, 2020
https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/use-python-version?view=azure-devops

The default python/pip on the macOS VMs don't any longer. It may be
possible to fix this, but to fix the urgent issue use the method
that's supported by Azure Pipelines.

The python version will remain unchanged at 2.7.17, but pip will
change from 19.3.1 to 20.0.2.

pip_install.yml can be simplified because the remaining code path is
the same for macOS and Windows.

Fixes #21691.
@foolip
Copy link
Member

foolip commented Feb 11, 2020

I'm trying #21722, it seemed to work on an experiment branch.

foolip added a commit that referenced this issue Feb 11, 2020
https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/use-python-version?view=azure-devops

The default python/pip on the macOS VMs don't any longer. It may be
possible to fix this, but to fix the urgent issue use the method
that's supported by Azure Pipelines.

The python version will remain unchanged at 2.7.17, but pip will
change from 19.3.1 to 20.0.2.

pip_install.yml can be simplified because the remaining code path is
the same for macOS and Windows.

Fixes #21691.
foolip added a commit that referenced this issue Feb 11, 2020
)

https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/use-python-version?view=azure-devops

The default python/pip on the macOS VMs don't work any longer. It may be
possible to fix this, but to fix the urgent issue use the method
that's supported by Azure Pipelines.

The python version will remain unchanged at 2.7.17, but pip will
change from 19.3.1 to 20.0.2.

pip_install.yml can be simplified because the remaining code path is
the same for macOS and Windows.

Fixes #21691.
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Feb 15, 2020
…Use Python Version" task, a=testonly

Automatic update from web-platform-tests
[Azure Pipelines] Consistently use the "Use Python Version" task (#21722)

https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/use-python-version?view=azure-devops

The default python/pip on the macOS VMs don't work any longer. It may be
possible to fix this, but to fix the urgent issue use the method
that's supported by Azure Pipelines.

The python version will remain unchanged at 2.7.17, but pip will
change from 19.3.1 to 20.0.2.

pip_install.yml can be simplified because the remaining code path is
the same for macOS and Windows.

Fixes web-platform-tests/wpt#21691.
--

wpt-commits: cd29a90fe885290847182ec381b7023099ce60d9
wpt-pr: 21722
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Feb 16, 2020
…Use Python Version" task, a=testonly

Automatic update from web-platform-tests
[Azure Pipelines] Consistently use the "Use Python Version" task (#21722)

https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/use-python-version?view=azure-devops

The default python/pip on the macOS VMs don't work any longer. It may be
possible to fix this, but to fix the urgent issue use the method
that's supported by Azure Pipelines.

The python version will remain unchanged at 2.7.17, but pip will
change from 19.3.1 to 20.0.2.

pip_install.yml can be simplified because the remaining code path is
the same for macOS and Windows.

Fixes web-platform-tests/wpt#21691.
--

wpt-commits: cd29a90fe885290847182ec381b7023099ce60d9
wpt-pr: 21722

UltraBlame original commit: 4e05fce7636d0a9747a13aa2918cb198cf9caf83
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Feb 16, 2020
…Use Python Version" task, a=testonly

Automatic update from web-platform-tests
[Azure Pipelines] Consistently use the "Use Python Version" task (#21722)

https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/use-python-version?view=azure-devops

The default python/pip on the macOS VMs don't work any longer. It may be
possible to fix this, but to fix the urgent issue use the method
that's supported by Azure Pipelines.

The python version will remain unchanged at 2.7.17, but pip will
change from 19.3.1 to 20.0.2.

pip_install.yml can be simplified because the remaining code path is
the same for macOS and Windows.

Fixes web-platform-tests/wpt#21691.
--

wpt-commits: cd29a90fe885290847182ec381b7023099ce60d9
wpt-pr: 21722

UltraBlame original commit: 4e05fce7636d0a9747a13aa2918cb198cf9caf83
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Feb 16, 2020
…Use Python Version" task, a=testonly

Automatic update from web-platform-tests
[Azure Pipelines] Consistently use the "Use Python Version" task (#21722)

https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/use-python-version?view=azure-devops

The default python/pip on the macOS VMs don't work any longer. It may be
possible to fix this, but to fix the urgent issue use the method
that's supported by Azure Pipelines.

The python version will remain unchanged at 2.7.17, but pip will
change from 19.3.1 to 20.0.2.

pip_install.yml can be simplified because the remaining code path is
the same for macOS and Windows.

Fixes web-platform-tests/wpt#21691.
--

wpt-commits: cd29a90fe885290847182ec381b7023099ce60d9
wpt-pr: 21722

UltraBlame original commit: 4e05fce7636d0a9747a13aa2918cb198cf9caf83
xeonchen pushed a commit to xeonchen/gecko that referenced this issue Feb 18, 2020
…Use Python Version" task, a=testonly

Automatic update from web-platform-tests
[Azure Pipelines] Consistently use the "Use Python Version" task (#21722)

https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/use-python-version?view=azure-devops

The default python/pip on the macOS VMs don't work any longer. It may be
possible to fix this, but to fix the urgent issue use the method
that's supported by Azure Pipelines.

The python version will remain unchanged at 2.7.17, but pip will
change from 19.3.1 to 20.0.2.

pip_install.yml can be simplified because the remaining code path is
the same for macOS and Windows.

Fixes web-platform-tests/wpt#21691.
--

wpt-commits: cd29a90fe885290847182ec381b7023099ce60d9
wpt-pr: 21722
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants