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

Bug in OpenTelemetry causes requests with non-UTF8 headers to fail #4080

Open
sentry-io bot opened this issue Oct 2, 2024 · 0 comments
Open

Bug in OpenTelemetry causes requests with non-UTF8 headers to fail #4080

sentry-io bot opened this issue Oct 2, 2024 · 0 comments
Assignees
Labels
dependencies Pull requests that update a dependency file

Comments

@sentry-io
Copy link

sentry-io bot commented Oct 2, 2024

Sentry Issue: SERVER-1VC

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa1 in position 71: invalid start byte
(1 additional frame(s) were not displayed)
...
  File "starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/app/server/.venv/lib/python3.12/site-packages/opentelemetry/instrumentation/asgi/__init__.py", line 579, in __call__
    attributes = collect_request_attributes(scope)
  File "/app/server/.venv/lib/python3.12/site-packages/opentelemetry/instrumentation/asgi/__init__.py", line 323, in collect_request_attributes
    http_user_agent = asgi_getter.get(scope, "user-agent")
  File "/app/server/.venv/lib/python3.12/site-packages/opentelemetry/instrumentation/asgi/__init__.py", line 256, in get
    _value.decode("utf8")

Known bug in OpenTelemetry ASGI. A fix is merged but not yet released: open-telemetry/opentelemetry-python-contrib#2837

Just upgrade the package when it is released to solve the issue.

@sentry-io sentry-io bot added the dependencies Pull requests that update a dependency file label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
Status: No status
Development

No branches or pull requests

1 participant