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]: Started seeing failed to extract response cookies ValueError : not enough values to unpack #11818

Open
ukalwa opened this issue Dec 20, 2024 · 1 comment · May be fixed by #11820
Open
Labels

Comments

@ukalwa
Copy link

ukalwa commented Dec 20, 2024

Tracer Version(s)

2.18

Python Version(s)

3.11

Pip Version(s)

24.3.1

Bug Report

Started seeing failed to extract response cookies ValueError : not enough values to unpack when deploying fastapi app with uvicorn and wrapping it with ddtrace-run.

It seems to happen at this line when there is no set-cookie header:

cookies = {}
try:
cookie_key, cookie_value = response_headers.get("set-cookie", "").split("=", maxsplit=1)
cookies[cookie_key] = cookie_value
except Exception:
log.debug("failed to extract response cookies", exc_info=True)

Reproduction Code

No response

Error Logs

No response

Libraries in Use

No response

Operating System

No response

@ukalwa ukalwa added the bug label Dec 20, 2024
@ukalwa ukalwa linked a pull request Dec 20, 2024 that will close this issue
2 tasks
@wantsui
Copy link
Collaborator

wantsui commented Dec 20, 2024

Thanks for the report @ukalwa ! I was also able to reproduce this based on the information you provided.

For now it looks like the failed to extract response cookies message only occurs if the logging module is in DEBUG logging level (which then triggers our tracer to log in debug mode) or ddtrace has debug mode enabled via:DD_TRACE_DEBUG=TRUE . That said, I agree that this is not good behavior.

I'll review next steps with the team (along with your PR).

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 a pull request may close this issue.

2 participants