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

ValueError: Invalid attribute name/AttributeError: module has no attribute #644

Open
krlx opened this issue Feb 4, 2024 · 0 comments
Open

Comments

@krlx
Copy link

krlx commented Feb 4, 2024

AttributeError: module 'scheduler.triggers' has no attribute ''

During handling of the above exception, another exception occurred:
Traceback (most recent call last):  
File "/venv/lib/python3.11/site-packages/rq/worker.py", line 1449, in perform_job    job.execute_failure_callback(self.death_penalty_class, *exc_info)  
File "/venv/lib/python3.11/site-packages/rq/job.py", line 1423, in execute_failure_callback    if not self.failure_callback:            
File "/venv/lib/python3.11/site-packages/rq/job.py", line 448, in failure_callback    self._failure_callback = import_attribute(self._failure_callback_name)                           
File "/venv/lib/python3.11/site-packages/rq/utils.py", line 120, in import_attribute    
raise ValueError('Invalid attribute name: %s' % attribute_name)
ValueError: Invalid attribute name: report_failure'

I'm using the command python manage.py rqscheduler . The command is executed from a location that can import report_failure from scheduler.triggers.
The function report_failure is defined in the same file scheduler.triggers that also calls enqueue_at.

The same happens to me no matter if I pass the function itself (report_failure), or its whole path as a string ("scheduler.triggers.report_failure").

Versions:

django_rq-2.10.1
rq-1.15.1
rq_scheduler-0.13.1

Notes:
This seems to happen randomly. Sometimes it works, some minutes later for the next scheduled job, I'm seeing this error.
The same issue happens randomly when I use django_rq without rq_scheduler, starting it with:
python manage.py rqworker --with-scheduler

Same issue opened in rq: rq/rq#2035

@krlx krlx changed the title ValueError: Invalid attribute name for job callback ValueError: Invalid attribute name/AttributeError: module has no attribute Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant