mdawar / rq-exporter

Prometheus metrics exporter for Python RQ (Redis Queue).
MIT License
65 stars 28 forks source link

Cannot run with gunicorn, missing import #8

Closed PaulFlanaganGenscape closed 3 years ago

PaulFlanaganGenscape commented 3 years ago
[2021-01-06 12:09:08 +0000] [1] [INFO] Starting gunicorn 20.0.4
[2021-01-06 12:09:08 +0000] [1] [INFO] Listening at: http://0.0.0.0:9726 (1)
[2021-01-06 12:09:08 +0000] [1] [INFO] Using worker: threads
[2021-01-06 12:09:08 +0000] [8] [INFO] Booting worker with pid: 8
[2021-01-06 12:09:08 +0000] [8] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
    worker.init_process()
  File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/gthread.py", line 92, in init_process
    super().init_process()
  File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 119, in init_process
    self.load_wsgi()
  File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/usr/local/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python3.8/site-packages/gunicorn/util.py", line 411, in import_app
    app = app(*args, **kwargs)
  File "/app/rq_exporter/exporter.py", line 57, in create_app
    worker_class = import_attribute(config.RQ_WORKER_CLASS)
NameError: name 'import_attribute' is not defined
[2021-01-06 12:09:08 +0000] [8] [INFO] Worker exiting (pid: 8)
[2021-01-06 12:09:08 +0000] [1] [INFO] Shutting down: Master
[2021-01-06 12:09:08 +0000] [1] [INFO] Reason: Worker failed to boot.
mdawar commented 3 years ago

Hi, thank you for reporting this error, I'll take care of it.

mdawar commented 3 years ago

Fixed in v1.5.1 and v1.6.0.

PaulFlanaganGenscape commented 3 years ago

@mdawar That was quick! Thank you very much