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

AWS SDK can return error messages that include a return key #47789

Closed
rrati opened this issue Jun 20, 2017 · 5 comments
Closed

AWS SDK can return error messages that include a return key #47789

rrati opened this issue Jun 20, 2017 · 5 comments

Comments

@rrati
Copy link

rrati commented Jun 20, 2017

The following log excerpt comes from the attach detach controller trying to attach a volume that is already attached to an instance.

attacher.go:73] Error attaching volume "aws://us-east-1c/": Error attaching EBS volume "" to instance "": VolumeInUse: is already attached to an instance
nestedpendingoperations.go:262] Operation for ""kubernetes.io/aws-ebs/aws://us-east-1c/"" failed. No retries permitted until (durationBeforeRetry 2m0s). Error: Failed to attach volume "" on node "" with: Error attaching EBS volume "" to instance "": VolumeInUse: is already attached to an instance
aws.go:1248] Assigned mount device cm -> volume
aws.go:1271] Releasing in-process attachment entry: cm -> volume
status code: 400, request id:
status code: 400, request id:

The problem is that the AWS SDK produces an error message that includes a \n in it. This can cause the log message to be split over multiple log entries. That situation can be made worse if there are multiple events/logs going on at the same time.

We should handle log messages from aws that contain a \n character in a better way.

@kubernetes/sig-aws-misc @justinsb

@gnufied
Copy link
Member

gnufied commented Jun 20, 2017

I propose that we replace those pesky "\n\t" with "---" and join the error substrings. I don't see any value in log lines that span multiple lines.

@justinsb
Copy link
Member

We should use %q as our formatter for these messages, not %s.

@justinsb
Copy link
Member

Ah - hadn't twigged this was an %v with an error, but it does seem to work:

https://play.golang.org/p/Y0fHPbixek

@rrati
Copy link
Author

rrati commented Jun 22, 2017

The only issue I have with %q is that is kind of decreases readability imo. It leaves the \n in the string vs interpret it, but that means you have information separated by \n characters. Probably better than having it on multiple lines, but not ideal. Unless there is something better I guess %q is better then the current situation.

rrati pushed a commit to rrati/kubernetes that referenced this issue Jun 23, 2017
k8s-github-robot pushed a commit that referenced this issue Jul 3, 2017
Automatic merge from submit-queue

Use %q formatter for error messages from the AWS SDK. #47789

Error messages from the AWS SDK can have return keys in them, so use %q formatter for those messages.
@rrati
Copy link
Author

rrati commented Jul 3, 2017

Closed via #47919

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

No branches or pull requests

4 participants