deadsnakes / issues

Issues for https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
86 stars 6 forks source link

Can not add deadsnakes PPA to system when running on Github actions #178

Closed autn closed 3 years ago

autn commented 3 years ago

description

I use Github actions to test my deployments script, but can not add deadsnakes PPA to the system. I also tried to run sudo add-apt-repository --remove ppa:deadsnakes/ppa and sudo apt update but still got:

TASK [web : Add deadsnakes team New Python Versions PPA to the apt sources list] ***
396
  fatal: [instance-xenial]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: E:The repository 'http://ppa.launchpad.net/deadsnakes/ppa/ubuntu sid Release' does not have a Release file."}
397
  fatal: [instance-focal]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: E:The repository 'http://ppa.launchpad.net/deadsnakes/ppa/ubuntu sid Release' does not have a Release file."}

os information

lsb_release -a

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:    20.04
Codename:   focal

uname -a

Linux fv-az272-709 5.8.0-1036-azure #38~20.04.1-Ubuntu SMP Thu Jun 17 14:14:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
asottile commented 3 years ago

http://ppa.launchpad.net/deadsnakes/ppa/ubuntu sid Release

this means you're in fact not running 20.04 as you're indicating -- in fact you're not even running ubuntu -- you're running debian sid

autn commented 3 years ago

@asottile thank you, but I'm sure it's Ubuntu, and it worked before. My Github action steps:

---
name: Molecule Test
on: [push, pull_request]  # yamllint disable-line rule:truthy
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      max-parallel: 4
      matrix:
        python-version: [3.6, 3.7]

    steps:
      - name: lsb_release -a
        run: lsb_release -a
      - name: uname -a
        run: uname -a
      - name: Remove deadsnakes
        run: sudo add-apt-repository --remove ppa:deadsnakes/ppa
      - name: apt update
        run: sudo apt update
      - uses: actions/checkout@v2
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install dependencies
        run: |
          python3 -m pip install --upgrade pip
          python3 -m pip install -r requirements-dev.txt
      - name: Test with molecule
        run: |
          molecule test

I copied the output from lsb_release -a and uname -a

I also tried to add the debugger before adding deadsnakes:

- name: "Debug 1"
  shell: cat /etc/os-release
  register: debug

- debug: msg="{{ debug.stdout }}"

- name: Add deadsnakes team New Python Versions PPA to the apt sources list
  apt_repository: repo='ppa:deadsnakes/ppa'
                  update_cache={{ update_apt_cache }}
                  state=present
  when: enable_deadsnakes_ppa

And the output:

TASK [web : Debug 1] ***********************************************************
  changed: [instance-focal]
  changed: [instance-xenial]

  TASK [web : debug] *************************************************************
  ok: [instance-focal] => {
      "msg": "NAME=\"Ubuntu\"\nVERSION=\"20.04.2 LTS (Focal Fossa)\"\nID=ubuntu\nID_LIKE=debian\nPRETTY_NAME=\"Ubuntu 20.04.2 LTS\"\nVERSION_ID=\"20.04\"\nHOME_URL=\"https://www.ubuntu.com/\"\nSUPPORT_URL=\"https://help.ubuntu.com/\"\nBUG_REPORT_URL=\"https://bugs.launchpad.net/ubuntu/\"\nPRIVACY_POLICY_URL=\"https://www.ubuntu.com/legal/terms-and-policies/privacy-policy\"\nVERSION_CODENAME=focal\nUBUNTU_CODENAME=focal"
  }
  ok: [instance-xenial] => {
      "msg": "NAME=\"Ubuntu\"\nVERSION=\"20.04.2 LTS (Focal Fossa)\"\nID=ubuntu\nID_LIKE=debian\nPRETTY_NAME=\"Ubuntu 20.04.2 LTS\"\nVERSION_ID=\"20.04\"\nHOME_URL=\"https://www.ubuntu.com/\"\nSUPPORT_URL=\"https://help.ubuntu.com/\"\nBUG_REPORT_URL=\"https://bugs.launchpad.net/ubuntu/\"\nPRIVACY_POLICY_URL=\"https://www.ubuntu.com/legal/terms-and-policies/privacy-policy\"\nVERSION_CODENAME=focal\nUBUNTU_CODENAME=focal"
  }

  TASK [web : Add deadsnakes team New Python Versions PPA to the apt sources list] ***
  fatal: [instance-xenial]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: E:The repository 'http://ppa.launchpad.net/deadsnakes/ppa/ubuntu sid Release' does not have a Release file."}
  fatal: [instance-focal]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: E:The repository 'http://ppa.launchpad.net/deadsnakes/ppa/ubuntu sid Release' does not have a Release file."}
asottile commented 3 years ago

your apt_repository is probably just wrong then -- it's trying to add it for sid

I don't know enough about ansible to help unfortunately but that sid bit is supposed to be focal