-
Notifications
You must be signed in to change notification settings - Fork 592
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
TypeError: Cannot read property 'Code' of undefined #2861
Comments
This code also fails with Same error:
After diving into some debugging, I found out, that actual error is And this is data, passed to a constructor of HttpRequest: {
"protocol": "https:",
"hostname": "route53.amazonaws.com",
"method": "POST",
"headers": { "content-type": "application/xml" },
"path": "/2013-04-01/tags/hostedzone/%2Fhostedzone%2FSomeVerySecretZoneId",
"body": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ChangeTagsForResourceRequest xmlns=\"https://route53.amazonaws.com/doc/2013-04-01/\"><AddTags><Tag><Key>Project</Key><Value>cc/backend3d</Value></Tag><Tag><Key>Role</Key><Value>shiny-project/infra</Value></Tag><Tag><Key>Owner</Key><Value>cc</Value></Tag><Tag><Key>Requestor</Key><Value>cc</Value></Tag><Tag><Key>Environment</Key><Value>dev</Value></Tag><Tag><Key>Team</Key><Value>shiny-project</Value></Tag></AddTags></ChangeTagsForResourceRequest>"
} |
Ran into this as well. Is there a temporary mitigation known? Happens on UPDATE: I fixed the issue i was having. Increasing the |
Hi @radford-for-smpte, thanks for reaching out. I'm not able to reproduce the issue. Can you check if you are still experiencing this with the latest SDK version |
This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing. |
I also see this issue. For example if you try and delete a message on a queue for a message that doesn't exist, the server responds with something like "invalid receipt handle", and aws-sdk-v3 insteads shows the |
I received this error today during the outage, when handling a response from the Redshift API. The source is this generated function: const loadQueryErrorCode = (output, data) => {
if (data.Error.Code !== undefined) {
return data.Error.Code;
}
if (output.statusCode == 404) {
return "NotFound";
}
return "";
}; ...which is run to try to determine the error code to reply with. In this case, the response code was 503 and the body was empty, so the Edit: Ultimately the error appears to be in this code which generates the // Attempt to fetch the error code from the specific location.
String errorCodeLocation = getErrorBodyLocation(context, "data") + ".Code";
writer.openBlock("if ($L !== undefined) {", "}", errorCodeLocation, () -> {
writer.write("return $L;", errorCodeLocation);
}); This function needs to first check if the part before |
Not a perfect solution, and I certainly have no business editing this code. But I do want to get AWS's attention to get this fixed.
We are also seeing this error while using the SQS client and have traced the issue back to the same location as @fluggo mentioned. This is not while using localstack either, this is seen intermittently while calling the AWS SQS API. |
bump - same issue, please fix |
Running into the same error while sending emails with the SES client, the error is masking our efforts to discover the underlying cause. |
same issue for me with SES client. Does anyone know any workaround for now? Just want to see what the real issue is (the underlying error messages being masked by this error). |
I would suggest opening a ticket with AWS directly, making sure to directly reference this issue to get more attention on it. We’ve had one open for some time now. Our “hit it with a mallet” remedy has just been to wrap any call to the client in an external try/catch and retry indefinitely…Not great, but it works™️. Still no way of identifying the underlying issue. |
Here is the diff that solved my problem: diff --git a/node_modules/@aws-sdk/client-sns/dist-cjs/protocols/Aws_query.js b/node_modules/@aws-sdk/client-sns/dist-cjs/protocols/Aws_query.js
index 1b53c3e..3239ee6 100644
--- a/node_modules/@aws-sdk/client-sns/dist-cjs/protocols/Aws_query.js
+++ b/node_modules/@aws-sdk/client-sns/dist-cjs/protocols/Aws_query.js
@@ -4352,7 +4352,7 @@ const buildFormUrlencodedString = (formEntries) => Object.entries(formEntries)
.map(([key, value]) => smithy_client_1.extendedEncodeURIComponent(key) + "=" + smithy_client_1.extendedEncodeURIComponent(value))
.join("&");
const loadQueryErrorCode = (output, data) => {
- if (data.Error.Code !== undefined) {
+ if (data.Error?.Code !== undefined) {
return data.Error.Code;
}
if (output.statusCode == 404) { |
I'm having trouble reproducing this error on the latest version. I tried the Route53 and SQS code snippets provided, inducing errors by using incorrect values for hosted zone id, queue url, message receipt handle etc. In my test cases the server response comes through with the correct description of the errors, for example No hosted zone found with ID for R53 or ReceiptHandle being invalid for SQS. |
Just hit this issue with "@aws-sdk/client-sqs": "3.48.0". This was with a real AWS SQS with this command This is the first time I've noticed the error in the logs from 1000's of queue messages. It isn't reproducible with the same inputs - the same message sent again is successful. |
We are also hitting this exact message. same as above, it is random and not reproducible. what can we do to help troubleshoot the issue?
|
I'm also hitting the same issue. Seems like the cause for me was sending too large of a message. I could reliably get this error when sending a massive message to SNS |
I keep hitting this error with my SQS client for the |
I am also getting error with |
I receive this error when sending a payload to PutMetricsData in the Cloudwatch client. The server returns a 413 response code and an empty data object, so the "Code" value is not present. |
We've been seeing this periodically in production from the SNS client. I can intermittently reproduce it by making a large number of requests in quick succession (real endpoint, not localstack). I tracked it down to the same location as @fluggo. In my case though the root cause is a Seems that the clients need to be updated to handle empty response bodies. Stack trace:
|
I would suggest opening a ticket with AWS directly, making sure to directly
reference this issues to get more attention on it. We’ve had one open for
some time now. Our “hit it with a mallet” remedy has just been to wrap any
call to the client in an external try/catch and retry indefinitely…Not
great, but it works™️.
On Tue, Mar 29, 2022 at 11:31 PM Xiaoxing Hu ***@***.***> wrote:
same issue for me with SES client. Does anyone know any workaround for
now? Just want to see what's the real issue.
—
Reply to this email directly, view it on GitHub
<#2861 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJXK2WKWRGL73PTIHIY6CDVCPDIXANCNFSM5FGQQJSQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
—Eli
|
Encountered this with |
Just ran into this using: |
PR #4367 adds the suggested The versioning containing it is https://github.com/aws/aws-sdk-js-v3/releases/tag/v3.261.0 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Describe the bug
Periodically, when an SqsClient sends a ReceiveMessageCommand I receive:
Your environment
SDK version number
@aws-sdk/client-sqs": "^3.31.0
Is the issue in the browser/Node.js/ReactNative?
Node.js
Details of the browser/Node.js/ReactNative version
v14.17.5
Steps to reproduce
Please share code or minimal repo, and steps to reproduce the behavior.
Observed behavior
See stack trace above
Expected behavior
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: