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

Releaser action fails with Ubuntu 24.04 #81

Closed
Silverlan opened this issue May 23, 2024 · 7 comments · Fixed by #83
Closed

Releaser action fails with Ubuntu 24.04 #81

Silverlan opened this issue May 23, 2024 · 7 comments · Fixed by #83
Assignees
Labels
Bug Something isn't working Releaser Action 'releaser'

Comments

@Silverlan
Copy link
Contributor

Trying to run the releaser action on a Ubuntu 24.04 runner fails with the following error message:

Run pyTooling/Actions/releaser/composite@main
  with:
    tag: nightly
    token: ***
    files: README.md
    rm: false
    snapshots: true
Run pip install --disable-pip-version-check PyGithub --progress-bar off
  pip install --disable-pip-version-check PyGithub --progress-bar off
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Error: Process completed with exit code 1.

Here's my test workflow:

name: Release Test
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  workflow_dispatch:

permissions:
  contents: write

jobs:
  build:
    name: Build - ${{ matrix.config.os }}
    runs-on: ${{ matrix.config.os }}
    strategy:
      fail-fast: false
      matrix:
        config:
          - os: ubuntu-24.04
            name: "Ubuntu 24.04"
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true

      - name: Release
        uses: pyTooling/Actions/releaser/composite@main
        with:
          tag: nightly
          token: ${{ secrets.GITHUB_TOKEN }}
          files: "README.md"

https://github.com/Silverlan/test_github_release/blob/main/.github/workflows/release-test.yml

Here's the entire workflow log:

2024-05-23T09:16:05.6170840Z Current runner version: '2.316.1'
2024-05-23T09:16:05.6194154Z ##[group]Operating System
2024-05-23T09:16:05.6194747Z Ubuntu
2024-05-23T09:16:05.6195257Z 24.04
2024-05-23T09:16:05.6195716Z LTS
2024-05-23T09:16:05.6196028Z ##[endgroup]
2024-05-23T09:16:05.6196426Z ##[group]Runner Image
2024-05-23T09:16:05.6196912Z Image: ubuntu-24.04
2024-05-23T09:16:05.6197279Z Version: 20240516.4.0
2024-05-23T09:16:05.6198278Z Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20240516.4/images/ubuntu/Ubuntu2404-Readme.md
2024-05-23T09:16:05.6199764Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20240516.4
2024-05-23T09:16:05.6200620Z ##[endgroup]
2024-05-23T09:16:05.6200995Z ##[group]Runner Image Provisioner
2024-05-23T09:16:05.6201519Z 2.0.369.1
2024-05-23T09:16:05.6201859Z ##[endgroup]
2024-05-23T09:16:05.6202766Z ##[group]GITHUB_TOKEN Permissions
2024-05-23T09:16:05.6204344Z Contents: write
2024-05-23T09:16:05.6204768Z Metadata: read
2024-05-23T09:16:05.6205585Z ##[endgroup]
2024-05-23T09:16:05.6208812Z Secret source: Actions
2024-05-23T09:16:05.6209572Z Prepare workflow directory
2024-05-23T09:16:05.6880151Z Prepare all required actions
2024-05-23T09:16:05.7044541Z Getting action download info
2024-05-23T09:16:05.8953057Z Download action repository 'actions/checkout@v2' (SHA:ee0669bd1cc54295c223e0bb666b733df41de1c5)
2024-05-23T09:16:06.0414555Z Download action repository 'pyTooling/Actions@main' (SHA:e9d0dc3dba9fda45f195946858708f60c0240caf)
2024-05-23T09:16:06.7933226Z Complete job name: Build - ubuntu-24.04
2024-05-23T09:16:06.8818303Z ##[group]Run actions/checkout@v2
2024-05-23T09:16:06.8818776Z with:
2024-05-23T09:16:06.8819050Z   submodules: true
2024-05-23T09:16:06.8819415Z   repository: Silverlan/test_github_release
2024-05-23T09:16:06.8820064Z   token: ***
2024-05-23T09:16:06.8820370Z   ssh-strict: true
2024-05-23T09:16:06.8820711Z   persist-credentials: true
2024-05-23T09:16:06.8821087Z   clean: true
2024-05-23T09:16:06.8821369Z   fetch-depth: 1
2024-05-23T09:16:06.8821665Z   lfs: false
2024-05-23T09:16:06.8821958Z   set-safe-directory: true
2024-05-23T09:16:06.8822310Z ##[endgroup]
2024-05-23T09:16:09.5230571Z Syncing repository: Silverlan/test_github_release
2024-05-23T09:16:09.5283367Z ##[group]Getting Git version info
2024-05-23T09:16:09.5284618Z Working directory is '/home/runner/work/test_github_release/test_github_release'
2024-05-23T09:16:09.5318791Z [command]/usr/bin/git version
2024-05-23T09:16:09.5527248Z git version 2.45.1
2024-05-23T09:16:09.5551559Z ##[endgroup]
2024-05-23T09:16:09.5571643Z Temporarily overriding HOME='/home/runner/work/_temp/290c090c-b9a5-4ff0-a2da-de71c4fdcc9e' before making global git config changes
2024-05-23T09:16:09.5573372Z Adding repository directory to the temporary git global config as a safe directory
2024-05-23T09:16:09.5576080Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/test_github_release/test_github_release
2024-05-23T09:16:09.5622917Z Deleting the contents of '/home/runner/work/test_github_release/test_github_release'
2024-05-23T09:16:09.5627686Z ##[group]Initializing the repository
2024-05-23T09:16:09.5631653Z [command]/usr/bin/git init /home/runner/work/test_github_release/test_github_release
2024-05-23T09:16:09.5718187Z hint: Using 'master' as the name for the initial branch. This default branch name
2024-05-23T09:16:09.5719206Z hint: is subject to change. To configure the initial branch name to use in all
2024-05-23T09:16:09.5719896Z hint: of your new repositories, which will suppress this warning, call:
2024-05-23T09:16:09.5720397Z hint:
2024-05-23T09:16:09.5720777Z hint: 	git config --global init.defaultBranch <name>
2024-05-23T09:16:09.5721258Z hint:
2024-05-23T09:16:09.5722001Z hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
2024-05-23T09:16:09.5722928Z hint: 'development'. The just-created branch can be renamed via this command:
2024-05-23T09:16:09.5723411Z hint:
2024-05-23T09:16:09.5723700Z hint: 	git branch -m <name>
2024-05-23T09:16:09.5724263Z Initialized empty Git repository in /home/runner/work/test_github_release/test_github_release/.git/
2024-05-23T09:16:09.5730489Z [command]/usr/bin/git remote add origin https://github.com/Silverlan/test_github_release
2024-05-23T09:16:09.5772749Z ##[endgroup]
2024-05-23T09:16:09.5773522Z ##[group]Disabling automatic garbage collection
2024-05-23T09:16:09.5776713Z [command]/usr/bin/git config --local gc.auto 0
2024-05-23T09:16:09.5810649Z ##[endgroup]
2024-05-23T09:16:09.5811252Z ##[group]Setting up auth
2024-05-23T09:16:09.5817188Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2024-05-23T09:16:09.5852537Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2024-05-23T09:16:09.6191939Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2024-05-23T09:16:09.6226438Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2024-05-23T09:16:09.6459369Z [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
2024-05-23T09:16:09.6501530Z ##[endgroup]
2024-05-23T09:16:09.6502306Z ##[group]Fetching the repository
2024-05-23T09:16:09.6510315Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +c436bebc8c3a4b928be986ef4eb0c08952b36df3:refs/remotes/origin/main
2024-05-23T09:16:10.0164434Z remote: Enumerating objects: 6, done.        
2024-05-23T09:16:10.0166080Z remote: Counting objects:  16% (1/6)        
2024-05-23T09:16:10.0167265Z remote: Counting objects:  33% (2/6)        
2024-05-23T09:16:10.0167827Z remote: Counting objects:  50% (3/6)        
2024-05-23T09:16:10.0168393Z remote: Counting objects:  66% (4/6)        
2024-05-23T09:16:10.0169102Z remote: Counting objects:  83% (5/6)        
2024-05-23T09:16:10.0169679Z remote: Counting objects: 100% (6/6)        
2024-05-23T09:16:10.0170283Z remote: Counting objects: 100% (6/6), done.        
2024-05-23T09:16:10.0171012Z remote: Compressing objects:  33% (1/3)        
2024-05-23T09:16:10.0171467Z remote: Compressing objects:  66% (2/3)        
2024-05-23T09:16:10.0172010Z remote: Compressing objects: 100% (3/3)        
2024-05-23T09:16:10.0172762Z remote: Compressing objects: 100% (3/3), done.        
2024-05-23T09:16:10.0173776Z remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 0        
2024-05-23T09:16:10.0501647Z From https://github.com/Silverlan/test_github_release
2024-05-23T09:16:10.0503060Z  * [new ref]         c436bebc8c3a4b928be986ef4eb0c08952b36df3 -> origin/main
2024-05-23T09:16:10.0528221Z ##[endgroup]
2024-05-23T09:16:10.0528978Z ##[group]Determining the checkout info
2024-05-23T09:16:10.0530335Z ##[endgroup]
2024-05-23T09:16:10.0531111Z ##[group]Checking out the ref
2024-05-23T09:16:10.0535051Z [command]/usr/bin/git checkout --progress --force -B main refs/remotes/origin/main
2024-05-23T09:16:10.0581427Z Switched to a new branch 'main'
2024-05-23T09:16:10.0584285Z branch 'main' set up to track 'origin/main'.
2024-05-23T09:16:10.0589339Z ##[endgroup]
2024-05-23T09:16:10.0590535Z ##[group]Setting up auth for fetching submodules
2024-05-23T09:16:10.0594967Z [command]/usr/bin/git config --global http.https://github.com/.extraheader AUTHORIZATION: basic ***
2024-05-23T09:16:10.0637743Z [command]/usr/bin/git config --global --unset-all url.https://github.com/.insteadOf
2024-05-23T09:16:10.0680809Z [command]/usr/bin/git config --global --add url.https://github.com/.insteadOf git@github.com:
2024-05-23T09:16:10.0721123Z [command]/usr/bin/git config --global --add url.https://github.com/.insteadOf org-3609960@github.com:
2024-05-23T09:16:10.0754054Z ##[endgroup]
2024-05-23T09:16:10.0754960Z ##[group]Fetching submodules
2024-05-23T09:16:10.0757699Z [command]/usr/bin/git submodule sync
2024-05-23T09:16:10.0991488Z [command]/usr/bin/git -c protocol.version=2 submodule update --init --force --depth=1
2024-05-23T09:16:10.1224917Z [command]/usr/bin/git submodule foreach git config --local gc.auto 0
2024-05-23T09:16:10.1470692Z ##[endgroup]
2024-05-23T09:16:10.1471516Z ##[group]Persisting credentials for submodules
2024-05-23T09:16:10.1478922Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'url\.https\:\/\/github\.com\/\.insteadOf' && git config --local --unset-all 'url.https://github.com/.insteadOf' || :"
2024-05-23T09:16:10.1712396Z [command]/usr/bin/git submodule foreach sh -c "git config --local 'http.https://github.com/.extraheader' 'AUTHORIZATION: basic ***' && git config --local --show-origin --name-only --get-regexp remote.origin.url"
2024-05-23T09:16:10.1941899Z [command]/usr/bin/git submodule foreach git config --local --add 'url.https://github.com/.insteadOf' 'git@github.com:'
2024-05-23T09:16:10.2170125Z [command]/usr/bin/git submodule foreach git config --local --add 'url.https://github.com/.insteadOf' 'org-3609960@github.com:'
2024-05-23T09:16:10.2394376Z ##[endgroup]
2024-05-23T09:16:10.2435769Z [command]/usr/bin/git log -1 --format='%H'
2024-05-23T09:16:10.2467850Z 'c436bebc8c3a4b928be986ef4eb0c08952b36df3'
2024-05-23T09:16:10.2776930Z ##[group]Run pyTooling/Actions/releaser/composite@main
2024-05-23T09:16:10.2777472Z with:
2024-05-23T09:16:10.2777870Z   tag: nightly
2024-05-23T09:16:10.2778467Z   token: ***
2024-05-23T09:16:10.2778806Z   files: README.md
2024-05-23T09:16:10.2779198Z   rm: false
2024-05-23T09:16:10.2779491Z   snapshots: true
2024-05-23T09:16:10.2779815Z ##[endgroup]
2024-05-23T09:16:10.3079559Z ##[group]Run pip install --disable-pip-version-check PyGithub --progress-bar off
2024-05-23T09:16:10.3080331Z �[36;1mpip install --disable-pip-version-check PyGithub --progress-bar off�[0m
2024-05-23T09:16:10.3110953Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2024-05-23T09:16:10.3111391Z ##[endgroup]
2024-05-23T09:16:11.8207988Z error: externally-managed-environment
2024-05-23T09:16:11.8208455Z 
2024-05-23T09:16:11.8209182Z × This environment is externally managed
2024-05-23T09:16:11.8210136Z ╰─> To install Python packages system-wide, try apt install
2024-05-23T09:16:11.8212122Z     python3-xyz, where xyz is the package you are trying to
2024-05-23T09:16:11.8212760Z     install.
2024-05-23T09:16:11.8213073Z     
2024-05-23T09:16:11.8213675Z     If you wish to install a non-Debian-packaged Python package,
2024-05-23T09:16:11.8214592Z     create a virtual environment using python3 -m venv path/to/venv.
2024-05-23T09:16:11.8215694Z     Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
2024-05-23T09:16:11.8216471Z     sure you have python3-full installed.
2024-05-23T09:16:11.8216925Z     
2024-05-23T09:16:11.8217495Z     If you wish to install a non-Debian packaged Python application,
2024-05-23T09:16:11.8218330Z     it may be easiest to use pipx install xyz, which will manage a
2024-05-23T09:16:11.8219197Z     virtual environment for you. Make sure you have pipx installed.
2024-05-23T09:16:11.8219825Z     
2024-05-23T09:16:11.8220326Z     See /usr/share/doc/python3.12/README.venv for more information.
2024-05-23T09:16:11.8220869Z 
2024-05-23T09:16:11.8222529Z note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
2024-05-23T09:16:11.8224386Z hint: See PEP 668 for the detailed specification.
2024-05-23T09:16:11.8590991Z ##[error]Process completed with exit code 1.
2024-05-23T09:16:11.8684351Z Post job cleanup.
2024-05-23T09:16:11.9716205Z [command]/usr/bin/git version
2024-05-23T09:16:11.9768198Z git version 2.45.1
2024-05-23T09:16:11.9809517Z Temporarily overriding HOME='/home/runner/work/_temp/0970967f-58f6-4283-a439-81a2870eba99' before making global git config changes
2024-05-23T09:16:11.9810874Z Adding repository directory to the temporary git global config as a safe directory
2024-05-23T09:16:11.9815309Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/test_github_release/test_github_release
2024-05-23T09:16:11.9855223Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2024-05-23T09:16:11.9892042Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2024-05-23T09:16:12.0128539Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2024-05-23T09:16:12.0156350Z http.https://github.com/.extraheader
2024-05-23T09:16:12.0166279Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2024-05-23T09:16:12.0203552Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2024-05-23T09:16:12.0662662Z Cleaning up orphan processes
@Paebbels Paebbels added Releaser Action 'releaser' Bug Something isn't working labels Jul 29, 2024
@Paebbels
Copy link
Member

I'm open to accept pull requests.

Please also see #82.

@VMelnalksnis
Copy link

This breaks builds on GitHub's ubuntu-latest (22.04.4):

Run pip install --disable-pip-version-check PyGithub --progress-bar off --break-system-packages
  pip install --disable-pip-version-check PyGithub --progress-bar off --break-system-packages
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    DOTNET_NOLOGO: true
    DOTNET_CLI_TELEMETRY_OPTOUT: true
    DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

Usage:   
  pip install [options] <requirement specifier> [package-index-options] ...
  pip install [options] -r <requirements file> [package-index-options] ...
  pip install [options] [-e] <vcs project url> ...
  pip install [options] [-e] <local project path> ...
  pip install [options] <archive url/path> ...

no such option: --break-system-packages
Error: Process completed with exit code 2.

@Paebbels
Copy link
Member

Paebbels commented Aug 6, 2024

@VMelnalksnis which tag are you using?

Ubuntu got feisty in it's fight between apt vs. pip. In 24.04, this switch is required because Ubuntu packages pure Python code packages via apt and requires (very very slow) updates via apt only. They trying to dismantle the wohle pip system

In Ubuntu 22.04, this switch does not yet exist.

Let me try to add the switch based on the Ubuntu / image version.

@Paebbels Paebbels reopened this Aug 6, 2024
@VMelnalksnis
Copy link

v1.0.5 works without any issues, I was using main when I caught the issue.

@Paebbels
Copy link
Member

Paebbels commented Aug 6, 2024

Please check the main branch again. I pushed a fix: 706ef39

When you confirm it, I can tag it.

@VMelnalksnis
Copy link

Reran the failed job, works with main now as well.

@Paebbels
Copy link
Member

Paebbels commented Aug 6, 2024

Branch r1 has been updated and tag v1.0.7 was added.

@Paebbels Paebbels closed this as completed Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Releaser Action 'releaser'
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants