Aws-sdk-js: Cannot convert undefined or null to object on new code in sts.org (new SDK version 2.525)

Created on 9 Sep 2019  路  5Comments  路  Source: aws/aws-sdk-js

Describe the bug
In my CI/CD pipeline when building my Node application using the new AWS SDK (version 2.525.0) I get this error:

Error: Cannot convert undefined or null to object

Stack: "TypeError: Cannot convert undefined or null to object\n    at hasOwnProperty (<anonymous>)\n    at features.constructor.validateRegionalEndpointsFlag (/rhythm/workspace/source/node_modules/aws-sdk/lib/services/sts.js:92:41)\n    at features.constructor.optInRegionalEndpoint (/rhythm/workspace/source/node_modules/aws-sdk/lib/services/sts.js:106:10)\n    at features.constructor.validateService (/rhythm/workspace/source/node_modules/aws-sdk/lib/services/sts.js:124:10)\n    at features.constructor.initialize (/rhythm/workspace/source/node_modules/aws-sdk/lib/service.js:52:10)\n    at features.constructor.Service [as constructor] (/rhythm/workspace/source/node_modules/aws-sdk/lib/service.js:40:10)\n    at features.constructor (/rhythm/workspace/source/node_modules/aws-sdk/lib/util.js:624:24)\n    at new features.constructor (/rhythm/workspace/source/node_modules/aws-sdk/lib/util.js:624:24)\n    at features.constructor.Service [as constructor] (/rhythm/workspace/source/node_modules/aws-sdk/lib/service.js:31:17)\n    at new features.constructor (/rhythm/workspace/source/node_modules/aws-sdk/lib/util.js:624:24)\n    at getCredentialsForRole (/rhythm/workspace/source/node_modules/@rhythmsoftware/aws/src/aws-helper.js:61:14)\n    at refreshCredentials (/rhythm/workspace/source/node_modules/@rhythmsoftware/aws/src/aws-helper.js:46:24)\n    at <anonymous>\n    at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:228:7)"
Exited with code 1

I can see the problem is with line 92 of a new chunk of code just added to the /lib/services/sts.js, where a null check is not being performed.

Is the issue in the browser/Node.js?
Node.js

If on Node.js, are you running this on AWS Lambda?
No.

Details of the browser/Node.js version

SDK version number
v2.525.0

To Reproduce (observed behavior)
A simple application run using this sdk seems to cause the error, though I haven't tried building an empty project.

Expected behavior
I expect to be able to run my Node application.

Screenshots
image

Additional context
Add any other context about the problem here.

Most helpful comment

Hi @andrewryan1906 @osubuu, the patch has been released in 2.526.0. Please upgrade the SDK and have a try. Thank you for the bringing this up!

All 5 comments

Also experiencing this issue

Hi @andrewryan1906 @osubuu, the patch has been released in 2.526.0. Please upgrade the SDK and have a try. Thank you for the bringing this up!

Thanks @AllanFly120

Hey @alexdebrie and @AllanFly120 ... I gotta take my hat off to you guys for amazing service and speed. This kind of stuff is why I'm with AWS.

Thanks for taking care of this,
Andrew

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.

Was this page helpful?
0 / 5 - 0 ratings