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

Profile ############# requires a role to be assumed, but no role assumption callback was provided. #1998

Closed
edpega opened this issue Jan 28, 2021 · 8 comments · Fixed by #2221
Labels
guidance General information and guidance, answers to FAQs, or recommended best practices/resources.

Comments

@edpega
Copy link

edpega commented Jan 28, 2021

Confirm by changing [ ] to [x] below:

Profile selection causes error:
Error Error: Profile ############# requires a role to be assumed, but no role assumption callback was provided.

Code snippet:
const express = require('express')
const app = express()
const port = 8082
const exec = require("child_process").exec
const {
AppStreamClient
} = require("@aws-sdk/client-appstream-node");

const {fromIni} = require("@aws-sdk/credential-provider-ini");
const appStream = new AppStreamClient({
credentials: fromIni({profile: '#############'}),
region: 'us-east-1'});

app.get('/test', (req,res) => {
var params = { Names: ['as-stack-1']};
const run = async() => {
try {
const data = await appStream.send(new describeStacksCommand(params));
res.header("Content-Type","application/json");
res.status(200).send(data);
} catch (err) {
console.log("Error", err);
}
}
run();

});

app.listen(port, () => {
console.log('Server running at http://127.0.0.1:' + port +'/');
})

@ajredniwja
Copy link
Contributor

Transferring the issue to the correct repository.

@ajredniwja ajredniwja transferred this issue from aws/aws-sdk-js Feb 3, 2021
@ajredniwja
Copy link
Contributor

Hey @edpega thanks for opening this issue. Is it possible to to switch to the correct package i.e https://www.npmjs.com/package/@aws-sdk/client-appstream

@ajredniwja ajredniwja added guidance General information and guidance, answers to FAQs, or recommended best practices/resources. response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. labels Feb 3, 2021
@github-actions
Copy link

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.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Feb 11, 2021
@edpega
Copy link
Author

edpega commented Feb 11, 2021

Issue remains with new package:

npm install @aws-sdk/client-appstream

Code snippet:
const express = require('express')
const app = express()
const port = 8082
const exec = require("child_process").exec
const {
AppStreamClient
} = require("@aws-sdk/client-appstream");

const {fromIni} = require("@aws-sdk/credential-provider-ini");
const appStream = new AppStreamClient({
credentials: fromIni({profile: '#############'}),
region: 'us-east-1'});

app.get('/test', (req,res) => {
var params = { Names: ['as-stack-1']};
const run = async() => {
try {
const data = await appStream.send(new describeStacksCommand(params));
res.header("Content-Type","application/json");
res.status(200).send(data);
} catch (err) {
console.log("Error", err);
}
}
run();

});

app.listen(port, () => {
console.log('Server running at http://127.0.0.1:' + port +'/');
})

Error Error: Profile XXXXXXXXXXXX requires a role to be assumed, but no role assumption callback was provided.
at new ProviderError (/scripts/appstream/node_modules/@aws-sdk/property-provider/build/ProviderError.js:17:28)
at /scripts/appstream/node_modules/@aws-sdk/credential-provider-ini/build/index.js:58:31
at step (/scripts/appstream/node_modules/tslib/tslib.js:141:27)
at Object.next (/scripts/appstream/node_modules/tslib/tslib.js:122:57)
at /scripts/appstream/node_modules/tslib/tslib.js:115:75
at new Promise ()
at Object.__awaiter (/scripts/appstream/node_modules/tslib/tslib.js:111:16)
at resolveProfileData (/scripts/appstream/node_modules/@aws-sdk/credential-provider-ini/build/index.js:43:20)
at /scripts/appstream/node_modules/@aws-sdk/credential-provider-ini/build/index.js:32:20
at async SignatureV4.signRequest (/scripts/appstream/node_modules/@aws-sdk/middleware-signing/node_modules/@aws-sdk/signature-v4/dist/cjs/SignatureV4.js:84:29) {
tryNextLink: false,
'$metadata': { attempts: 1, totalRetryDelay: 0 }
}

@github-actions github-actions bot removed closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. labels Feb 12, 2021
@ivanbarlog
Copy link

@edpega I've got the same problem. Have you found any workaround?

@edpega
Copy link
Author

edpega commented Feb 22, 2021

I have not.

@cpitchford
Copy link

I believe I re-raised this issue here: #2087 but have included a work around function

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
guidance General information and guidance, answers to FAQs, or recommended best practices/resources.
Projects
None yet
4 participants