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 some datasets in block 'collection_resources' #4553

Closed
FuhuXia opened this issue Dec 11, 2023 · 7 comments
Closed

catalog 500 error on some datasets in block 'collection_resources' #4553

FuhuXia opened this issue Dec 11, 2023 · 7 comments
Assignees
Labels
bug Software defect or bug O&M Operations and maintenance tasks for the Data.gov platform

Comments

@FuhuXia
Copy link
Member

FuhuXia commented Dec 11, 2023

Some dataset returns 500 error with error message

ERR {{ super() }}
ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/templates/page.html", line 19, in block 'page'
ERR {%- block content %}
ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/templates/page.html", line 22, in block 'content'
ERR {% block main_content %}
ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/templates/page.html", line 74, in block 'main_content'
ERR {% block primary %}
ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/templates/page.html", line 87, in block 'primary'
ERR {% block primary_content %}
ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckanext/datagovtheme/templates/package/read_base.html", line 59, in block 'primary_content'
ERR {% block primary_content_inner %}{% endblock %}
ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/templates/package/read.html", line 34, in block 'primary_content_inner'
ERR {% block package_resources %}
ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckanext/datagovtheme/templates/package/read.html", line 113, in block 'package_resources'
ERR {% block collection_resources %}
ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckanext/datagovtheme/templates/package/read.html", line 114, in block 'collection_resources'
ERR {{ super() }}
ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckanext/geodatagov/templates/package/read.html", line 14, in block 'collection_resources'
ERR {% set collection_package = h.get_collection_package(collection_package_id) %}
ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckanext/geodatagov/helpers.py", line 62, in get_collection_package
ERR package = p.toolkit.get_action('package_show')({}, {'id': collection_package_id})
ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/logic/__init__.py", line 551, in wrapped
ERR result = _action(context, data_dict, **kw)
ERR File "/home/vcap/deps/1/python/lib/python3.9/site-packages/ckan/logic/action/get.py", line 1018, in package_show
ERR raise NotFound
ERR ckan.logic.NotFound
OUT 2023-12-11 19:20:31,334 INFO  [ckan.config.middleware.flask_app]  500 /dataset/tiger-line-shapefile-2013-county-santa-cruz-county-ca-all-roads-county-based-shapefile render time 4.394 seconds

How to reproduce

  1. Description of steps to reproduce the issue.
    Go to this dataset url, or search " 500 " NginxLog in NewRelic on app catalog-proxy for more examples.

Expected behavior

200 or 404 response code

Actual behavior

500 response code

Sketch

[Notes or a checklist reflecting our understanding of the selected approach]

@FuhuXia FuhuXia added the bug Software defect or bug label Dec 11, 2023
@gujral-rei gujral-rei moved this to 📔 Product Backlog in data.gov team board Dec 14, 2023
@gujral-rei gujral-rei added the O&M Operations and maintenance tasks for the Data.gov platform label Dec 14, 2023
@gujral-rei
Copy link

Handle 500 error gracefully

@btylerburton
Copy link
Contributor

Previously there was a 500 graceful error page. That was lost during the cloud.gov migration. Possibly tied to NGINX config.

@gujral-rei gujral-rei moved this from 📔 Product Backlog to 📟 Sprint Backlog [7] in data.gov team board Dec 14, 2023
@gujral-rei gujral-rei moved this from 📟 Sprint Backlog [7] to 📔 Product Backlog in data.gov team board Dec 14, 2023
@chris-macdermaid
Copy link
Contributor

Here's a screenshot of what I'm seeing.

image

@Jin-Sun-tts Jin-Sun-tts self-assigned this Jan 17, 2024
@Jin-Sun-tts Jin-Sun-tts moved this from 📔 Product Backlog to 🏗 In Progress [8] in data.gov team board Jan 17, 2024
@Jin-Sun-tts
Copy link
Contributor

Image

checked those datasets are in a collection, but the parent is deleted.

@Jin-Sun-tts
Copy link
Contributor

Jin-Sun-tts commented Jan 23, 2024

FYI. The UI display for datasets have valid parent collection:
Screenshot 2024-01-23 at 12 45 35 PM

The error returned when the parent collection was not found. To address this, we implemented error handling and have the following options for UI changes for this situation:

  1. Maintain the current display format but include a message indicating that the parent collection does not exist.
    Screenshot 2024-01-23 at 12 47 13 PM

  2. Enhance the display by adding a link to search for sibling datasets within the same collection.
    Screenshot 2024-01-23 at 12 56 51 PM

  3. Completely omit the 'Collection' section from the display in this scenario.

Furthermore, will do additional research to understand how the harvester behaves when harvesting dataset without a parent collection existing.

@Jin-Sun-tts
Copy link
Contributor

Jin-Sun-tts commented Jan 24, 2024

After discussing with the team, we have decided to resolve the 500 error by implementing the following UI changes:

Screenshot 2024-01-24 at 12 29 41 PM

Additionally, created a new ticket (#4594) to implement the necessary logic to prevent the deletion of the parent collection during the harvesting stage.

@Jin-Sun-tts
Copy link
Contributor

After pushed the change to catalog, double checked on catalog production, the error from the missing parent issue is fixed.

Image

@github-project-automation github-project-automation bot moved this from 👀 Needs Review [2] to ✔ Done in data.gov team board Jan 26, 2024
@gujral-rei gujral-rei moved this from ✔ Done to 🗄 Closed in data.gov team board Feb 1, 2024
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
Archived in project
Development

No branches or pull requests

5 participants