Skip to content

TypeError exception when starting the RQ worker process #4910

Closed
@jeremystretch

Description

@jeremystretch

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions