I am trying to run deploy-prod on the serverless-graphql dynamodb example. Serverless Framework is giving me the following error which I can’t seem to resolve after reading the doc, manpage, etc.
An error occurred: ServiceRole - DynamoRole already exists.
Any ideas on how to resolve this? Thank you.
Full error below:
...
Serverless: WARNING: Could not determine version of module aws-lambda
Serverless: Packing external modules: graphql@^0.10.5, apollo-server-lambda@1.3.2, graphql-playground-middleware-lambda@^1.2.0, aws-lambda, graphql-tools@2.7.2, serverless-dynamodb-client@^0.0.2, aws-xray-sdk@^1.2.0
Serverless: WARNING: Could not determine version of module aws-lambda
Serverless: Packaging service...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service .zip file to S3 (9.9 MB)...
Serverless: Validating template...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
.....................
Serverless: Operation failed!
Serverless Error ---------------------------------------
An error occurred: ServiceRole - DynamoRole already exists.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information -----------------------------
OS: darwin
Node Version: 10.6.0
Serverless Version: 1.32.0
I ran into a similar issue with a project I was working on last night, but with an S3 bucket. That being said I was seeing the following:
sls deploy
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Creating Stack...
Serverless: Checking Stack create progress...
.....
Serverless: Stack create finished...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service .zip file to S3 (45.93 KB)...
Serverless: Validating template...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
.................
Serverless: Operation failed!
Serverless Error ---------------------------------------
An error occurred: ServerlesslyRedirectS3Bucket - shortener-s3-bucket already exists.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information -----------------------------
OS: darwin
Node Version: 10.11.0
Serverless Version: 1.32.0
Ultimately I found that this was due to 2 things. I had performed an sls remove that partially failed because there were contents in the S3 bucket, but it seemed like the CloudFormation stack had thought the bucket had been removed. I was able to fix this by either changing the stage environment, or going into the AWS console and removing the S3 bucket and CloudFormation stack manually. I confirmed that either or both approaches worked for this case and it may be worth a shot in your case as well.
I can confirm that only the first method worked for me. I changed the stage environment and it all went good. The other method does not seem to work for me.