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

Breaking change between 3.6.1 and 3.6.3 #322

Open
NBardelot opened this issue Mar 28, 2024 · 6 comments
Open

Breaking change between 3.6.1 and 3.6.3 #322

NBardelot opened this issue Mar 28, 2024 · 6 comments

Comments

@NBardelot
Copy link

Here is the log of the error:

Logging in with profile 'default'...
Using AWS SAML endpoint https://signin.aws.amazon.com/saml
? Password: [hidden]
Open your Authenticator app, and enter the number shown to sign in.​​
...
? Role: arn:aws:iam::123456789012:role/myrole
Assuming role arn:aws:iam::123456789012:role/myrole in region undefined...
TypeError: (0 , proxy_agent_1.default) is not a function
    at Object._assumeRoleAsync (/home/admin/aws-azure-login/node_modules/aws-azure-login/lib/login.js:773:59)
    at Object.loginAsync (/home/admin/aws-azure-login/node_modules/aws-azure-login/lib/login.js:381:20)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

The behaviour was OK in version 3.6.1 and is now broken in 3.6.3.

@NBardelot
Copy link
Author

NBardelot commented Mar 28, 2024

Issue seems to be tied to this line of code (npm package version 3.6.3):

> grep -n -B 3 -A 3 proxy_agent_1.default /home/admin/aws-azure-login/node_modules/aws-azure-login/lib/login.js
770-            stsOptions = {
771-                ...stsOptions,
772-                requestHandler: new node_http_handler_1.NodeHttpHandler({
773:                    httpsAgent: (0, proxy_agent_1.default)(process.env.https_proxy),
774-                }),
775-            };
776-        }

And seems to match a similar error mentionned in StackOverflow.

I see that the proxy-agent lib was updated from "proxy-agent": "^5.0.0" to "proxy-agent": "^6.3.1" between aws-azure-login v3.6.2 and v3.6.3.

So it makes me think that the response in the StackOverflow discussion can be applied, and that in login.ts the use of the proxy-agent lib should be patched in order to comply with the new interface of proxy-agent v6.

@jakobmagiera
Copy link

jakobmagiera commented Apr 4, 2024

I'm experiencing something similar with 3.6.3 but for me the issue is the missing region:

Assuming role ###### in region undefined...
Error: Region is missing
    at default (/Users/######/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/node_modules/@smithy/config-resolver/dist-cjs/index.js:117:11)
    at /Users/######/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/node_modules/@smithy/node-config-provider/dist-cjs/index.js:72:104
    at /Users/######/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/node_modules/@smithy/property-provider/dist-cjs/index.js:79:33
    at async coalesceProvider (/Users/######/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/node_modules/@smithy/property-provider/dist-cjs/index.js:106:18)
    at async /Users/######/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/node_modules/@smithy/property-provider/dist-cjs/index.js:117:20
    at async region (/Users/######/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/node_modules/@smithy/config-resolver/dist-cjs/index.js:142:30)
    at async Object.defaultSTSHttpAuthSchemeParametersProvider [as httpAuthSchemeParametersProvider] (/Users/######/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthSchemeProvider.js:10:18)
    at async /Users/######/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/node_modules/@smithy/core/dist-cjs/index.js:61:5
    at async /Users/######/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js:33:22
    at async Object._assumeRoleAsync (/Users/######/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/lib/login.js:794:21)
    at async Object.loginAsync (/Users/######/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/lib/login.js:381:9)

@mickavaz
Copy link

Hello,
We have the same issue than @jakobmagiera when we upgrade our node version. I don't know if you found a solution.
Thanks

@Jason-Farkas
Copy link

Jason-Farkas commented Apr 16, 2024

I added to lib/login.js in node_modules/aws-azure-login

const https_proxy_agent_1 = require("https-proxy-agent");

and changed line 774 to

httpsAgent: new https_proxy_agent_1.HttpsProxyAgent(process.env.https_proxy),

@mohan-work
Copy link

Facing same issue,

Error: Region is missing
    at default (/Users/momuthusamy/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/node_modules/@smithy/config-resolver/dist-cjs/index.js:117:11)
    at /Users/momuthusamy/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/node_modules/@smithy/node-config-provider/dist-cjs/index.js:72:104
    at /Users/momuthusamy/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/node_modules/@smithy/property-provider/dist-cjs/index.js:79:33
    at async coalesceProvider (/Users/momuthusamy/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/node_modules/@smithy/property-provider/dist-cjs/index.js:106:18)
    at async /Users/momuthusamy/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/node_modules/@smithy/property-provider/dist-cjs/index.js:117:20
    at async region (/Users/momuthusamy/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/node_modules/@smithy/config-resolver/dist-cjs/index.js:142:30)
    at async Object.defaultSTSHttpAuthSchemeParametersProvider [as httpAuthSchemeParametersProvider] (/Users/momuthusamy/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthSchemeProvider.js:10:18)
    at async /Users/momuthusamy/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/node_modules/@smithy/core/dist-cjs/index.js:61:5
    at async /Users/momuthusamy/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js:33:22
    at async Object._assumeRoleAsync (/Users/momuthusamy/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/lib/login.js:794:21)
    at async Object.loginAsync (/Users/momuthusamy/.nvm/versions/node/v18.19.1/lib/node_modules/aws-azure-login/lib/login.js:381:9)

@mohan-work
Copy link

[Fix] [Workaround]
Temporarily I installed previous stable version,

npm install -g aws-azure-login@3.6.1

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

5 participants