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

error install source deadsnakes on bullseye #400

Open
mikysal78 opened this issue Sep 13, 2022 · 10 comments
Open

error install source deadsnakes on bullseye #400

mikysal78 opened this issue Sep 13, 2022 · 10 comments
Labels

Comments

@mikysal78
Copy link

- name: Install Python 3.7 and required packages from ppa:deadsnakes/ppa

i have this error:

ASK [openwisp.openwisp2: Add deadsnakes PPA] **************************************************************************************************************************************************************************************
Tuesday 13 September 2022  23:07:37 +0200 (0:00:03.758)       0:02:51.539 ***** 
fatal: [controller.nnxx.ninux.org]: FAILED! => changed=false 
  msg: 'Failed to update apt cache: E:The repository ''http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bullseye Release'' does not have a Release file.'

PLAY RECAP ******************************************************************************************************************************************************************************************************************************
controller.nnxx.ninux.org  : ok=46   changed=0    unreachable=0    failed=1    skipped=51   rescued=0    ignored=0   
@emsu-io-suefke
Copy link
Contributor

Pull request to fix this issue: #407

@mikysal78
Copy link
Author

Pull request to fix this issue: #407

When will the merge be done?
As of today, if you don't have ubuntu, you can't upgrade or install!

@mikysal78
Copy link
Author

mikysal78 commented Oct 22, 2022

I tried after the merge but I get the same error.
On my notebook i have os debian11.5 and i have this version of ansible (idem on server):

michele@mikytux:/git/new-server$ ansible --version
ansible [core 2.12.9]
  config file = /git/new-server/ansible.cfg
  configured module search path = ['/home/michele/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /git/new-server/collections
  executable location = /usr/bin/ansible
  python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]
  jinja version = 3.0.3
  libyaml = True

my ansible.cfg is:

michele@mikytux:/git/new-server$ more ansible.cfg 
[defaults]
module_set_locale=True
module_lang=it_IT.UTF-8
remote_port    = 2400
retry_files_enabled = False
nocows = 1

roles_path = roles
collections_paths = collections


ansible_managed = Ansible managed: modified on %d-%m-%Y

# Use the YAML callback plugin.
stdout_callback = yaml

# Display execution times
callback_whitelist = timer, profile_tasks

# Python interpreter discovery
interpreter_python = /usr/bin/python3
python_interprete = python3

# Fact gathering caching
gathering = smart
fact_caching = jsonfile
fact_caching_connection = .ansible_cache
fact_caching_timeout = 28800

@emsu-io-suefke
Copy link
Contributor

emsu-io-suefke commented Oct 24, 2022 via email

@mikysal78
Copy link
Author

Hi,
my hosts files (ansible -i hosts...)
is this:

## Global Vars
[all:vars]
ansible_python_interpreter=/usr/bin/python3
ansible_port=2400

[common]
controller.nnxx.ninux.org ansible_user=root

[openwisp2]
controller.nnxx.ninux.org ansible_user=root 

[CaptivePortal]
wifi.nnxx.ninux.org ansible_user=root                           

[openvpn]
openvpn.nnxx.ninux.org ansible_user=root

[dns_server]
ns1-basilicata.ninux.org ansible_host=141.95.18.146
ns2-basilicata.ninux.org ansible_host=51.178.46.85

My notebook (where I run ansible playbook) is debian 11.5

ichele@mikytux:/git/new-server$ uname -a
Linux mikytux.basilicata.nnxx 5.10.0-19-amd64 #1 SMP Debian 5.10.149-2 (2022-10-21) x86_64 GNU/Linux
michele@mikytux:/git/new-server$ python3 --version
Python 3.9.2
michele@mikytux:/git/new-server$ ll /usr/bin/python*
lrwxrwxrwx 1 root root    9 Jul 28  2021 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 3.5M Jul 14  2021 /usr/bin/python2.7
lrwxrwxrwx 1 root root    9 Apr  5  2021 /usr/bin/python3 -> python3.9
-rwxr-xr-x 1 root root 5.3M Feb 28  2021 /usr/bin/python3.9
lrwxrwxrwx 1 root root   33 Feb 28  2021 /usr/bin/python3.9-config -> x86_64-linux-gnu-python3.9-config
lrwxrwxrwx 1 root root   16 Apr  5  2021 /usr/bin/python3-config -> python3.9-config

on server (debian 11.5) (vps on ovh):

root@controller:~ # uname -a
Linux controller.nnxx.ninux.org 5.10.0-19-amd64 #1 SMP Debian 5.10.149-1 (2022-10-17) x86_64 GNU/Linux
root@controller:~ # python3 --version
Python 3.9.2
root@controller:~ # ll /usr/bin/python*
lrwxrwxrwx 1 root root    9 Apr  5  2021 /usr/bin/python3 -> python3.9
lrwxrwxrwx 1 root root   16 Apr  5  2021 /usr/bin/python3-config -> python3.9-config
-rwxr-xr-x 1 root root 5.3M Feb 28  2021 /usr/bin/python3.9
lrwxrwxrwx 1 root root   33 Feb 28  2021 /usr/bin/python3.9-config -> x86_64-linux-gnu-python3.9-config

@mikysal78
Copy link
Author

now try to cange line to file hosts from:
controller.nnxx.ninux.org ansible_user=root
to
[openwisp2]
controller.nnxx.ninux.org ansible_user=root ansible_python_interpreter=python3

bat:

TASK [openwisp.openwisp2 : Check installed python version] *****************************************************************************************************************************************************************************************
Monday 24 October 2022  19:38:34 +0200 (0:00:03.453)       0:03:16.545 ******** 
ok: [controller.nnxx.ninux.org]

TASK [openwisp.openwisp2 : Check openwisp2 should install python 3.7] ******************************************************************************************************************************************************************************
Monday 24 October 2022  19:38:37 +0200 (0:00:02.435)       0:03:18.980 ******** 
ok: [controller.nnxx.ninux.org]

TASK [openwisp.openwisp2 : Install software-properties-common] *************************************************************************************************************************************************************************************
Monday 24 October 2022  19:38:37 +0200 (0:00:00.114)       0:03:19.095 ******** 
ok: [controller.nnxx.ninux.org]

TASK [openwisp.openwisp2 : Add deadsnakes PPA] *****************************************************************************************************************************************************************************************************
Monday 24 October 2022  19:38:41 +0200 (0:00:03.849)       0:03:22.944 ******** 
fatal: [controller.nnxx.ninux.org]: FAILED! => changed=false 
  msg: 'Failed to update apt cache: E:The repository ''http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bullseye Release'' does not have a Release file.'

@mikysal78
Copy link
Author

Try to purge from apt python2.7 and reboot my notebook.

TASK [openwisp.openwisp2 : Check installed python version] *****************************************************************************************************************************************************************************************
Monday 24 October 2022  19:58:50 +0200 (0:00:02.779)       0:03:07.376 ******** 
ok: [controller.nnxx.ninux.org]

TASK [openwisp.openwisp2 : Check openwisp2 should install python 3.7] ******************************************************************************************************************************************************************************
Monday 24 October 2022  19:58:53 +0200 (0:00:02.577)       0:03:09.954 ******** 
ok: [controller.nnxx.ninux.org]

TASK [openwisp.openwisp2 : Install software-properties-common] *************************************************************************************************************************************************************************************
Monday 24 October 2022  19:58:53 +0200 (0:00:00.115)       0:03:10.069 ******** 
ok: [controller.nnxx.ninux.org]

TASK [openwisp.openwisp2 : Add deadsnakes PPA] *****************************************************************************************************************************************************************************************************
Monday 24 October 2022  19:58:56 +0200 (0:00:03.674)       0:03:13.743 ******** 
fatal: [controller.nnxx.ninux.org]: FAILED! => changed=false 
  msg: 'Failed to update apt cache: E:The repository ''http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bullseye Release'' does not have a Release file.'

PLAY RECAP *****************************************************************************************************************************************************************************************************************************************
controller.nnxx.ninux.org  : ok=47   changed=0    unreachable=0    failed=1    skipped=51   rescued=0    ignored=0   

Playbook run took 0 days, 0 hours, 4 minutes, 5 seconds
Monday 24 October 2022  19:59:48 +0200 (0:00:51.792)       0:04:05.535 ******** 
=============================================================================== 
openwisp.openwisp2 : Add deadsnakes PPA ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 51.79s
Stouts.postfix : Install requirements (Debian) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 27.68s
openwisp.influxdb : Restart influxdb ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 11.76s
Update APT package cache -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 9.23s
Stouts.postfix : Configure postfix pt. 1 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 7.73s
openwisp.openwisp2 : Update APT package cache ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 6.66s
Gathering Facts ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 5.97s
openwisp.influxdb : Add influxdb key -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 5.04s
Stouts.postfix : Ensure Postfix is started -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 4.49s
openwisp.influxdb : Install gpg (update apt cache first) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 4.09s
geerlingguy.certbot : Ensure pre and post hook folders exist. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 4.06s
openwisp.influxdb : Install system dependencies --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 4.01s
openwisp.openwisp2 : Install postgresql client drivers -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 3.89s
openwisp.influxdb : Install gpg-agent (update apt cache first) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 3.85s
openwisp.openwisp2 : Install redis ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 3.83s
geerlingguy.certbot : Create post hook to start services. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 3.80s
geerlingguy.certbot : Create pre hook to stop services. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 3.78s
openwisp.openwisp2 : Install system packages ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 3.78s
Stouts.postfix : Configure postfix pt. 4 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 3.78s
openwisp.openwisp2 : Install geographic libraries ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 3.73s
michele@mikytux:/git/new-server$ ll /usr/bin/python*
lrwxrwxrwx 1 root root    9 Apr  5  2021 /usr/bin/python3 -> python3.9
-rwxr-xr-x 1 root root 5.3M Feb 28  2021 /usr/bin/python3.9
lrwxrwxrwx 1 root root   33 Feb 28  2021 /usr/bin/python3.9-config -> x86_64-linux-gnu-python3.9-config
lrwxrwxrwx 1 root root   16 Apr  5  2021 /usr/bin/python3-config -> python3.9-config

now is installed only python 3.9

@mikysal78
Copy link
Author

is normal when run:

- debug:
    msg: "Python version: {{ openwisp2_should_install_python_37 }}"

result is:

TASK [openwisp.openwisp2 : debug] ******************************************************************************************************************************************************************************************************************
Tuesday 25 October 2022  23:28:40 +0200 (0:00:00.296)       0:03:04.838 ******* 
ok: [controller.nnxx.ninux.org] => 
  msg: |-
    Python version: False

@mikysal78
Copy link
Author

I try comment task/apt.yml lines:

#    - name: Add deadsnakes PPA
#      apt_repository:
#        repo: ppa:deadsnakes/ppa
#        state: present

and now

TASK [openwisp.openwisp2 : Install Python 3.7] *****************************************************************************************************************************************************************************************************
Wednesday 26 October 2022  00:29:57 +0200 (0:00:03.607)       0:03:22.186 ***** 
FAILED - RETRYING: [controller.nnxx.ninux.org]: Install Python 3.7 (5 retries left).
FAILED - RETRYING: [controller.nnxx.ninux.org]: Install Python 3.7 (4 retries left).
FAILED - RETRYING: [controller.nnxx.ninux.org]: Install Python 3.7 (3 retries left).
FAILED - RETRYING: [controller.nnxx.ninux.org]: Install Python 3.7 (2 retries left).
FAILED - RETRYING: [controller.nnxx.ninux.org]: Install Python 3.7 (1 retries left).
fatal: [controller.nnxx.ninux.org]: FAILED! => changed=false 
  attempts: 5
  msg: No package matching 'python3.7' is available
...ignoring

want to install python3.7 when I have python 3.9?
Something in the version control is wrong!

however for the ubuntu repo there is not exist bullseye.
a 'ubuntu or other distribution' check is required
´```
The repository ''http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bullseye Release'' does not have a Release file.'

@mikysal78
Copy link
Author

@emsu-io-suefke i try modify the file apt.yml to:

- name: Should Install Python 3.7
  block:
    - name: Check installed python version
      command: "{{ openwisp2_python }} --version"
      register: openwisp2_installed_python
      changed_when: false
    - name: Check openwisp2 should install python 3.7
      set_fact:
        openwisp2_should_install_python_37: |
          {{ ansible_python_version is version_compare('3.7', 'le') }}

    - name: Check openwisp2 should install python 3.9
      set_fact:
        openwisp2_should_install_python_39: |
          {{ ansible_python_version is version_compare('3.9', 'ge') }}

- debug:
    msg: "Python version 37: {{ openwisp2_should_install_python_37 }}"
- debug:
    msg: "Python version 39: {{ openwisp2_should_install_python_39 }}"


- name: Install Python 3.7 and required packages from ppa:deadsnakes/ppa
  block:
    - name: Install software-properties-common
      apt:
        name:
          - software-properties-common
      ignore_errors: true
      retries: 5
      delay: 10
      register: result
      until: result is success
    - name: Add deadsnakes PPA
      apt_repository:
        repo: ppa:deadsnakes/ppa
        state: present
    - name: Install Python 3.7
      apt:
        name:
          - python3.7
          - python3.7-dev
          - python3.7-venv
      ignore_errors: true
      retries: 5
      delay: 10
      register: result
      until: result is success
    - name: Set python 3.7
      set_fact:
        openwisp2_python: python3.7
  when: openwisp2_should_install_python_37

- name: Install Python 3.9 and required packages
  block:
    - name: Install software-properties-common
      apt:
        name:
          - software-properties-common
      ignore_errors: true
      retries: 5
      delay: 10
      register: result
      until: result is success
    - name: Install Python 3.9
      apt:
        name:
          - python3.9
          - python3.9-dev
          - python3.9-venv
      ignore_errors: true
      retries: 5
      delay: 10
      register: result
      until: result is success
    - name: Set python 3.9
      set_fact:
        openwisp2_python: python3.9
  when: openwisp2_should_install_python_39


- name: Install python3 packages
  apt:
    name:
      - python3-pip
      - python3-dev
      - python3-virtualenv
  retries: 5
  delay: 10
  register: result
  until: result is success
  when:
    - not openwisp2_should_install_python_37
    - not openwisp2_should_install_python_39

On the debug i have this:

TASK [openwisp.openwisp2 : debug] ******************************************************************************************************************************************************************************************************************
Saturday 05 November 2022  00:16:49 +0100 (0:00:00.108)       0:03:32.269 ***** 
ok: [controller.nnxx.ninux.org] => 
  msg: |-
    Python version 37: False

TASK [openwisp.openwisp2 : debug] ******************************************************************************************************************************************************************************************************************
Saturday 05 November 2022  00:16:50 +0100 (0:00:00.112)       0:03:32.382 ***** 
ok: [controller.nnxx.ninux.org] => 
  msg: |-
    Python version 39: True

TASK [openwisp.openwisp2 : Install software-properties-common] *************************************************************************************************************************************************************************************
Saturday 05 November 2022  00:16:50 +0100 (0:00:00.102)       0:03:32.484 ***** 
ok: [controller.nnxx.ninux.org]

TASK [openwisp.openwisp2 : Add deadsnakes PPA] *****************************************************************************************************************************************************************************************************
Saturday 05 November 2022  00:16:53 +0100 (0:00:03.775)       0:03:36.260 ***** 
^C [ERROR]: User interrupted execution

how can this problem be solved?

mikysal78 added a commit to mikysal78/ansible-openwisp2 that referenced this issue Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants