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

TypeError exception when starting the RQ worker process #4910

Closed
jeremystretch opened this issue Jul 27, 2020 · 0 comments
Closed

TypeError exception when starting the RQ worker process #4910

jeremystretch opened this issue Jul 27, 2020 · 0 comments
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@jeremystretch
Copy link
Member

jeremystretch commented Jul 27, 2020

Environment

  • Python version: v3.6.9
  • NetBox version: v2.8.8

Steps to Reproduce

  1. Install the NetBox v2.8.8 code base and run the upgrade script (upgrade.sh)
  2. Attempt to run the RQ worker process (either the systemctl service or just ./manage.py rqworker)

Expected Behavior

The RQ worker should start normally.

Observed Behavior

An exception is raised:

  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/netbox/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/opt/netbox/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/netbox/venv/lib/python3.6/site-packages/django/core/management/base.py", line 328, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/netbox/venv/lib/python3.6/site-packages/django/core/management/base.py", line 369, in execute
    output = self.handle(*args, **options)
  File "/opt/netbox/netbox/extras/management/commands/rqworker.py", line 16, in handle
    super().handle(*args, **options)
  File "/opt/netbox/venv/lib/python3.6/site-packages/django_rq/management/commands/rqworker.py", line 102, in handle
    w.work(burst=options.get('burst', False), with_scheduler=options.get('with_scheduler', False), logging_level=level)
  File "/opt/netbox/venv/lib/python3.6/site-packages/rq/worker.py", line 511, in work
    self.register_birth()
  File "/opt/netbox/venv/lib/python3.6/site-packages/rq/worker.py", line 296, in register_birth
    p.hset(key, mapping=mapping)
TypeError: hset() got an unexpected keyword argument 'mapping'

This is due to the latest release of the rq Python package (required by django-rq requiring redis>=3.5.0:

django-rq==2.3.2
  - redis [required: >=3, installed: 3.4.1]
  - rq [required: >=1.2, installed: 1.5.0]
    - redis [required: >=3.5.0, installed: 3.4.1]

However, NetBox's requirements.txt currently pins redis to version 3.4.1, which prevents a later version from being installed. We should probably just exclude redis from requirements.txt since it isn't a direct dependency in the first place.

Workaround

Comment out or remove redis==3.4.1 from requirements.txt and re-run the upgrade script. The later release of redis should get installed automatically.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

1 participant