Netbox-rq crushed #10528

Closed
opened 2025-12-29 21:32:39 +01:00 by adam · 5 comments
Owner

Originally created by @ravenrs on GitHub (Dec 2, 2024).

Deployment Type

Self-hosted

Triage priority

N/A

NetBox Version

v4.1.3

Python Version

3.12

Steps to Reproduce

2024-12-02_13-08-23

  1. Install 4.1.3
  2. Create site/device_type/device etc.
  3. Create a webhook with the unreachable destination.
  4. Trigger webhook by updating a device.
  5. Netbox-rq crushed

Expected Behavior

Raise an exception and mark the attempt as failed.

Observed Behavior

Netbox-rq crushed

journal with detail:
Dec 02 10:24:18 netbox-test systemd[1]: Started NetBox Request Queue Worker.
Dec 02 10:24:20 netbox-test python3[168155]: Traceback (most recent call last):
Dec 02 10:24:20 netbox-test python3[168155]:   File "/opt/netbox/netbox/manage.py", line 10, in <module>
Dec 02 10:24:20 netbox-test python3[168155]:     execute_from_command_line(sys.argv)
Dec 02 10:24:20 netbox-test python3[168155]:   File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
Dec 02 10:24:20 netbox-test python3[168155]:     utility.execute()
Dec 02 10:24:20 netbox-test python3[168155]:   File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
Dec 02 10:24:20 netbox-test python3[168155]:     self.fetch_command(subcommand).run_from_argv(self.argv)
Dec 02 10:24:20 netbox-test python3[168155]:     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 02 10:24:20 netbox-test python3[168155]:   File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 275, in fetch_command
Dec 02 10:24:20 netbox-test python3[168155]:     klass = load_command_class(app_name, subcommand)
Dec 02 10:24:20 netbox-test python3[168155]:             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 02 10:24:20 netbox-test python3[168155]:   File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 48, in load_command_class
Dec 02 10:24:20 netbox-test python3[168155]:     module = import_module("%s.management.commands.%s" % (app_name, name))
Dec 02 10:24:20 netbox-test python3[168155]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 02 10:24:20 netbox-test python3[168155]:   File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
Dec 02 10:24:20 netbox-test python3[168155]:     return _bootstrap._gcd_import(name[level:], package, level)
Dec 02 10:24:20 netbox-test python3[168155]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 02 10:24:20 netbox-test python3[168155]:   File "<frozen importlib._bootstrap>", line 1381, in _gcd_import
Dec 02 10:24:20 netbox-test python3[168155]:   File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
Dec 02 10:24:20 netbox-test python3[168155]:   File "<frozen importlib._bootstrap>", line 1325, in _find_and_load_unlocked
Dec 02 10:24:20 netbox-test python3[168155]:   File "<frozen importlib._bootstrap>", line 929, in _load_unlocked
Dec 02 10:24:20 netbox-test python3[168155]:   File "<frozen importlib._bootstrap_external>", line 994, in exec_module
Dec 02 10:24:20 netbox-test python3[168155]:   File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
Dec 02 10:24:20 netbox-test python3[168155]:   File "/opt/netbox-4.1.3/netbox/core/management/commands/rqworker.py", line 3, in <module>
Dec 02 10:24:20 netbox-test python3[168155]:     from django_rq.management.commands.rqworker import Command as _Command
Dec 02 10:24:20 netbox-test python3[168155]:   File "/opt/netbox/venv/lib/python3.12/site-packages/django_rq/management/commands/rqworker.py", line 5, in <module>
Dec 02 10:24:20 netbox-test python3[168155]:     from rq import Connection
Dec 02 10:24:20 netbox-test python3[168155]: ImportError: cannot import name 'Connection' from 'rq' (/opt/netbox/venv/lib/python3.12/site-packages/rq/__init__.py). Did you mean: 'connections'?
Dec 02 10:24:20 netbox-test systemd[1]: netbox-rq.service: Main process exited, code=exited, status=1/FAILURE
Dec 02 10:24:20 netbox-test systemd[1]: netbox-rq.service: Failed with result 'exit-code'.

as workaround, I've installed rq==1.10.1

Collecting rq==1.10.1
  Using cached rq-1.10.1-py2.py3-none-any.whl.metadata (1.6 kB)
Requirement already satisfied: redis>=3.5.0 in ./venv/lib/python3.12/site-packages (from rq==1.10.1) (5.2.0)
Requirement already satisfied: click>=5.0.0 in ./venv/lib/python3.12/site-packages (from rq==1.10.1) (8.1.7)
Using cached rq-1.10.1-py2.py3-none-any.whl (70 kB)
Installing collected packages: rq
  Attempting uninstall: rq
    Found existing installation: rq 2.0.0
    Uninstalling rq-2.0.0:
      Successfully uninstalled rq-2.0.0
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
django-rq 2.10.2 requires rq>=1.14, but you have rq 1.10.1 which is incompatible.
Successfully installed rq-1.10.1```

Originally created by @ravenrs on GitHub (Dec 2, 2024). ### Deployment Type Self-hosted ### Triage priority N/A ### NetBox Version v4.1.3 ### Python Version 3.12 ### Steps to Reproduce ![2024-12-02_13-08-23](https://github.com/user-attachments/assets/7676a4b5-55f1-40ce-ba56-bfc30bd3f911) 1. Install 4.1.3 2. Create site/device_type/device etc. 3. Create a webhook with the unreachable destination. 4. Trigger webhook by updating a device. 5. Netbox-rq crushed ### Expected Behavior Raise an exception and mark the attempt as failed. ### Observed Behavior Netbox-rq crushed ``` journal with detail: Dec 02 10:24:18 netbox-test systemd[1]: Started NetBox Request Queue Worker. Dec 02 10:24:20 netbox-test python3[168155]: Traceback (most recent call last): Dec 02 10:24:20 netbox-test python3[168155]: File "/opt/netbox/netbox/manage.py", line 10, in <module> Dec 02 10:24:20 netbox-test python3[168155]: execute_from_command_line(sys.argv) Dec 02 10:24:20 netbox-test python3[168155]: File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line Dec 02 10:24:20 netbox-test python3[168155]: utility.execute() Dec 02 10:24:20 netbox-test python3[168155]: File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute Dec 02 10:24:20 netbox-test python3[168155]: self.fetch_command(subcommand).run_from_argv(self.argv) Dec 02 10:24:20 netbox-test python3[168155]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Dec 02 10:24:20 netbox-test python3[168155]: File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 275, in fetch_command Dec 02 10:24:20 netbox-test python3[168155]: klass = load_command_class(app_name, subcommand) Dec 02 10:24:20 netbox-test python3[168155]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Dec 02 10:24:20 netbox-test python3[168155]: File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 48, in load_command_class Dec 02 10:24:20 netbox-test python3[168155]: module = import_module("%s.management.commands.%s" % (app_name, name)) Dec 02 10:24:20 netbox-test python3[168155]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Dec 02 10:24:20 netbox-test python3[168155]: File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module Dec 02 10:24:20 netbox-test python3[168155]: return _bootstrap._gcd_import(name[level:], package, level) Dec 02 10:24:20 netbox-test python3[168155]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Dec 02 10:24:20 netbox-test python3[168155]: File "<frozen importlib._bootstrap>", line 1381, in _gcd_import Dec 02 10:24:20 netbox-test python3[168155]: File "<frozen importlib._bootstrap>", line 1354, in _find_and_load Dec 02 10:24:20 netbox-test python3[168155]: File "<frozen importlib._bootstrap>", line 1325, in _find_and_load_unlocked Dec 02 10:24:20 netbox-test python3[168155]: File "<frozen importlib._bootstrap>", line 929, in _load_unlocked Dec 02 10:24:20 netbox-test python3[168155]: File "<frozen importlib._bootstrap_external>", line 994, in exec_module Dec 02 10:24:20 netbox-test python3[168155]: File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed Dec 02 10:24:20 netbox-test python3[168155]: File "/opt/netbox-4.1.3/netbox/core/management/commands/rqworker.py", line 3, in <module> Dec 02 10:24:20 netbox-test python3[168155]: from django_rq.management.commands.rqworker import Command as _Command Dec 02 10:24:20 netbox-test python3[168155]: File "/opt/netbox/venv/lib/python3.12/site-packages/django_rq/management/commands/rqworker.py", line 5, in <module> Dec 02 10:24:20 netbox-test python3[168155]: from rq import Connection Dec 02 10:24:20 netbox-test python3[168155]: ImportError: cannot import name 'Connection' from 'rq' (/opt/netbox/venv/lib/python3.12/site-packages/rq/__init__.py). Did you mean: 'connections'? Dec 02 10:24:20 netbox-test systemd[1]: netbox-rq.service: Main process exited, code=exited, status=1/FAILURE Dec 02 10:24:20 netbox-test systemd[1]: netbox-rq.service: Failed with result 'exit-code'. ``` as workaround, I've installed rq==1.10.1 ``` pip3 install rq==1.10.1 Collecting rq==1.10.1 Using cached rq-1.10.1-py2.py3-none-any.whl.metadata (1.6 kB) Requirement already satisfied: redis>=3.5.0 in ./venv/lib/python3.12/site-packages (from rq==1.10.1) (5.2.0) Requirement already satisfied: click>=5.0.0 in ./venv/lib/python3.12/site-packages (from rq==1.10.1) (8.1.7) Using cached rq-1.10.1-py2.py3-none-any.whl (70 kB) Installing collected packages: rq Attempting uninstall: rq Found existing installation: rq 2.0.0 Uninstalling rq-2.0.0: Successfully uninstalled rq-2.0.0 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. django-rq 2.10.2 requires rq>=1.14, but you have rq 1.10.1 which is incompatible. Successfully installed rq-1.10.1```
adam closed this issue 2025-12-29 21:32:39 +01:00
Author
Owner

@bctiemann commented on GitHub (Dec 2, 2024):

@ravenrs what is your installed version of django-rq?

@bctiemann commented on GitHub (Dec 2, 2024): @ravenrs what is your installed version of `django-rq`?
Author
Owner

@ravenrs commented on GitHub (Dec 2, 2024):

I've used standard requirements.txt, here is pip list after I've installed rq-1.10.1 as temporary fix:

pip3 freeze
asgiref==3.8.1
attrs==24.2.0
babel==2.16.0
certifi==2024.8.30
cffi==1.17.1
charset-normalizer==3.4.0
click==8.1.7
colorama==0.4.6
cryptography==43.0.3
defusedxml==0.8.0rc2
Django==5.0.9
django-auth-ldap==5.1.0
django-cors-headers==4.4.0
django-debug-toolbar==4.4.6
django-filter==24.3
django-graphiql-debug-toolbar==0.2.0
django-htmx==1.19.0
django-js-asset==2.2.0
django-mptt==0.16.0
django-pglocks==1.0.4
django-prometheus==2.3.1
django-redis==5.4.0
django-rich==1.11.0
django-rq==2.10.2
django-tables2==2.7.0
django-taggit==6.1.0
django-timezone-field==7.0
djangorestframework==3.15.2
drf-spectacular==0.27.2
drf-spectacular-sidecar==2024.7.1
feedparser==6.0.11
ghp-import==2.1.0
graphene==3.4.3
graphene-django==3.2.2
graphql-core==3.2.5
graphql-relay==3.2.0
gunicorn==23.0.0
idna==3.10
inflection==0.5.1
Jinja2==3.1.4
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
Markdown==3.7
markdown-it-py==3.0.0
MarkupSafe==3.0.2
mdurl==0.1.2
mergedeep==1.3.4
mkdocs==1.6.1
mkdocs-autorefs==1.2.0
mkdocs-get-deps==0.2.0
mkdocs-material==9.5.39
mkdocs-material-extensions==1.3.1
mkdocstrings==0.26.1
mkdocstrings-python-legacy==0.2.4
netaddr==1.3.0
nh3==0.2.18
oauthlib==3.2.2
packaging==24.2
paginate==0.5.7
pathspec==0.12.1
pillow==10.4.0
platformdirs==4.3.6
prometheus_client==0.21.0
promise==2.3
psycopg==3.2.3
psycopg-c==3.2.3
psycopg-pool==3.2.3
pyasn1==0.6.1
pyasn1_modules==0.4.1
pycparser==2.22
Pygments==2.18.0
PyJWT==2.9.0
pymdown-extensions==10.12
python-dateutil==2.9.0.post0
python-ldap==3.4.4
python3-openid==3.2.0
pytkdocs==0.16.2
PyYAML==6.0.2
pyyaml_env_tag==0.1
redis==5.2.0
referencing==0.35.1
regex==2024.11.6
requests==2.32.3
requests-oauthlib==2.0.0
rich==13.9.4
rpds-py==0.21.0
rq==1.10.1
sgmllib3k==1.0.0
six==1.16.0
social-auth-app-django==5.4.2
social-auth-core==4.5.4
sqlparse==0.5.1
strawberry-graphql==0.243.1
strawberry-graphql-django==0.48.0
svgwrite==1.4.3
tablib==3.6.1
text-unidecode==1.3
typing_extensions==4.12.2
tzdata==2024.2
uritemplate==4.1.1
urllib3==2.2.3
watchdog==6.0.0
wheel==0.45.0```
@ravenrs commented on GitHub (Dec 2, 2024): I've used standard requirements.txt, here is pip list after I've installed rq-1.10.1 as temporary fix: ``` pip3 freeze asgiref==3.8.1 attrs==24.2.0 babel==2.16.0 certifi==2024.8.30 cffi==1.17.1 charset-normalizer==3.4.0 click==8.1.7 colorama==0.4.6 cryptography==43.0.3 defusedxml==0.8.0rc2 Django==5.0.9 django-auth-ldap==5.1.0 django-cors-headers==4.4.0 django-debug-toolbar==4.4.6 django-filter==24.3 django-graphiql-debug-toolbar==0.2.0 django-htmx==1.19.0 django-js-asset==2.2.0 django-mptt==0.16.0 django-pglocks==1.0.4 django-prometheus==2.3.1 django-redis==5.4.0 django-rich==1.11.0 django-rq==2.10.2 django-tables2==2.7.0 django-taggit==6.1.0 django-timezone-field==7.0 djangorestframework==3.15.2 drf-spectacular==0.27.2 drf-spectacular-sidecar==2024.7.1 feedparser==6.0.11 ghp-import==2.1.0 graphene==3.4.3 graphene-django==3.2.2 graphql-core==3.2.5 graphql-relay==3.2.0 gunicorn==23.0.0 idna==3.10 inflection==0.5.1 Jinja2==3.1.4 jsonschema==4.23.0 jsonschema-specifications==2024.10.1 Markdown==3.7 markdown-it-py==3.0.0 MarkupSafe==3.0.2 mdurl==0.1.2 mergedeep==1.3.4 mkdocs==1.6.1 mkdocs-autorefs==1.2.0 mkdocs-get-deps==0.2.0 mkdocs-material==9.5.39 mkdocs-material-extensions==1.3.1 mkdocstrings==0.26.1 mkdocstrings-python-legacy==0.2.4 netaddr==1.3.0 nh3==0.2.18 oauthlib==3.2.2 packaging==24.2 paginate==0.5.7 pathspec==0.12.1 pillow==10.4.0 platformdirs==4.3.6 prometheus_client==0.21.0 promise==2.3 psycopg==3.2.3 psycopg-c==3.2.3 psycopg-pool==3.2.3 pyasn1==0.6.1 pyasn1_modules==0.4.1 pycparser==2.22 Pygments==2.18.0 PyJWT==2.9.0 pymdown-extensions==10.12 python-dateutil==2.9.0.post0 python-ldap==3.4.4 python3-openid==3.2.0 pytkdocs==0.16.2 PyYAML==6.0.2 pyyaml_env_tag==0.1 redis==5.2.0 referencing==0.35.1 regex==2024.11.6 requests==2.32.3 requests-oauthlib==2.0.0 rich==13.9.4 rpds-py==0.21.0 rq==1.10.1 sgmllib3k==1.0.0 six==1.16.0 social-auth-app-django==5.4.2 social-auth-core==4.5.4 sqlparse==0.5.1 strawberry-graphql==0.243.1 strawberry-graphql-django==0.48.0 svgwrite==1.4.3 tablib==3.6.1 text-unidecode==1.3 typing_extensions==4.12.2 tzdata==2024.2 uritemplate==4.1.1 urllib3==2.2.3 watchdog==6.0.0 wheel==0.45.0```
Author
Owner

@bctiemann commented on GitHub (Dec 2, 2024):

Can you upgrade to NetBox v4.1.7? There have been upgrades to both django-rq and rq since v4.1.3.

If you can't upgrade, please try removing and rebuilding your virtualenv. Because rq wasn't pinned until after v4.1.3, I suspect you may have had rq==2.0 installed from earlier, and its version may not have been constrained by django-rq. Installing from scratch should give you compatible versions of django-rq and rq.

@bctiemann commented on GitHub (Dec 2, 2024): Can you upgrade to NetBox v4.1.7? There have been upgrades to both `django-rq` and `rq` since v4.1.3. If you can't upgrade, please try removing and rebuilding your virtualenv. Because `rq` wasn't pinned until after v4.1.3, I suspect you may have had rq==2.0 installed from earlier, and its version may not have been constrained by django-rq. Installing from scratch should give you compatible versions of django-rq and rq.
Author
Owner

@ravenrs commented on GitHub (Dec 2, 2024):

Ok, got it, I will try tomorrow and let you know.

@ravenrs commented on GitHub (Dec 2, 2024): Ok, got it, I will try tomorrow and let you know.
Author
Owner

@ravenrs commented on GitHub (Dec 3, 2024):

@bctiemann you were right, I've upgraded to 4.1.7 and haven't encountered any problems, webhook with an unreachable destination doesn't crash netbox-rq service.

@ravenrs commented on GitHub (Dec 3, 2024): @bctiemann you were right, I've upgraded to 4.1.7 and haven't encountered any problems, webhook with an unreachable destination doesn't crash netbox-rq service.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10528