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

middleware: fix date header parse error log #1099

Merged
merged 3 commits into from
Feb 5, 2021
Merged

middleware: fix date header parse error log #1099

merged 3 commits into from
Feb 5, 2021

Conversation

danielhochman
Copy link
Contributor

@danielhochman danielhochman commented Feb 1, 2021

This log message in middleware.go is not properly formatted because the format is being passed as the classification to Logf(classification Classification, format string, v ...interface{}).

Example output:
SDK 2021/02/01 22:20:44 failed to parse response Date Header value, got %!v(MISSING) parsing time "Mon, 1 Feb 2021 22:20:44 GMT" as "Mon Jan _2 15:04:05 2006": cannot parse ", 1 Feb 2021 22:20:44 GMT" as " "

Looking at the error and associated parsing code, it looks like an issue with some AWS endpoint not returning compliant timestamps that causes this warning (should technically be 01 Feb not 1 Feb). I can provide a fix for that in a separate PR with slightly more permissive Date header parsing if needed.

@skmcgrail skmcgrail self-requested a review February 1, 2021 23:59
@skmcgrail
Copy link
Member

@danielhochman out of curiosity, are you seeing this with a specific service or is this message getting logged for all service responses?

@danielhochman
Copy link
Contributor Author

@skmcgrail looks like it's coming from the Kinesis API on ListStreams call though I can't be 100% sure

@danielhochman
Copy link
Contributor Author

danielhochman commented Feb 2, 2021

@skmcgrail I tested in three regions, us-east-1, us-west-1, and us-west-2. ListStreams in us-west-2 is reproducible and returns non-compliant timestamps, other regions were fine. Other service calls in us-west-2 also fine, e.g. EC2 DescribeInstances.

@skmcgrail
Copy link
Member

Thank you for this PR @danielhochman , I've cut a tracking issue so that we can follow-up on supporting the datetime format Kinesis is sending package in the HTTP Date header. Thank you for providing the investigation details.

@skmcgrail skmcgrail merged commit 60ec63e into aws:main Feb 5, 2021
@danielhochman danielhochman deleted the fix-time-parsing-error-log branch February 5, 2021 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants