Missing dependency: async-timeout #9291

Closed
opened 2025-12-29 20:47:53 +01:00 by adam · 8 comments
Owner

Originally created by @llamafilm on GitHub (Feb 25, 2024).

Deployment Type

Self-hosted

NetBox Version

v3.7.3

Python Version

3.11

Steps to Reproduce

  1. Follow the instructions here to install netbox on Ubuntu 22.04 with a fresh database.
  2. Edit configuration.py with database credentials and secret key
  3. The only thing I changed is python3.11 python3.11-dev python3.11-venv in this line:
sudo apt install -y python3.11 python3-pip python3.11-venv python3.11-dev build-essential libxml2-dev libxslt1-dev libffi-dev libpq-dev libssl-dev zlib1g-dev
  1. Run the upgrade script: sudo /opt/netbox/upgrade.sh

Expected Behavior

It should work without error

Observed Behavior

It fails this exception:

ModuleNotFoundError: No module named 'async_timeout'

If I use python3.10 instead this works fine.

With python3.11 I can make it work by adding async-timeout to local_requirements.txt.

Full output from upgrade.sh

Originally created by @llamafilm on GitHub (Feb 25, 2024). ### Deployment Type Self-hosted ### NetBox Version v3.7.3 ### Python Version 3.11 ### Steps to Reproduce 1. Follow the instructions [here](https://docs.netbox.dev/en/stable/installation/) to install netbox on Ubuntu 22.04 with a fresh database. 2. Edit configuration.py with database credentials and secret key 3. The only thing I changed is `python3.11 python3.11-dev python3.11-venv` in this line: ``` sudo apt install -y python3.11 python3-pip python3.11-venv python3.11-dev build-essential libxml2-dev libxslt1-dev libffi-dev libpq-dev libssl-dev zlib1g-dev ``` 4. Run the upgrade script: `sudo /opt/netbox/upgrade.sh` ### Expected Behavior It should work without error ### Observed Behavior It fails this exception: ``` ModuleNotFoundError: No module named 'async_timeout' ``` If I use python3.10 instead this works fine. With python3.11 I can make it work by adding `async-timeout` to local_requirements.txt. [Full output from upgrade.sh](https://github.com/netbox-community/netbox/files/14395846/upgrade.txt)
adam added the type: bugstatus: under review labels 2025-12-29 20:47:53 +01:00
adam closed this issue 2025-12-29 20:47:54 +01:00
Author
Owner

@markkuleinio commented on GitHub (Feb 26, 2024):

Using Python 3.11.0rc1

How does it go on Ubuntu when using proper 3.11? (Update: I see there is no non-rc-3.11 readily packaged on Ubuntu: https://packages.ubuntu.com/search?keywords=python3.11&searchon=names&exact=1&suite=all&section=all)

FWIW, the install process works fine on Debian 12 (Bookworm) and its packaged Python 3.11.

@markkuleinio commented on GitHub (Feb 26, 2024): > Using Python 3.11.0rc1 How does it go on Ubuntu when using proper 3.11? (Update: I see there is no non-rc-3.11 readily packaged on Ubuntu: https://packages.ubuntu.com/search?keywords=python3.11&searchon=names&exact=1&suite=all&section=all) FWIW, the install process works fine on Debian 12 (Bookworm) and its packaged Python 3.11.
Author
Owner

@markkuleinio commented on GitHub (Feb 26, 2024):

From https://github.com/markkuleinio/netbox-freezes/blob/main/netbox-3.7.3.txt I can see that async-timeout==4.0.3 was installed when NetBox 3.7.3 came out.

From the install output at that time (this was on Debian 12 Bookworm, using the system-packaged Python 3.11):

Collecting async-timeout>=4.0.2 (from redis!=4.0.0,!=4.0.1,>=3->django-redis==5.4.0->-r requirements.txt (line 10))

@markkuleinio commented on GitHub (Feb 26, 2024): From https://github.com/markkuleinio/netbox-freezes/blob/main/netbox-3.7.3.txt I can see that `async-timeout==4.0.3` was installed when NetBox 3.7.3 came out. From the install output at that time (this was on Debian 12 Bookworm, using the system-packaged Python 3.11): > Collecting async-timeout>=4.0.2 (from redis!=4.0.0,!=4.0.1,>=3->django-redis==5.4.0->-r requirements.txt (line 10))
Author
Owner

@jeremystretch commented on GitHub (Feb 29, 2024):

Our tests are configured to build Python 3.11 on an Ubuntu 22.04 image as well, and we've not seen any relevant issues. async-timeout-4.0.3 is getting installed as expected.

@jeremystretch commented on GitHub (Feb 29, 2024): Our tests are configured to build Python 3.11 on an Ubuntu 22.04 image as well, and we've not seen any relevant issues. `async-timeout-4.0.3` is getting installed as expected.
Author
Owner

@jeremystretch commented on GitHub (Mar 8, 2024):

As we've not been able to reproduce this bug and no further information has been provided, I'm going to close this out. If reproduction steps can be identified I'll be happy to reopen it.

@jeremystretch commented on GitHub (Mar 8, 2024): As we've not been able to reproduce this bug and no further information has been provided, I'm going to close this out. If reproduction steps can be identified I'll be happy to reopen it.
Author
Owner

@chaeynz commented on GitHub (Apr 24, 2024):

@jeremystretch Hey I have the same issue, but on Ubuntu:

$ uname -srvmpio
Linux 5.15.0-94-generic #104-Ubuntu SMP Tue Jan 9 15:25:40 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy
$ python3.11 -V
Python 3.11.0rc1

$ sudo apt install python3.11
python3.11 is already the newest version (3.11.0~rc1-1~22.04).
$ sudo PYTHON=/usr/bin/python3.11 ./upgrade.sh
*[...]*
Traceback (most recent call last):
  File "/opt/netbox-3.7.6/netbox/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 416, in execute
    django.setup()
  File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/django/apps/config.py", line 193, in create
    import_module(entry)
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/django_rq/__init__.py", line 3, in <module>
    from .decorators import job
  File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/django_rq/decorators.py", line 1, in <module>
    from rq.decorators import job as _rq_job
  File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/rq/__init__.py", line 2, in <module>
    from .connections import Connection, get_current_connection, pop_connection, push_connection
  File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/rq/connections.py", line 5, in <module>
    from redis import Connection as RedisConnection
  File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/redis/__init__.py", line 3, in <module>
    from redis import asyncio  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/redis/asyncio/__init__.py", line 1, in <module>
    from redis.asyncio.client import Redis, StrictRedis
  File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/redis/asyncio/client.py", line 33, in <module>
    from redis.asyncio.connection import (
  File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/redis/asyncio/connection.py", line 33, in <module>
    from async_timeout import timeout as async_timeout
ModuleNotFoundError: No module named 'async_timeout'
@chaeynz commented on GitHub (Apr 24, 2024): @jeremystretch Hey I have the same issue, but on Ubuntu: ``` $ uname -srvmpio Linux 5.15.0-94-generic #104-Ubuntu SMP Tue Jan 9 15:25:40 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux ``` ``` $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.3 LTS Release: 22.04 Codename: jammy ``` ``` $ python3.11 -V Python 3.11.0rc1 $ sudo apt install python3.11 python3.11 is already the newest version (3.11.0~rc1-1~22.04). ``` ``` $ sudo PYTHON=/usr/bin/python3.11 ./upgrade.sh *[...]* Traceback (most recent call last): File "/opt/netbox-3.7.6/netbox/manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line utility.execute() File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 416, in execute django.setup() File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/django/apps/registry.py", line 91, in populate app_config = AppConfig.create(entry) ^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/django/apps/config.py", line 193, in create import_module(entry) File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1206, in _gcd_import File "<frozen importlib._bootstrap>", line 1178, in _find_and_load File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 690, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 940, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/django_rq/__init__.py", line 3, in <module> from .decorators import job File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/django_rq/decorators.py", line 1, in <module> from rq.decorators import job as _rq_job File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/rq/__init__.py", line 2, in <module> from .connections import Connection, get_current_connection, pop_connection, push_connection File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/rq/connections.py", line 5, in <module> from redis import Connection as RedisConnection File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/redis/__init__.py", line 3, in <module> from redis import asyncio # noqa ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/redis/asyncio/__init__.py", line 1, in <module> from redis.asyncio.client import Redis, StrictRedis File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/redis/asyncio/client.py", line 33, in <module> from redis.asyncio.connection import ( File "/opt/netbox-3.7.6/venv/lib/python3.11/site-packages/redis/asyncio/connection.py", line 33, in <module> from async_timeout import timeout as async_timeout ModuleNotFoundError: No module named 'async_timeout' ```
Author
Owner

@markkuleinio commented on GitHub (Apr 24, 2024):

My suggestions:

  1. Since this is not NetBox issue but your installation issue, please open a discussion (instead of continuing a closed issue), maybe someone is able to help you there
  2. Don't use a release candidate version of Python ("Python 3.11.0**rc**1"), just use the packaged default and production-tested Python of Ubuntu (3.10 according to Ubuntu package search, linked above)
@markkuleinio commented on GitHub (Apr 24, 2024): My suggestions: 1. Since this is not NetBox issue but your installation issue, please open a discussion (instead of continuing a closed issue), maybe someone is able to help you there 2. Don't use a release candidate version of Python ("Python 3.11.0**_rc_**1"), just use the packaged default and production-tested Python of Ubuntu (3.10 according to Ubuntu package search, linked above)
Author
Owner

@chaeynz commented on GitHub (Apr 25, 2024):

@markkuleinio I don't need help.

I saw that this bug exists and it doesnt make sense to me why there would suddenly be a missing dependency in a specific python version. 🦐

jeremy closed this issue because there "no further information was provided". I stumbled upon and provided some information. :)

@chaeynz commented on GitHub (Apr 25, 2024): @markkuleinio I don't need help. I saw that this bug exists and it doesnt make sense to me why there would suddenly be a missing dependency in a specific python version. 🦐 jeremy closed this issue because there "no further information was provided". I stumbled upon and provided some information. :)
Author
Owner

@llamafilm commented on GitHub (Jun 2, 2024):

I noticed this same problem while installing Netbox 4.0.3 so I looked into it further. This is not a Netbox problem; it seems to be a bug with this particular version of python. async-timeout is a dependency of redis. The Ubuntu Jammy repo includes Python 3.11.0rc1, and using this version, when I run pip install redis it does not install the dependency. If I instead use Python 3.11.9 from deadsnakes PPA, it does install the dependency and all works fine.

@llamafilm commented on GitHub (Jun 2, 2024): I noticed this same problem while installing Netbox 4.0.3 so I looked into it further. This is not a Netbox problem; it seems to be a bug with this particular version of python. `async-timeout` is a dependency of `redis`. The Ubuntu Jammy repo includes Python 3.11.0rc1, and using this version, when I run `pip install redis` it does not install the dependency. If I instead use Python 3.11.9 from deadsnakes PPA, it does install the dependency and all works fine.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9291