If I try to deploy an API stack with an invalid project name, the deploy should error and tell me to choose another, valid, name.
The deploy hangs at this step instead:
webiny:filesBucket Deploying bucket '07October2020B-tinynews-contentapi-prod' in region 'us-east-1' +0ms
webiny:filesBucket Checking if bucket 07October2020B-tinynews-contentapi-prod exists. +12ms
webiny:filesBucket Bucket 07October2020B-tinynews-contentapi-prod does not exist. Creating... +1s
webiny:filesBucket Setting CORS for bucket '07October2020B-tinynews-contentapi-prod' +1s
508s › Deploying...
S3_BUCKET name to something with a capital letter like my example above api/.env.jsonyarn webiny deploy api --env=prodIt looks like the bucket never gets created. I finally figured out that AWS doesn't let you create a bucket with a capital letter by trying to create it in the management console. (AWS error: Bucket name must not contain uppercase characters)
See code here: https://github.com/webiny/webiny-js/blob/fc87f378f4ecfc343de5e6a2feaef634006a5091/packages/serverless-aws-s3/utils.js#L44-L50
So, this turned out to be an error on my part for sure. However, I would have expected the deploy to fail and pass on the error message from AWS instead of hanging. I'm not sure what error if any is returned by await s3.createBucket({ Bucket: name }).promise(); so perhaps the answer is somewhere in that aws call?
Thanks! I'm on the webiny slack and happy to elaborate on this if necessary.
Thanks @jacqui, will check this for the next week's release.
Feel free to take a look @ng29, if you need any help, let us know.
Let us know if you need any help @ng29.
Thanks!
Let us know if you need any help @ng29.
Thanks!
hiya @doitadrian I didn't get much time to look into it, but some starter points will be very appreciated.(Possible root cause)
Cheers
Hi @ng29, you can put a check here (above the debug("Checking if...): https://github.com/webiny/webiny-js/blob/fc87f378f4ecfc343de5e6a2feaef634006a5091/packages/serverless-aws-s3/utils.js#L41
So, if the name of the S3 bucket starts with an upper case, just throw an error with an appropriate error message.
Let's see if that will work.
You can also add your own debug message before doing the actual check, for example: debug("Checking the bucket name...").
Hi @ng29, you can put a check here (above the
debug("Checking if...):So, if the name of the S3 bucket starts with an upper case, just throw an error with an appropriate error message.
Let's see if that will work.
You can also add your own
debugmessage before doing the actual check, for example:debug("Checking the bucket name...").
Thanks a lot, @doitadrian for these pointers, really helpful .. Will cook this up today
(Just a heads up, may ping you on slack if more queries)
Cheers