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

Import Error from rq when trying to spin up a worker #582

Open
vfxcode opened this issue Feb 18, 2025 · 2 comments
Open

Import Error from rq when trying to spin up a worker #582

vfxcode opened this issue Feb 18, 2025 · 2 comments

Comments

@vfxcode
Copy link

vfxcode commented Feb 18, 2025

It seems there is an issue when we try to spin up a worker. The following error occurs:

root@cb1fe159a166:/code# FLASK_APP=`pwd`/cre.py python cre.py --start_worker
Traceback (most recent call last):
  File "/code/cre.py", line 244, in <module>
    main()
  File "/code/cre.py", line 240, in main
    cre_main.run(args)
  File "/code/application/cmd/cre_main.py", line 631, in run
    from application.worker import start_worker
  File "/code/application/worker.py", line 3, in <module>
    from rq import Worker, Queue, Connection
ImportError: cannot import name 'Connection' from 'rq' (/usr/local/lib/python3.11/site-packages/rq/__init__.py)

We have validated that OpenCRE has a fully functioning Redis and OpenCRE is correctly configured to connect to it. We can after all see the jobs get queued in the respective redis keys.

@Hardik301002
Copy link

hi @vfxcode
Issue:
Getting ImportError: cannot import name 'Connection' from 'rq' when trying to spin up the worker.

Steps Taken to Fix:

  1. Checked the installed rq version.
  2. Removed the deprecated Connection import.
  3. Used Redis for connection instead.
  4. Initialized the worker with the correct Redis connection.
  5. Tested and confirmed the worker is running successfully.

Next Steps:

Should we update the dependencies or document this change to prevent future issues? Let me know your thoughts!

@northdpole
Copy link
Collaborator

northdpole commented Mar 13, 2025 via email

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

3 participants