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

CKAN 2.11 - Error on log #8447

Closed
riccardoricciagid opened this issue Sep 19, 2024 · 3 comments · Fixed by #8479
Closed

CKAN 2.11 - Error on log #8447

riccardoricciagid opened this issue Sep 19, 2024 · 3 comments · Fixed by #8479
Assignees

Comments

@riccardoricciagid
Copy link

CKAN 2.11

Describe the bug

Every page visited, with "tracking" plugin active, generate this error on log:
2024-09-19 19:46:54,087 ERROR [ckan.config.middleware.flask_app] Exception on /_tracking [POST]
Traceback (most recent call last):
File "/usr/lib/ckan/default/lib/python3.10/site-packages/flask/app.py", line 1473, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/ckan/default/lib/python3.10/site-packages/flask/app.py", line 883, in full_dispatch_request
return self.finalize_request(rv)
File "/usr/lib/ckan/default/lib/python3.10/site-packages/flask/app.py", line 904, in finalize_request
response = self.process_response(response)
File "/usr/lib/ckan/default/lib/python3.10/site-packages/flask/app.py", line 1281, in process_response
response = self.ensure_sync(func)(response)
File "/usr/lib/ckan/default/src/ckan/ckanext/tracking/middleware.py", line 42, in track_request
with cast(sa.engine.Engine, engine).begin() as conn:
AttributeError: 'NoneType' object has no attribute 'begin'
2024-09-19 19:46:54,088 INFO [ckan.config.middleware.flask_app] 500 Internal Server Error: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
2024-09-19 19:46:54,630 ERROR [ckan.config.middleware.flask_app] Request finalizing failed with an error while handling an error
Traceback (most recent call last):
File "/usr/lib/ckan/default/lib/python3.10/site-packages/flask/app.py", line 1473, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/ckan/default/lib/python3.10/site-packages/flask/app.py", line 883, in full_dispatch_request
return self.finalize_request(rv)
File "/usr/lib/ckan/default/lib/python3.10/site-packages/flask/app.py", line 904, in finalize_request
response = self.process_response(response)
File "/usr/lib/ckan/default/lib/python3.10/site-packages/flask/app.py", line 1281, in process_response
response = self.ensure_sync(func)(response)
File "/usr/lib/ckan/default/src/ckan/ckanext/tracking/middleware.py", line 42, in track_request
with cast(sa.engine.Engine, engine).begin() as conn:
AttributeError: 'NoneType' object has no attribute 'begin'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/ckan/default/lib/python3.10/site-packages/flask/app.py", line 904, in finalize_request
response = self.process_response(response)
File "/usr/lib/ckan/default/lib/python3.10/site-packages/flask/app.py", line 1281, in process_response
response = self.ensure_sync(func)(response)
File "/usr/lib/ckan/default/src/ckan/ckanext/tracking/middleware.py", line 22, in track_request
k, v = part.split('=')
ValueError: not enough values to unpack (expected 2, got 1)

Steps to reproduce

Activate "tracking" plugin and visit some pages on the ckan site.

@Nisha1293
Copy link

I have checked this issue in CKAN version 2.11. This issue is reproduced.
The below error is occurred because engine object is not initialized and it is None.

File "/usr/lib/ckan/default/src/ckan/ckanext/tracking/middleware.py", line 42, in track_request
with cast(sa.engine.Engine, engine).begin() as conn:
AttributeError: 'NoneType' object has no attribute 'begin'

#8448 PR will fix this error in logs.

@ziorick
Copy link

ziorick commented Oct 2, 2024

This error cause the server process .crash (and restart). If it occour during loading resources or harvesting all fail.

@tino097
Copy link
Member

tino097 commented Oct 2, 2024

Related with #8431

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

Successfully merging a pull request may close this issue.

4 participants