-
-
Notifications
You must be signed in to change notification settings - Fork 463
Invalid credentials or this AWS S3 bucket name may already be taken
error when trying to deploy
#289
Comments
One other thing to note, I created a new, clean IAM role and have it full admin permissions, but according to the AWS console it's not being used: I checked I also removed the old S3 bucket, and tried using different names, etc. Despite the error, I don't believe this is related to S3. |
Bizarrely; this issue has "gone away" this morning - nothing was touched/changed overnight. Based on some of the contents of this discussion serverless-components/website#16 - I suspect it could have been an intermittent AWS issue. |
This issue has come back - is anyone else experiencing it? |
Hi @chrsgrrtt, Yeh I'm experiencing this too. Did you manage to get to the bottom of it? |
Ah so for me the issue was that I had made the initial deploy using AWS credentials for a different account by accident. So when I then updated the credentials and tried to deploy again it failed because the bucketName was already taken (as bucketName has to be unique globally on AWS). Fix for me was to just delete the .serverless and .serverless_nextjs directories and run serverless again. |
|
I had the same issue too. The fix for me was to |
I also had |
Ran into this as well, with a nextjs project that was deployed by another person using a different set of AWS credentials, and then I tried to deploy an update. Unfortunately deleting the .serverless folder and then running Has anyone figured out how multiple sets of AWS credentials can be used to push updates to the same existing deployment (not generate a brand new one)? |
I've also just hit this error. I'm also using full admin credentials. The error appears to be due to including an environment variable in the
The environment variables in the inputs section below fails to be parsed.
This config will work fine, however.
|
@kylekirkby I am not quite sure how the env variable substitution works in Serverless Components when you are concatenating like that. Most likely it seems that it might be a bug in Serverless where it's just taking It seems someone was facing similar issue like here, seems there is a workaround here: #530 (comment), it might be a bug in serverless framework. You could also try to console log what the bucket name is before this line: serverless-next.js/packages/serverless-components/nextjs-component/src/component.ts Line 316 in bfe0301
inputs.bucketName )
|
Updated the docs with possible solutions for the env variable concatenation issue: https://github.com/serverless-nextjs/serverless-next.js/blob/master/README.md#concatenating-environment-variables-doesnt-seem-to-work Let me know if that works. |
Thank you @dphang for adding this! I'm now getting a different problem, however.
I'll keep digging, could be unrelated... |
@dphang, after further testing by commenting out different sections, it appears the problematic line that throws the bad request error was the |
@kylekirkby, I am not sure why it is breaking. Using the latest alpha version and the following stage: ${env.STAGE}
next-app:
component: "../../serverless-components/nextjs-component"
inputs:
build:
postBuildCommands: ["node scripts/post-build-test.js"]
cloudfront:
defaults:
forward:
headers: [Authorization]
api/*:
forward:
headers: [Authorization] |
Hi @dphang, I should have updated sooner but I’ve come down with the dreaded COVID19. It turns out that I needed to use the STAGE environment variable name and can’t use BUIlD_ENV. All is working now. Thank you for your support. |
Closing old issue, if there are still other problems, please open a new one |
Any update here? I have same issue |
I had this issue and figured I'd create the bucket manually as it seems serverless nextjs is fine with it as long as you have access to the bucket. Turns out the region where I tried to create the bucket was disabled for some reason. This pattern could help you verify you can actually create the bucket. The (--debug) output you get is a little bit lacking at times so stuff like this can happen I guess. |
Describe the bug
We first hit this issue today, when trying to deploy an update to a project. The project was last deployed (successfully) about 2 days ago. Nothing had changed in terms of serverless or nextjs configuration, and the build step is successful. I tried doing a clean clone of the repository and running it cleanly, and I also tried removing the
bucketName
configuration to allow for a generated name - the error persisted. Is anyone else encountering this?To Reproduce
Steps to reproduce the behavior:
serverless
Expected behavior
Usual deployment.
Screenshots

Desktop (please complete the following information):
Additional context
I run the
serverless
command in an Alpine Docker container - but I have successfully deployed in this way before now, and don't believe that to be related.The text was updated successfully, but these errors were encountered: