Azure/cli

Deploy failed: Pip failed with status code 1

jwpaine opened this issue · 4 comments

Deployment action:

  deploy:
    runs-on: ubuntu-latest
    needs: build
    
    steps:
      - name: Azure Login
        uses: azure/login@v1
        with:
          creds: ${{ secrets.BUDGETAPP_AZURE_CREDENTIALS }}


      - name: Deploy to containerapp
        uses: azure/CLI@v1
        with:
          inlineScript: |
            az config set extension.use_dynamic_install=yes_without_prompt
            az containerapp registry set -n budgetapp -g rg-budgetapp --server budgetappr1ae0.azurecr.io --username  ${{ secrets.BUDGETAPP_REGISTRY_USERNAME }} --password ${{ secrets.BUDGETAPP_REGISTRY_PASSWORD }}
            az containerapp update -n budgetapp -g rg-budgetapp --image budgetappr1ae0.azurecr.io/budget:${{ github.sha }} --debug

Deployment was successful yesterday:

Run azure/CLI@v1
Starting script execution via docker image mcr.microsoft.com/azure-cli:2.50.0
WARNING: Command group 'config' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus
WARNING: The command requires the extension containerapp. It will be installed first.
WARNING: The installed extension 'containerapp' is in preview.
WARNING: Updating existing registry.
[
 {
   "identity": "",
   "passwordSecretRef": "***azurecrio-***",
   "server": "***.azurecr.io",
   "username": "***"
 }
]

deployment failed today:

Run azure/CLI@v1
  with:
    inlineScript: az config set extension.use_dynamic_install=yes_without_prompt
  az containerapp registry set -n budgetapp -g rg-budgetapp --server ***.azurecr.io --username  *** -***
  az containerapp update -n budgetapp -g rg-budgetapp --image ***.azurecr.io/budget:6e1f63fc9661fa10aa17092ac0a6[47](https://github.com/jwpaine/budget-app/actions/runs/5579021970/jobs/10194159493#step:3:47)2eded78870
  
    azcliversion: agentazcliversion
  env:
    AZURE_HTTP_USER_AGENT: 
    AZUREPS_HOST_ENVIRONMENT: 
Starting script execution via docker image mcr.microsoft.com/azure-cli:2.[50](https://github.com/jwpaine/budget-app/actions/runs/5579021970/jobs/10194159493#step:3:50).0
WARNING: Command group 'config' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus
WARNING: The command requires the extension containerapp. It will be installed first.
ERROR: An error occurred. Pip failed with status code 1. Use --debug for more information.
Error: Error: az cli script failed.
cleaning up container...
MICROSOFT_AZURE_CLI_1689[61](https://github.com/jwpaine/budget-app/actions/runs/5579021970/jobs/10194159493#step:3:62)7388694_CONTAINER

Error: az cli script failed.
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Deploy to containerapp

Any idea what might have changed?

Same problem here, worked fine this morning... i have some more info using the --debug flag:

Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Running command Getting requirements to build wheel
running egg_info
writing lib/PyYAML.egg-info/PKG-INFO
writing dependency_links to lib/PyYAML.egg-info/dependency_links.txt
writing top-level names to lib/PyYAML.egg-info/top_level.txt
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
main()
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-x6qo5260/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-x6qo5260/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-x6qo5260/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in run_setup
exec(code, locals())
File "", line 288, in
File "/tmp/pip-build-env-x6qo5260/overlay/lib/python3.10/site-packages/setuptools/init.py", line 107, in setup
return distutils.core.setup(**attrs)
File "/tmp/pip-build-env-x6qo5260/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/tmp/pip-build-env-x6qo5260/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/tmp/pip-build-env-x6qo5260/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/tmp/pip-build-env-x6qo5260/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 1234, in run_command
super().run_command(command)
File "/tmp/pip-build-env-x6qo5260/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-x6qo5260/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 314, in run
self.find_sources()
File "/tmp/pip-build-env-x6qo5260/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 322, in find_sources
mm.run()
File "/tmp/pip-build-env-x6qo5260/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 551, in run
self.add_defaults()
File "/tmp/pip-build-env-x6qo5260/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 589, in add_defaults
sdist.add_defaults(self)
File "/tmp/pip-build-env-x6qo5260/overlay/lib/python3.10/site-packages/setuptools/command/sdist.py", line 104, in add_defaults
super().add_defaults()
File "/tmp/pip-build-env-x6qo5260/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults
self._add_defaults_ext()
File "/tmp/pip-build-env-x6qo5260/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
self.filelist.extend(build_ext.get_source_files())
File "", line 204, in get_source_files
File "/tmp/pip-build-env-x6qo5260/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 107, in getattr
raise AttributeError(attr)
AttributeError: cython_sources
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /usr/local/bin/python /usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpwbjgcksv
cwd: /tmp/pip-install-3097ee7r/pyyaml_5608ca35935246c590dc9452b2d6cfa0
Getting requirements to build wheel: finished with status 'error'
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Exception information:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 160, in exc_logging_wrapper
status = run_func(*args)
File "/usr/local/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 247, in wrapper
return func(self, options, args)
File "/usr/local/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 419, in run
requirement_set = resolver.resolve(
File "/usr/local/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 92, in resolve
result = self._result = resolver.resolve(
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 481, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 373, in resolve
failure_causes = self._attempt_to_pin_criterion(name)
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 213, in _attempt_to_pin_criterion
criteria = self._get_updated_criteria(candidate)
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 204, in _get_updated_criteria
self._add_to_criteria(criteria, requirement, parent=candidate)
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 172, in _add_to_criteria
if not criterion.candidates:
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/resolvelib/structs.py", line 151, in bool
return bool(self._sequence)
File "/usr/local/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 155, in bool
return any(self)
File "/usr/local/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in
return (c for c in iterator if id(c) not in self._incompatible_ids)
File "/usr/local/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 47, in _iter_built
candidate = func()
File "/usr/local/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 206, in _make_candidate_from_link
self._link_candidate_cache[link] = LinkCandidate(
File "/usr/local/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 297, in init
super().init(
File "/usr/local/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 162, in init
self.dist = self._prepare()
File "/usr/local/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 231, in _prepare
dist = self._prepare_distribution()
File "/usr/local/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 308, in _prepare_distribution
return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
File "/usr/local/lib/python3.10/site-packages/pip/_internal/operations/prepare.py", line 491, in prepare_linked_requirement
return self._prepare_linked_requirement(req, parallel_builds)
File "/usr/local/lib/python3.10/site-packages/pip/_internal/operations/prepare.py", line 577, in _prepare_linked_requirement
dist = _get_prepared_distribution(
File "/usr/local/lib/python3.10/site-packages/pip/_internal/operations/prepare.py", line 69, in _get_prepared_distribution
abstract_dist.prepare_distribution_metadata(
File "/usr/local/lib/python3.10/site-packages/pip/_internal/distributions/sdist.py", line 48, in prepare_distribution_metadata
self._install_build_reqs(finder)
File "/usr/local/lib/python3.10/site-packages/pip/_internal/distributions/sdist.py", line 118, in _install_build_reqs
build_reqs = self._get_build_requires_wheel()
File "/usr/local/lib/python3.10/site-packages/pip/_internal/distributions/sdist.py", line 95, in _get_build_requires_wheel
return backend.get_requires_for_build_wheel()
File "/usr/local/lib/python3.10/site-packages/pip/_internal/utils/misc.py", line 701, in get_requires_for_build_wheel
return super().get_requires_for_build_wheel(config_settings=cs)
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 166, in get_requires_for_build_wheel
return self._call_hook('get_requires_for_build_wheel', ***
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 311, in _call_hook
self._subprocess_runner(
File "/usr/local/lib/python3.10/site-packages/pip/_internal/utils/subprocess.py", line 252, in runner
call_subprocess(
File "/usr/local/lib/python3.10/site-packages/pip/_internal/utils/subprocess.py", line 224, in call_subprocess
raise error
pip._internal.exceptions.InstallationSubprocessError: Getting requirements to build wheel exited with 1

This error occurred when using pip install to install the extension command module. yaml/pyyaml#724 has reported the error caused by the recent release of CPython 3.0 which has introduced a regression leading to the failure of installing PyYAML. Please check the version of PyYaml you are using in the pipeline. The solution now seems to pin PyYaml == 5.3.1 temporarily until the issue is resolved.

Strange, this happens out of the blue sky without changing anything?

Hello, i have added the following step into my pipeline

    - name: Install dependencies
      run: pip install PyYAML==5.3.1

before

    - name: Install Contaner App Extension  
      uses: Azure/cli@v1
      with:
        inlineScript: az config set extension.use_dynamic_install=yes_without_prompt 

and it was fixed.

regards
Dieter