rq / rq

Simple job queues for Python
https://python-rq.org
Other
9.84k stars 1.41k forks source link

Unhandled Exception kills worker #1871

Open gabriels1234 opened 1 year ago

gabriels1234 commented 1 year ago

Error: TypeError: InvalidChunkLength.__init__() missing 1 required positional argument: 'length' The worker stops. What could be the issue?

  File "/usr/local/lib/python3.11/site-packages/rq/job.py", line 875, in restore
    self.meta = self.serializer.loads(obj.get('meta')) if obj.get('meta') else {}
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: InvalidChunkLength.__init__() missing 1 required positional argument: 'length'
08:37:39 Scheduler stopping, releasing locks for default...
# custom exception handler sets the meta attibute :
        job_meta = {}
        job_meta['job_callable'] = job.func.__name__
        job_meta['job_args'] = list(job.args)
        job_meta['job_kwargs'] = job.kwargs
        job_meta['exception_type'] = exc_type.__name__
        job_meta['exception_value'] = str(exc_value)
        traceback_list = traceback.format_tb(exc_traceback)
        traceback_str = ''.join(traceback_list)
        job_meta['traceback'] = traceback_str
        # setting everything inside a 'json' key is an attempt to fix the problem (no success)...
        job.meta['json'] = json.dumps(job_meta)
        job.save_meta()
selwin commented 1 year ago

This issue will be fixed by https://github.com/rq/rq/pull/1872