epoch8 / airflow-exporter

Airflow plugin to export dag and task based metrics to Prometheus.
Other
248 stars 75 forks source link

No module named prometheus_exporter.db.store #6

Closed nidhi-chourasia closed 6 years ago

nidhi-chourasia commented 6 years ago

I was setting-up the exporter as per README.Got the following error while executing airflow scheduler

osboxes@osboxes:~$ airflow webserver -p 8080 [2018-08-28 07:11:24,962] {init.py:57} INFO - Using executor SequentialExecutor [2018-08-28 07:11:25,259] {driver.py:123} INFO - Generating grammar tables from /usr/lib/python2.7/lib2to3/Grammar.txt [2018-08-28 07:11:25,301] {driver.py:123} INFO - Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt [2018-08-28 07:11:25,690] {plugins_manager.py:90} ERROR - No module named prometheus_exporter.db.store Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/airflow/plugins_manager.py", line 79, in m = imp.load_source(namespace, filepath) File "/home/osboxes/airflow/plugins/prometheus-exporter/prometheus_exporter.py", line 8, in from prometheus_exporter.db.store import get_context ImportError: No module named prometheus_exporter.db.store [2018-08-28 07:11:25,692] {plugins_manager.py:91} ERROR - Failed to import plugin /home/osboxes/airflow/plugins/prometheus-exporter/prometheus_exporter.py [2018-08-28 07:11:25,728] {plugins_manager.py:90} ERROR - invalid syntax (store.py, line 32) Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/airflow/plugins_manager.py", line 79, in m = imp.load_source(namespace, filepath) File "/home/osboxes/airflow/plugins/prometheus-exporter/db/store.py", line 32 return function(*args, **kwargs, connection=session) ^ SyntaxError: invalid syntax [2018-08-28 07:11:25,728] {plugins_manager.py:91} ERROR - Failed to import plugin /home/osboxes/airflow/plugins/prometheus-exporter/db/store.py


But on checking the contents of airflow-exporter folder found:

osboxes@osboxes:~/airflow/plugins/prometheus-exporter$ ls db LICENSE prometheus_exporter.py prometheus_exporter.pyc README.md osboxes@osboxes:~/airflow/plugins/prometheus-exporter$ cd db/ osboxes@osboxes:~/airflow/plugins/prometheus-exporter/db$ ls init.py init.pyc store.py

Not sure if it an error from my side or not.I am a newbie to airflow.Any pointers to debug or seek help from another forum would be very helpful

elephantum commented 6 years ago

@nidhi-chourasia I see the problem, you're using Python 2.7. It doesn't like syntax f(*args, **kwargs, something=smth)

We'll fix it.

elephantum commented 6 years ago

@nidhi-chourasia can you please pull the latest master from the repo? I believe the issue should be fixed.

nidhi-chourasia commented 6 years ago

Thankyou for the fix,I see that the error: File "/home/osboxes/airflow/plugins/prometheus-exporter/db/store.py", line 32 return function(*args, **kwargs, connection=session) ^ SyntaxError: invalid syntax.

is fixed but there is another one that is still coming up.

File "/usr/local/lib/python2.7/dist-packages/airflow/plugins_manager.py", line 79, in m = imp.load_source(namespace, filepath) File "/home/osboxes/airflow/plugins/prometheus-exporter/prometheus_exporter.py", line 8, in from prometheus_exporter.db.store import get_context ImportError: No module named prometheus_exporter.db.store.

Tried with adding missing init.py file in prometheus_exporter folder but still getting the same error. @elephantum

elephantum commented 6 years ago

@nidhi-chourasia I'm sorry about that. We should've done proper testing with Python 2.7.

@cleverCat сделай, пожалуйста, тестовый docker-compose для python2.7 и давай пофиксим проблемы, которые возникают на 2.7