amplify-cli: UnhandledPromiseRejectionWarning: NoSuchBucket: The specified bucket does not exist
Note: If your issue/bug is regarding the AWS Amplify Console service, please log it in the Amplify Console GitHub Issue Tracker
Describe the bug
In a react native project (expo) that is using amplify services (auth, gql api, storage) after modifying the gql schema, I ran the amplify status. After being prompted to upgrade the amplify-cli, i ran the npm install -g @aws-amplify/cli which then installed the new library. Then I ran amplify status, showing that the API had been updated again. Ran amplify push and then was given the error of “UnhandledPromiseRejectionWarning: NoSuchBucket: The specified bucket does not exist” (see screenshot for additional information on the error in terminal).
I then proceded to attempt to delete the storage (as this project is still in development) with the command amplify remove storage. Then amplify status which showed the API UPDATED and the STORAGE DELETED. Ran the command amplify push and was given the same error.
I opened a blank folder in my IDE (Visual Studio Code) and ran the amplify pull < > with my projects appropriate command copied and pasted from the amplify console. The same error was thrown again with a little extra information.
“Failed to pull the backend. The specified bucket does not exist NoSuchBucket: The specified bucket does not exist”
After further inspection in my Amplify console, I have noted that all of my categories are now missing from the back end which were the following categories: Authentication API Storage
However, when looking into all of those individual spots in my AWS account they are still there i.e. Cognito User Pools, S3 bucket, AppSync etc. AND the code that is relying on these deployments are functioning without issue in expo local and hosted app.
Amplify CLI Version
You can use amplify -v to check the amplify cli version on your system
4.27.3
To Reproduce Steps to reproduce the behavior or terminal output if applicable
I am unsure the steps to reproduce. It is only occuring on my machine and I do not have an additional computer to attempt to reproduce. It appears it is related to my AWS account and/or Amplify Project. However, please follow the steps I listed above to see if you can reproduce.
Expected behavior A clear and concise description of what you expected to happen.
The amplify push will work as it has before, updating my resources in the cloud. The GQL Api schema will update, and my S3 bucket will be deleted as I also have ran that command.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. Mac/Windows/Ubuntu]
Mac OS 10.15.6 IDE: Visual Studio Code 1.48.1 using the bash terminal internal of VS Code
- Node Version. You can use
node -vto check the node version on your system
v.14.7.0
Additional context Add any other context about the problem here.
Questions asked in another issue with the same problem #4872
CLI verion : answered above OS version : answered above Amplify categories that you added to your project : Auth, Storage, API Did you use Amplify Console to create your project? Yes Have you pulled the project from github console and run amplify init on your local machine? The project was intialized locally with amplify before being pushed into github Have you manually changed anything in the <project-root>/amplify/.config folder? No. Have you updated or deleted S3 bucket on the S3 console? No. After encountering errors I did attempt to delete the storage category from the Amplify Project.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 25 (10 by maintainers)
I can confirm that this issue has been resolved. Thank you so much for your time and effort to help me get back on track!
After creating the new environment, you can run
amplify env removeand remove the older environment.Please read my comment out here - https://github.com/aws-amplify/amplify-cli/issues/5171#issuecomment-680186881 This would help clone your backend infrastructure( create a new amplify app and new resources).
If you want to retrieve back your deleted S3 bucket for your current environment then you’d have to contact AWS support -https://aws.amazon.com/premiumsupport/knowledge-center/aws-phone-support/ for help.
This S3 bucket also get deleted if you’ve run “amplify delete” command in the past. If you’re still in development, you can run “amplify env add” -> “amplify push” to clone your infrastructure and add a new environment. This would clone the deployment bucket for that environment as well which seems to be missing.