Describe the bug
When adding hosting to a project and running the amplify publish
, the command fails with the following:
CREATE_FAILED hostingS3AndCloudFront AWS::CloudFormation::Stack ... Parameters: [bucketName] must have values
My parameters.json looks like this:
{
"bucketName": "suggested-bucket-name-20190227121241-hostingbucket"
}
To Reproduce
amplify add hosting
amplify publish
Expected behavior
I expected the app to be published successfully.
Here is full console log:
$ amplify push
Current Environment: NONE
| Category | Resource name | Operation | Provider plugin |
| -------- | --------------- | --------- | ----------------- |
| Hosting | S3AndCloudFront | Create | awscloudformation |
? Are you sure you want to continue? Yes
⠦ Updating resources in the cloud. This may take a few minutes...
UPDATE_IN_PROGRESS frontendpoc-20190208162455 AWS::CloudFormation::Stack Wed Feb 27 2019 12:26:11 GMT+0200 (EET) User Initiated
CREATE_IN_PROGRESS hostingS3AndCloudFront AWS::CloudFormation::Stack Wed Feb 27 2019 12:26:16 GMT+0200 (EET)
⠦ Updating resources in the cloud. This may take a few minutes...
CREATE_FAILED hostingS3AndCloudFront AWS::CloudFormation::Stack Wed Feb 27 2019 12:26:16 GMT+0200 (EET) Parameters: [bucketName] must have values
⠏ Updating resources in the cloud. This may take a few minutes...
UPDATE_ROLLBACK_IN_PROGRESS default-bucket-name-20190208162455 AWS::CloudFormation::Stack Wed Feb 27 2019 12:26:17 GMT+0200 (EET) The following resource(s) failed to create: [hostingS3AndCloudFront].
⠙ Updating resources in the cloud. This may take a few minutes...
UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS default-bucket-name-20190208162455 AWS::CloudFormation::Stack Wed Feb 27 2019 12:26:29 GMT+0200 (EET)
⠙ Updating resources in the cloud. This may take a few minutes...
DELETE_COMPLETE hostingS3AndCloudFront AWS::CloudFormation::Stack Wed Feb 27 2019 12:26:31 GMT+0200 (EET)
UPDATE_ROLLBACK_COMPLETE default-bucket-name-20190208162455 AWS::CloudFormation::Stack Wed Feb 27 2019 12:26:31 GMT+0200 (EET)
⠹ Updating resources in the cloud. This may take a few minutes...Error updating cloudformation stack
⠴ Updating resources in the cloud. This may take a few minutes...
Following resources failed
✖ An error occurred when pushing the resources to the cloud
Resource is not in the state stackUpdateComplete
@brylie what version of Amplify CLI do you have installed? You can determine the version number by running amplify -v
From the logs, it looks like your project was initialized using CLI prior to V1 and you're pushing the changes after updating your CLI that supports multienv.
Did you add the hosting after updating the CLI or before the update?
$ amplify -v
1.1.6
I ran the upgrade process when Amplify detected that I had initialized the project with an older version.
I added hosting after initializing and upgrading the project.
I tried again today, removing all Amplify resources from the project, and then re-adding hosting. However, the process fails again, with a different error:
$ amplify status
Current Environment: NONE
| Category | Resource name | Operation | Provider plugin |
| -------- | ------------- | --------- | --------------- |
$ amplify add hosting
? Select the environment setup: DEV (S3 only with HTTP)
? hosting bucket name project-20190228123211-hostingbucket
? index doc for the website index.html
? error doc for the website index.html
You can now publish your app using the following command:
Command: amplify publish
$ amplify publish
Current Environment: NONE
| Category | Resource name | Operation | Provider plugin |
| -------- | --------------- | --------- | ----------------- |
| Hosting | S3AndCloudFront | Create | awscloudformation |
? Are you sure you want to continue? Yes
⠏ Updating resources in the cloud. This may take a few minutes...
CREATE_IN_PROGRESS hostingS3AndCloudFront AWS::CloudFormation::Stack Thu Feb 28 2019 12:33:20 GMT+0200 (Eastern European Standard Time)
UPDATE_IN_PROGRESS project-20190208162455 AWS::CloudFormation::Stack Thu Feb 28 2019 12:33:15 GMT+0200 (Eastern European Standard Time) User Initiated
⠋ Updating resources in the cloud. This may take a few minutes...
UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS project-20190208162455 AWS::CloudFormation::Stack Thu Feb 28 2019 12:33:24 GMT+0200 (Eastern European Standard Time)
UPDATE_ROLLBACK_IN_PROGRESS project-20190208162455 AWS::CloudFormation::Stack Thu Feb 28 2019 12:33:22 GMT+0200 (Eastern European Standard Time) The following resource(s) failed to create: [hostingS3AndCloudFront].
CREATE_FAILED hostingS3AndCloudFront AWS::CloudFormation::Stack Thu Feb 28 2019 12:33:21 GMT+0200 (Eastern European Standard Time) Parameters: [bucketName] must have values
⠇ Updating resources in the cloud. This may take a few minutes...
DELETE_COMPLETE hostingS3AndCloudFront AWS::CloudFormation::Stack Thu Feb 28 2019 12:33:26 GMT+0200 (Eastern European Standard Time)
⠹ Updating resources in the cloud. This may take a few minutes...
UPDATE_ROLLBACK_COMPLETE project-20190208162455 AWS::CloudFormation::Stack Thu Feb 28 2019 12:33:26 GMT+0200 (Eastern European Standard Time)
⠧ Updating resources in the cloud. This may take a few minutes...Error updating cloudformation stack
⠇ Updating resources in the cloud. This may take a few minutes...
Following resources failed
✖ An error occurred when pushing the resources to the cloud
This also happens to me when using different cli versions. In one computer, amplify-cli works for the project I'm building with version 1.1.3 but, in the laptop, after cloning the repo, install packges, etc when adding a function I got the message for all the parameter of every resource that has been created before. Just my 2 cents
@brylie
It might be because your amplify cli is not properly updated, could you go through these steps to update it again?
If you are just practicing, try to run amplify init
on a new project and then add the hosting category.
The CLI does have the capability to migrate project setup from its older versions though, so that shouldn't be a big concern.
@UnleashedMind so, if the project we are working on is not just a toy, we should not be using updated versions from the one we used to create it? I mean, right now, I can't use it having versions 1.1.3 and 1.1.6 😕
@bitIO that's not what I meant, you should go ahead and update the CLI version, but make sure your update is complete.
We couldn't reproduce the issue, so we suspect that there might be some problem with the cli installation, so we suggested to re-install it.
@brylie
Do you still have this issue?
If you don't see this issue anymore, please close it.
Well, I will try to deploy again today. Otherwise, we are considering just deploying with Jenkins.
I tried again with CLI 1.1.7, updating the project when prompted:
For whatever reason, it is not creating or finding the S3 bucket when running amplify publish
after adding hosting.
I see the cli has successfully migrated your project to be used with the latest CLI version.
There's only an auth category after the migration.
Could you run amplify hosting add
after the migration? and then do a amplify push
?
Closing this issue due to lack of requester comments and abiity to not reproduce this behavior with the latest version of the CLI. Please feel free to re-open this if you're still sseeing the issue.
Could you run
amplify hosting add
after the migration? and then do a amplify push?
If you notice, amplify add hosting
is the first command issued in the animated GIF. It then proceeds to upgrade the project. The previous comments in this thread indicate what happens when running amplify push
after the amplify add hosting
command. Those steps are also indicated in the issue description.
I am still getting this issue with v1.6.4-v1.6.8
I am getting this error as well with v1.6.9
UPDATE_FAILED authcognito367bef3a AWS::CloudFormation::Stack Sat May 18 2019 23:13:31 GMT-0700 (Pacific Daylight Time) Parameters: [authRoleArn, usernameAttributes, autoVerifiedAttributes, unauthRoleName, allowUnauthenticatedIdentities, smsVerificationMessage, userpoolClientReadAttributes, mfaTypes, emailVerificationSubject, useDefault, openIdLambdaIAMPolicy, userpoolClientGenerateSecret, mfaConfiguration, userpoolClientLogPolicy, openIdRolePolicy, identityPoolName, openIdLogPolicy, authSelections, smsAuthenticationMessage, roleExternalId, mfaLambdaLogPolicy, passwordPolicyMinLength, userPoolName, openIdLambdaRoleName, userpoolClientWriteAttributes, policyName, userpoolClientName, userpoolClientLambdaPolicy, resourceName, mfaLambdaIAMPolicy, mfaPassRolePolicy, emailVerificationMessage, userpoolClientRefreshTokenValidity, userpoolClientSetAttributes, unauthRoleArn, authRoleName, requiredAttributes, roleName, passwordPolicyCharacters, lambdaLogPolicy, userpoolClientLambdaRole, defaultPasswordPolicy, mfaLambdaRole] must have values
CREATE_FAILED myApi AWS::CloudFormation::Stack Sat May 18 2019 23:13:31 GMT-0700 (Pacific Daylight Time) Parameters: [S3DeploymentBucket, S3DeploymentRootKey] must have values
Still getting this in v1.7.0 as well, I can see in my nested config that the values I need are there before running amplify push
or amplify publish
but then are removed as the process is running which causes the error
I believe this issue should be re-opened, although not on my behalf. Rather, for other people who are experiencing the issue.
unfortunately I have the same problem.
I have created a new VueJS project with GraphQL APi.
Amplify Version: 1.12.0
$ amplify push
UPDATE_ROLLBACK_IN_PROGRESS test-graphql-multi-prod-20190818144634 AWS::CloudFormation::Stack Sun Aug 18 2019 14:48:00 GMT+0200 (Mitteleuropäische Sommerzeit) The following resource(s) failed to create: [apitestGraphQLMulti].
CREATE_FAILED apitestGraphQLMulti AWS::CloudFormation::Stack Sun Aug 18 2019 14:47:59 GMT+0200 (Mitteleuropäische Sommerzeit) Parameters: [S3DeploymentBucket, S3DeploymentRootKey] must have values
For anyone running into this issue after attempting to update an API, check amplify/.config/local-env-info.json
to make sure the path is correct. I had moved my project and the path no longer was the right path.
Thanks a lot @dabit3 ! I had indeed renamed my project's directory. Such a tiny little change...
Thank you @dabit3 !
Thank you @dabit3 !
Thanks @dabit3 , very true!
I was getting exactly the same error and re-configuring amplify fixed the problem:
amplify configure project
What I noticed was that I had renamed my main project directory (git root) from amplifyagora to amplify-marketplace, however this hadn't changed the directory name in amplify/.config/local-env-info.json, so, the right parameters were not being sent to Cloudformation. Re-configuring amplify (which is harmless and asks only bunch of questions) solved it for me and my next amplify push created the S3 bucket successfully.
Most helpful comment
For anyone running into this issue after attempting to update an API, check
amplify/.config/local-env-info.json
to make sure the path is correct. I had moved my project and the path no longer was the right path.