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

PB-409: fix broken health check and collections endpoint #411

Merged

Conversation

hansmannj
Copy link
Member

@hansmannj hansmannj commented Apr 10, 2024

Since this morning, the collections and health check endpoint are returning 500. This is most likely caused by a special character in a newly updated collection description or ID field. The error is, decode cannot decode a byte 0xc3 in position 199: unexpected end of data. To prevent this, we now first decode the whole response.content and strip it afterwards, rather than the other way round.

This is the exact error message:

  "exc_text": "Traceback (most recent call last):\n  File \"/opt/service-stac/.venv/lib/python3.9/site-packages/django/core/handlers/exception.py\", line 56, in inner\n    response = get_response(request)\n  File \"/opt/service-stac/app/middleware/logging.py\", line 57, in __call__\n    extra[\"response\"][\"payload\"] = response.content[:200].decode()\nUnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 199: unexpected end of data"

@rebert @ltflb-bgdi @ltshb : Thanks for your time and support in debuging this issue!

Since this morning, the collections and health check endpoint are returning 500.
This is most likely caused by a special character in a newly updated collection description or ID field.
The error is, decode cannot decode a byte 0xc3 in position 199: unexpected end of data.
To prevent this, we now first decode the whole response.content and strip it afterwards, rather than the other way round.
@github-actions github-actions bot added the bug label Apr 10, 2024
@hansmannj hansmannj merged commit 254bd9c into develop Apr 10, 2024
7 checks passed
@hansmannj hansmannj deleted the fix_PB-409_first_decode_then_strip_to_fix_problems branch April 10, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants