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

Exporter fails with Sqlite DB used in development environment #36

Closed
ryan-carlson opened this issue Nov 26, 2018 · 5 comments
Closed

Exporter fails with Sqlite DB used in development environment #36

ryan-carlson opened this issue Nov 26, 2018 · 5 comments
Labels
bug Something isn't working

Comments

@ryan-carlson
Copy link
Contributor

When using the Sqlite DB, the following error occurs when attempting to open the metrics page.

Traceback (most recent call last):
File "/Users/ryan.carlson/.virtualenvs/spothero-dataflows/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/Users/ryan.carlson/.virtualenvs/spothero-dataflows/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/ryan.carlson/.virtualenvs/spothero-dataflows/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Users/ryan.carlson/.virtualenvs/spothero-dataflows/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/Users/ryan.carlson/.virtualenvs/spothero-dataflows/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/ryan.carlson/.virtualenvs/spothero-dataflows/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functionsrule.endpoint
File "/Users/ryan.carlson/.virtualenvs/spothero-dataflows/lib/python3.6/site-packages/flask_admin/base.py", line 69, in inner
return self._run_view(f, *args, **kwargs)
File "/Users/ryan.carlson/.virtualenvs/spothero-dataflows/lib/python3.6/site-packages/flask_admin/base.py", line 368, in _run_view
return fn(self, *args, **kwargs)
File "/Users/ryan.carlson/airflow/plugins/prometheus_exporter/prometheus_exporter.py", line 164, in index
return Response(generate_latest(), mimetype='text/plain')
File "/Users/ryan.carlson/.virtualenvs/spothero-dataflows/lib/python3.6/site-packages/prometheus_client/exposition.py", line 88, in generate_latest
for metric in registry.collect():
File "/Users/ryan.carlson/.virtualenvs/spothero-dataflows/lib/python3.6/site-packages/prometheus_client/core.py", line 147, in collect
for metric in collector.collect():
File "/Users/ryan.carlson/airflow/plugins/prometheus_exporter/prometheus_exporter.py", line 150, in collect
for dag in get_dag_duration_info():
File "/Users/ryan.carlson/airflow/plugins/prometheus_exporter/prometheus_exporter.py", line 108, in get_dag_duration_info
DagRun.state == State.RUNNING
File "/Users/ryan.carlson/.virtualenvs/spothero-dataflows/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2703, in all
return list(self)
File "/Users/ryan.carlson/.virtualenvs/spothero-dataflows/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 90, in instances
util.raise_from_cause(err)
File "/Users/ryan.carlson/.virtualenvs/spothero-dataflows/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/Users/ryan.carlson/.virtualenvs/spothero-dataflows/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 187, in reraise
raise value
File "/Users/ryan.carlson/.virtualenvs/spothero-dataflows/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 78, in instances
for row in fetch]
File "/Users/ryan.carlson/.virtualenvs/spothero-dataflows/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 78, in
for row in fetch]
File "/Users/ryan.carlson/.virtualenvs/spothero-dataflows/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 77, in
rows = [keyed_tuple([proc(row) for proc in process])
File "/Users/ryan.carlson/.virtualenvs/spothero-dataflows/lib/python3.6/site-packages/sqlalchemy/sql/sqltypes.py", line 1709, in process
value = impl_processor(value)
ValueError: Couldn't parse datetime string '0' - value is not a string.

@ryan-carlson
Copy link
Contributor Author

I have code fix that I can share which enable support Sqlite. Is it possible for me to submit this as a PR?

@elephantum
Copy link
Contributor

@ryan-carlson of course! We are glad to receive contributions.

@elephantum elephantum added the bug Something isn't working label Nov 27, 2018
@ryan-carlson
Copy link
Contributor Author

Sounds great, please see #37

elephantum added a commit that referenced this issue Nov 28, 2018
Add support for Sqlite driver (Issue #36)
@elephantum
Copy link
Contributor

I believe this can be closed, as #37 is merged

@ryan-carlson
Copy link
Contributor Author

Confirmed, I have tested with the latest master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants