Describe the bug
Setting up amplify on new project. Amplify init went well. Then did amplify add auth and amplify add hosting, then amplify publish. The publish failed.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Cognito and hosting setup and app runs.
Desktop (please complete the following information):
Additional context
Default region is ca-central-1 if that helps.
See screenshot above, and here's text version:
$ amplify publish
| Category | Resource name | Operation | Provider plugin |
| -------- | ----------------------- | --------- | ----------------- |
| Auth | amplifycognito | Create | awscloudformation |
| Hosting | S3AndCloudFront | Create | awscloudformation |
? Are you sure you want to continue? true
⠸ Updating resources in the cloud. This may take a few minutes...
UPDATE_IN_PROGRESS frontend-20180922133200 AWS::CloudFormation::Stack Sat Sep 22 2018 13:55:55 GMT-0600 (Mountain Daylight Time) User Initiated
CREATE_IN_PROGRESS hostingS3AndCloudFront AWS::CloudFormation::Stack Sat Sep 22 2018 13:55:59 GMT-0600 (Mountain Daylight Time)
CREATE_IN_PROGRESS authamplifycognito AWS::CloudFormation::Stack Sat Sep 22 2018 13:55:59 GMT-0600 (Mountain Daylight Time)
CREATE_IN_PROGRESS hostingS3AndCloudFront AWS::CloudFormation::Stack Sat Sep 22 2018 13:56:00 GMT-0600 (Mountain Daylight Time) Resource creation Initiated
CREATE_FAILED authamplifycognito AWS::CloudFormation::Stack Sat Sep 22 2018 13:56:00 GMT-0600 (Mountain Daylight Time) Template format error: Unrecognized resource types: [AWS::Cognito::UserPool, AWS::Cognito::IdentityPoolRoleAttachment, AWS::Cognito::UserPoolClient, AWS::Cognito::IdentityPool]
CREATE_FAILED hostingS3AndCloudFront AWS::CloudFormation::Stack Sat Sep 22 2018 13:56:00 GMT-0600 (Mountain Daylight Time) Resource creation cancelled
UPDATE_ROLLBACK_IN_PROGRESS frontend-20180922133200 AWS::CloudFormation::Stack Sat Sep 22 2018 13:56:01 GMT-0600 (Mountain Daylight Time) The following resource(s) failed to create: [hostingS3AndCloudFront, authcsiamplifycognito].
UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESSefrontend-20180922133200 AWS::CloudFormation::Stack Sat Sep 22 2018 13:56:03 GMT-0600 (Mountain Daylight Time)
DELETE_IN_PROGRESS hostingS3AndCloudFront AWS::CloudFormation::Stack Sat Sep 22 2018 13:56:04 GMT-0600 (Mountain Daylight Time)
⠏ Updating resources in the cloud. This may take a few minutes...
CREATE_IN_PROGRESS frontend-20180922133200-hostingS3AndCloudFront-37AZP5DDFNZ7 AWS::CloudFormation::Stack Sat Sep 22 2018 13:56:00 GMT-0600 (Mountain Daylight Time) User Initiated
CREATE_IN_PROGRESS S3Bucket AWS::S3::Bucket Sat Sep 22 2018 13:56:02 GMT-0600 (Mountain Daylight Time)
CREATE_IN_PROGRESS S3Bucket AWS::S3::Bucket Sat Sep 22 2018 13:56:03 GMT-0600 (Mountain Daylight Time) Resource creation Initiated
DELETE_IN_PROGRESS frontend-20180922133200-hostingS3AndCloudFront-37AZP5DDFNZ7 AWS::CloudFormation::Stack Sat Sep 22 2018 13:56:05 GMT-0600 (Mountain Daylight Time) User Initiated
CREATE_FAILED S3Bucket AWS::S3::Bucket Sat Sep 22 2018 13:56:05 GMT-0600 (Mountain Daylight Time) Resource creation cancelled
⠏ Updating resources in the cloud. This may take a few minutes...
DELETE_COMPLETE authamplifycognito AWS::CloudFormation::Stack Sat Sep 22 2018 13:56:07 GMT-0600 (Mountain Daylight Time)
⠙ Updating resources in the cloud. This may take a few minutes...
DELETE_SKIPPED S3Bucket AWS::S3::Bucket Sat Sep 22 2018 13:56:26 GMT-0600 (Mountain Daylight Time)
DELETE_COMPLETE frontend-20180922133200-hostingS3AndCloudFront-37AZP5DDFNZ7 AWS::CloudFormation::Stack Sat Sep 22 2018 13:56:27 GMT-0600 (Mountain Daylight Time)
⠹ Updating resources in the cloud. This may take a few minutes...
DELETE_COMPLETE hostingS3AndCloudFront AWS::CloudFormation::Stack Sat Sep 22 2018 13:56:39 GMT-0600 (Mountain Daylight Time)
UPDATE_ROLLBACK_COMPLETE frontend-20180922133200 AWS::CloudFormation::Stack Sat Sep 22 2018 13:56:39 GMT-0600 (Mountain Daylight Time)
⠧ Updating resources in the cloud. This may take a few minutes...Error updating cloudformation stack
✖ An error occurred when pushing the resources to the cloud
Resource is not in the state stackUpdateComplete
> [email protected] build /Users/hisham/src/dry-eye-frontend
> ng build --prod
Date: 2018-09-22T19:57:28.412Z
Hash: 36e9dc638b4af6f83439
Time: 26836ms
chunk {scripts} scripts.fac25701f9a4563f3d54.js (scripts) 461 kB [rendered]
chunk {0} runtime.a66f828dca56eeb90e02.js (runtime) 1.05 kB [entry] [rendered]
chunk {1} styles.59aec90edeadc2d31877.css (styles) 187 kB [initial] [rendered]
chunk {2} polyfills.c9a5fed38d6e21c1ef81.js (polyfills) 63.6 kB [initial] [rendered]
chunk {3} main.483f39f85700e2536834.js (main) 3.77 MB [initial] [rendered]
WARNING in Circular dependency detected:
src/app/shared/symptoms/method-symptom-control/method-symptom-control.component.ngfactory.js -> src/app/shared/symptoms/symptom-control-adapter/symptom-control-adapter.component.ngfactory.js -> src/app/shared/symptoms/method-symptom-control/method-symptom-control.component.ngfactory.js
WARNING in Circular dependency detected:
src/app/shared/symptoms/symptom-control-adapter/symptom-control-adapter.component.ngfactory.js -> src/app/shared/symptoms/method-symptom-control/method-symptom-control.component.ngfactory.js -> src/app/shared/symptoms/symptom-control-adapter/symptom-control-adapter.component.ngfactory.js
frontend build command exited with code 0
✖ Error has occured during publish.
2018-09-22T19:57:28.534Z - error: uncaughtException: Cannot read property 'HostingBucketName' of undefined date=Sat Sep 22 2018 13:57:28 GMT-0600 (Mountain Daylight Time), pid=27948, uid=501, gid=20, cwd=/Users/hisham/src/dry-eye-frontend, execPath=/Users/hisham/.nvm/versions/node/v10.9.0/bin/node, version=v10.9.0, argv=[/Users/hisham/.nvm/versions/node/v10.9.0/bin/node, /Users/hisham/.nvm/versions/node/v10.9.0/bin/amplify, publish], rss=97132544, heapTotal=66342912, heapUsed=58367640, external=773113, loadavg=[2.25244140625, 1.900390625, 1.93212890625], uptime=362287, trace=[column=66, file=/Users/hisham/.nvm/versions/node/v10.9.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-hosting/lib/S3AndCloudFront/helpers/file-uploader.js, function=getHostingBucketName, line=37, method=null, native=false, column=29, file=/Users/hisham/.nvm/versions/node/v10.9.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-hosting/lib/S3AndCloudFront/helpers/file-uploader.js, function=Object.run, line=13, method=run, native=false, column=7, file=internal/process/next_tick.js, function=process._tickCallback, line=68, method=_tickCallback, native=false], stack=[TypeError: Cannot read property 'HostingBucketName' of undefined, at getHostingBucketName (/Users/hisham/.nvm/versions/node/v10.9.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-hosting/lib/S3AndCloudFront/helpers/file-uploader.js:37:66), at Object.run (/Users/hisham/.nvm/versions/node/v10.9.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-hosting/lib/S3AndCloudFront/helpers/file-uploader.js:13:29), at process._tickCallback (internal/process/next_tick.js:68:7)]
Is it because Auth is not available in ca-central-1? Shouldn't it then give me an alternative?
Maybe needs a fix like this but for cognito: https://github.com/aws-amplify/amplify-cli/pull/192
@hisham Curently we are supporting the following regions and pushing towards a region specific stack for the CloudFormation deployments.
'us-east-1': 'US East (N. Virginia)',
'us-east-2': 'US East (Ohio)',
'us-west-2': 'US West (Oregon)',
'eu-west-1': 'EU (Ireland)',
'eu-central-1': 'EU (Frankfurt)',
'ap-northeast-1': 'Asia Pacific (Tokyo)',
'ap-southeast-1': 'Asia Pacific (Singapore)',
'ap-southeast-2': 'Asia Pacific (Sydney)',
'ap-south-1': 'Asia Pacific (Mumbai)',
Ok I will switch to us-east-1 for now but this means I will only use
amplify cli to setup auth since I prefer to use ca-central-1 for the other
services that are available there (such as data store and hosting). This
means I have to set these service up manually or use aws cdk or similar.
Would be great if you can create feature request for region specific
stacks. That would be very helpful as ideally I’d like to use the amplify
cli to manage everything...
On Sat, Sep 22, 2018 at 4:23 PM Kaustav Ghosh notifications@github.com
wrote:
@hisham https://github.com/hisham Curently we are supporting the
following regions.l and pushing towards a region specific stack for the
CloudFormation deployments.'us-east-1': 'US East (N. Virginia)',
'us-east-2': 'US East (Ohio)',
'us-west-2': 'US West (Oregon)',
'eu-west-1': 'EU (Ireland)',
'eu-central-1': 'EU (Frankfurt)',
'ap-northeast-1': 'Asia Pacific (Tokyo)',
'ap-southeast-1': 'Asia Pacific (Singapore)',
'ap-southeast-2': 'Asia Pacific (Sydney)',
'ap-south-1': 'Asia Pacific (Mumbai)',—
You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub
https://github.com/aws-amplify/amplify-cli/issues/194#issuecomment-423777612,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAE_vWF-gHrF3u4jqyaZm8gDsRC9185Qks5udrhngaJpZM4W1a7-
.
I have the same issue with eu-central-1
Having same issue in us-east-1, I'm guessing it is not entirely related to region.
Error: Cannot read property 'HostingBucketName' of undefined, at getHostingBucketName (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-hosting/lib/S3AndCloudFront/helpers/file-uploader.js:37:66), at Object.run (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-hosting/lib/S3AndCloudFront/helpers/file-uploader.js:13:29), at process._tickCallback (internal/process/next_tick.js:68:7)]
seems that context is not getting passed
mine seems to be working after removing hosting
I am having the same issue.
× Error has occured during publish.
2018-11-21T05:39:47.230Z - error: uncaughtException: Cannot read property 'HostingBucketName' of undefined
I'm having the same issue here:
error: uncaughtException: Cannot read property 'HostingBucketName' of undefined date
No solution to this yet? I am having the same issue.
error: uncaughtException: Cannot read property 'HostingBucketName' of undefined date
@hisham root cause may be the below. check your permissions for creating a S3 bucket.
The following resource(s) failed to create: [hostingS3AndCloudFront, authcsidryeyeamplifycognito].
And amplify try to make 'public' bucket. In my case, the same error was occurred by an error of updating ACL of CFn with preventing public ACL setting of S3.
@kempei after switching aws profile to us-east-1 (an amplify supported region), everything worked fine, so this I believe was an issue from me attempting to use amplify-cli in a non-supported region (ca-central-1)
@amlcodes This issue comes up when you abrupt the amplify hosting add flow. You can delete the amplify/backend/hosting directory and run amplify hosting add command once again and then amplify publish.
@leonjorge23 @ooooak @stevethecollier This usually occurs when your Cloudformation tempalte fails to push. The cloudformation stacktrace would be helpful for us to debug.
I had this issue error: uncaughtException: Cannot read property 'HostingBucketName' of undefined date when I am init a react project using creare-react-app. I was initially set the out dir to public/ (which is build/ by default). After restart amplify init and the change to build/, the problem solved. I hope this can help you.