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

"Role with name [my name]-executor already exists" on error #9

Closed
marcusoftnet opened this issue Feb 26, 2016 · 7 comments
Closed

"Role with name [my name]-executor already exists" on error #9

marcusoftnet opened this issue Feb 26, 2016 · 7 comments

Comments

@marcusoftnet
Copy link
Contributor

I ran:

claudia create --name storingInDynamo --region us-west-2 --api-module index

but forgot the files property. That trigger an excellent error message: package.json does not contain the files property

Great - but when I fixed that and ran the create-command again:

{ [EntityAlreadyExists: Role with name storingInDynamo-executor already exists.]
  cause: 
   { [EntityAlreadyExists: Role with name storingInDynamo-executor already exists.]
     message: 'Role with name storingInDynamo-executor already exists.',
     code: 'EntityAlreadyExists',
     time: Fri Feb 26 2016 14:24:46 GMT+0100 (CET),
     requestId: '4df7b6fb-dc8c-11e5-9b40-35d169b930d8',
     statusCode: 409,
     retryable: false,
     retryDelay: 72.52002414315939 },
  isOperational: true,
  code: 'EntityAlreadyExists',
  time: Fri Feb 26 2016 14:24:46 GMT+0100 (CET),
  requestId: '4df7b6fb-dc8c-11e5-9b40-35d169b930d8',
  statusCode: 409,
  retryable: false,
  retryDelay: 72.52002414315939 }

And now I don't know how to fix this, except updating the name of the function (--name)

@gojko
Copy link
Member

gojko commented Feb 26, 2016

I'm planning to add a cleanup function soon. meanwhile, go to the aws web console (aws.amazon.com), select IAM, then Roles, then delete the role. Alternatively, delete the role from the command line using the aws cli

@gojko gojko closed this as completed Feb 26, 2016
@marcusoftnet
Copy link
Contributor Author

Thanks!

@thom-nic
Copy link

thom-nic commented Feb 21, 2017

Did this cleanup function ever get implemented? calling aws iam delete-role is not so simple because you have to delete the inline log-writer policy first. So it seems you have to do

EDIT when I deleted the role but not the function, it created the role then failed to create the function, so I deleted the function but then when I ran create it failed because the role already exists... again.

So all steps:

aws iam delete-role-policy --role-name my-function-executor --policy-name log-writer
aws iam delete-role --role-name my-function-executor
aws lambda delete-function --function-name my-function

EDIT 2: I'll mention I got into this situation because I changed my module entry point name from index.js to build/app.js (I started using babel precompilation.) I updated claudia.json but error messages seemed to indicate something was still attempting to import the old index.js so I deleted claudia.json and realized I had to delete the old lambda & role before it could create a new one with the same name.

@simalexan
Copy link
Member

@thom-nic its best to ask and discuss this on the gitter. please, if its not too much of a hassle, write it down on gitter and we can have a discussion on that

@cameronoxley
Copy link

Was there any resolution on this?

@thom-nic
Copy link

TBH I don't remember. I probably deleted everything on the AWS/IAM side and started fresh. Unfortunately Gitter sucks as a searchable knowledge base so here we are :(

I think the steps I listed above are sufficient to get everything cleaned up but I haven't needed to do it in a while so I don't recall.

@alpha-beta-soup
Copy link

alpha-beta-soup commented Jun 23, 2019

Hmm, deleting the role in IAM doesn't seem to be sufficient — I still get the error after doing so. Using the CLI has the same outcome. Is there something else that needs deleting? aws iam list-roles verifies that the role doesn't exist.

I think these issues are the same or very similar:

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

6 participants