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

Catalog 500 Error on /member/authenticate #4443

Open
nickumia-reisys opened this issue Sep 1, 2023 · 4 comments
Open

Catalog 500 Error on /member/authenticate #4443

nickumia-reisys opened this issue Sep 1, 2023 · 4 comments
Labels
bug Software defect or bug O&M Operations and maintenance tasks for the Data.gov platform

Comments

@nickumia-reisys
Copy link
Contributor

nickumia-reisys commented Sep 1, 2023

catalog.data.gov @ main
ckanext-datagovtheme @ v0.2.3

How to reproduce

  1. curl -X POST https://catalog-dev.data.gov/member/authenticate

NOTE: Found on log-review

Expected behavior

404?

Actual behavior

image

   2023-09-01T16:30:50.82-0400 [APP/PROC/WEB/0] OUT 2023-09-01 20:30:50,823 ERROR [ckan.config.middleware.flask_app] 'NoneType' object has no attribute '__module__'
   2023-09-01T16:30:50.82-0400 [APP/PROC/WEB/0] OUT Traceback (most recent call last):
   2023-09-01T16:30:50.82-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/flask/app.py", line 1514, in full_dispatch_request
   2023-09-01T16:30:50.82-0400 [APP/PROC/WEB/0] OUT rv = self.preprocess_request()
   2023-09-01T16:30:50.82-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/flask/app.py", line 1857, in preprocess_request
   2023-09-01T16:30:50.82-0400 [APP/PROC/WEB/0] OUT rv = self.ensure_sync(before_func)()
   2023-09-01T16:30:50.82-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/config/middleware/flask_app.py", line 419, in ckan_before_request
   2023-09-01T16:30:50.82-0400 [APP/PROC/WEB/0] OUT dest = f"{view.__module__}.{view.__name__}"     # type: ignore
   2023-09-01T16:30:50.82-0400 [APP/PROC/WEB/0] OUT AttributeError: 'NoneType' object has no attribute '__module__'
   2023-09-01T16:30:50.82-0400 [APP/PROC/WEB/0] ERR 2023-09-01 20:30:50,823 ERROR [ckan.config.middleware.flask_app] 'NoneType' object has no attribute '__module__'
   2023-09-01T16:30:50.82-0400 [APP/PROC/WEB/0] ERR Traceback (most recent call last):
   2023-09-01T16:30:50.82-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/flask/app.py", line 1514, in full_dispatch_request
   2023-09-01T16:30:50.82-0400 [APP/PROC/WEB/0] ERR rv = self.preprocess_request()
   2023-09-01T16:30:50.82-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/flask/app.py", line 1857, in preprocess_request
   2023-09-01T16:30:50.82-0400 [APP/PROC/WEB/0] ERR rv = self.ensure_sync(before_func)()
   2023-09-01T16:30:50.82-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/config/middleware/flask_app.py", line 419, in ckan_before_request
   2023-09-01T16:30:50.82-0400 [APP/PROC/WEB/0] ERR dest = f"{view.__module__}.{view.__name__}"     # type: ignore
   2023-09-01T16:30:50.82-0400 [APP/PROC/WEB/0] ERR AttributeError: 'NoneType' object has no attribute '__module__'
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT 2023-09-01 20:30:50,829 ERROR [ckan.config.middleware.flask_app] Exception on /member/authenticate [POST]
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT Traceback (most recent call last):
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/flask/app.py", line 1514, in full_dispatch_request
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT rv = self.preprocess_request()
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/flask/app.py", line 1857, in preprocess_request
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT rv = self.ensure_sync(before_func)()
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/config/middleware/flask_app.py", line 419, in ckan_before_request
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT dest = f"{view.__module__}.{view.__name__}"     # type: ignore
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT AttributeError: 'NoneType' object has no attribute '__module__'
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT During handling of the above exception, another exception occurred:
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT Traceback (most recent call last):
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT response = self.full_dispatch_request()
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT rv = self.handle_user_exception(e)
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/flask/app.py", line 1393, in handle_user_exception
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR 2023-09-01 20:30:50,829 ERROR [ckan.config.middleware.flask_app] Exception on /member/authenticate [POST]
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT return self.ensure_sync(handler)(e)
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR Traceback (most recent call last):
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/config/middleware/flask_app.py", line 629, in error_handler
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT return base.render(u'error_document_template.html', extra_vars), 500
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/lib/base.py", line 107, in render
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/flask/app.py", line 1514, in full_dispatch_request
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT return flask_render_template(template_name, **extra_vars)
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR rv = self.preprocess_request()
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/flask/app.py", line 1857, in preprocess_request
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/flask/templating.py", line 147, in render_template
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR rv = self.ensure_sync(before_func)()
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT return _render(
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/config/middleware/flask_app.py", line 419, in ckan_before_request
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/flask/templating.py", line 128, in _render
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR dest = f"{view.__module__}.{view.__name__}"     # type: ignore
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR AttributeError: 'NoneType' object has no attribute '__module__'
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT rv = template.render(context)
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/jinja2/environment.py", line 1301, in render
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR During handling of the above exception, another exception occurred:
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT self.environment.handle_exception()
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR Traceback (most recent call last):
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/jinja2/environment.py", line 936, in handle_exception
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT raise rewrite_traceback_stack(source=source)
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR response = self.full_dispatch_request()
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/templates/error_document_template.html", line 1, in top-level template code
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR rv = self.handle_user_exception(e)
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT {% extends "page.html" %}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/flask/app.py", line 1393, in handle_user_exception
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckanext/datagovtheme/templates/page.html", line 1, in top-level template code
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT {% ckan_extends %} {% block maintag %}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/templates/page.html", line 1, in top-level template code
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR return self.ensure_sync(handler)(e)
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT {% extends "base.html" %}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckanext/datagovtheme/templates/base.html", line 1, in top-level template code
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/config/middleware/flask_app.py", line 629, in error_handler
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT {% ckan_extends %}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/src/ckanext-harvest/ckanext/harvest/templates/base.html", line 1, in top-level template code
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR return base.render(u'error_document_template.html', extra_vars), 500
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT {% ckan_extends %}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/lib/base.py", line 107, in render
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/templates/base.html", line 108, in top-level template code
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT {%- block page %}{% endblock -%}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/templates/page.html", line 14, in block 'page'
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR return flask_render_template(template_name, **extra_vars)
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT {%- block header %}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/flask/templating.py", line 147, in render_template
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/templates/page.html", line 15, in block 'header'
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR return _render(
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT {% include "header.html" %}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/flask/templating.py", line 128, in _render
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR rv = template.render(context)
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckanext/datagovtheme/templates/header.html", line 1, in top-level template code
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/jinja2/environment.py", line 1301, in render
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT {% block header %}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR self.environment.handle_exception()
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/jinja2/environment.py", line 936, in handle_exception
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckanext/datagovtheme/templates/header.html", line 84, in block 'header'
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR raise rewrite_traceback_stack(source=source)
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT {% if request.endpoint.startswith('report.') %}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/templates/error_document_template.html", line 1, in top-level template code
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR {% extends "page.html" %}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT File "/home/vcap/deps/1/python/lib/python3.9/site-packages/jinja2/utils.py", line 83, in from_obj
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckanext/datagovtheme/templates/page.html", line 1, in top-level template code
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT if hasattr(obj, "jinja_pass_arg"):
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR {% ckan_extends %} {% block maintag %}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/templates/page.html", line 1, in top-level template code
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT jinja2.exceptions.UndefinedError: 'None' has no attribute 'startswith'
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR {% extends "base.html" %}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckanext/datagovtheme/templates/base.html", line 1, in top-level template code
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR {% ckan_extends %}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] OUT 2023-09-01 20:30:50,830 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.
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/src/ckanext-harvest/ckanext/harvest/templates/base.html", line 1, in top-level template code
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR {% ckan_extends %}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/templates/base.html", line 108, in top-level template code
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR {%- block page %}{% endblock -%}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/templates/page.html", line 14, in block 'page'
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR {%- block header %}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/templates/page.html", line 15, in block 'header'
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR {% include "header.html" %}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckanext/datagovtheme/templates/header.html", line 1, in top-level template code
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR {% block header %}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckanext/datagovtheme/templates/header.html", line 84, in block 'header'
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR {% if request.endpoint.startswith('report.') %}
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/jinja2/utils.py", line 83, in from_obj
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR if hasattr(obj, "jinja_pass_arg"):
   2023-09-01T16:30:50.83-0400 [APP/PROC/WEB/0] ERR jinja2.exceptions.UndefinedError: 'None' has no attribute 'startswith'

Sketch

Not sure...

@nickumia-reisys nickumia-reisys added the bug Software defect or bug label Sep 1, 2023
@FuhuXia
Copy link
Member

FuhuXia commented Sep 1, 2023

It is a probing traffic. We dont have /member/authenticate endpoint. As a matter of fact, you see the same error if you send a POST request to any catalog url.

@robert-bryson
Copy link
Contributor

Hmm, this seems like the sort of thing we should have in the nginx proxy: that only requests to valid routes/http methods are proxied.

@nickumia-reisys nickumia-reisys mentioned this issue Sep 1, 2023
10 tasks
@hkdctol
Copy link
Contributor

hkdctol commented Sep 7, 2023

Fix would help O&M

@hkdctol hkdctol moved this to 🧊 Icebox in data.gov team board Sep 7, 2023
@hkdctol hkdctol added the O&M Operations and maintenance tasks for the Data.gov platform label Sep 7, 2023
@avdata99
Copy link
Contributor

I just get the same error and discover that CKAN core already fixed it

ckan/ckan#7616

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Software defect or bug O&M Operations and maintenance tasks for the Data.gov platform
Projects
Status: 🧊 Icebox
Development

No branches or pull requests

5 participants