amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

Amplify push shows "Error updating cloudformation stack" without specifying the error

Open BardiaN opened this issue 5 years ago • 18 comments

Describe the bug I have a stack on Amplify CLI and recently after updating to 4.38.X & 4.39.0, when I'm pushing directly or building it through Amplify Console, it shows these lines:

Updating resources in the cloud. This may take a few minutes...Error updating cloudformation stack
✔ All resources are updated in the cloud

Although it says that the build was successful, there are some errors and the backend environment doesn't get updated and since there's no error message, I have a really hard time finding the problem. I even tried --verbose but no luck, so I have to read through my whole backend-config and cloudformations and kind of guess my error.

Amplify CLI Version 4.38.X to 4.39.0

To Reproduce I'm not sure if it's happening to anyone else or not, but if your stack has some errors, it won't get updated since 4.38.X version, but you see the successful message. So you should check the last update date on Amplify Console Backend environment, if you're using it to make sure that your backend environment is really up to date.

Expected behavior It must shows errors like it used to!

Screenshots Amplify console log

Desktop (please complete the following information):

  • OS: Mac
  • Node Version: v14.15.0

Additional context I have already attached an screenshot of Amplify Console, the same thing happens when I push locally except the log is not disfigured like the picture.

BardiaN avatar Dec 11 '20 17:12 BardiaN

@BardiaN Can you try looking at where it's failing in the cloudformation console?

ammarkarachi avatar Dec 11 '20 22:12 ammarkarachi

I have the same issue, and there is no error in the Cloud Formation console. I just have the amplify root stack with no nested stack created at all.

maximelebastard avatar Dec 12 '20 19:12 maximelebastard

Don't know if this will help at all but I got same error and discovered if I run amplify build function before push my cloud formation error went away and I could see stuff happening in cloud formation log

arthurdaytonSlalom avatar Dec 12 '20 21:12 arthurdaytonSlalom

Having the same issue after updating to 4.39.0 Nothing showing up on Cloudformation to help debug what the problem is, no new events are being recorded by the console, so I guess Amplify is not reaching it when I push.

KIWI-JP avatar Dec 13 '20 05:12 KIWI-JP

Similar issue here. I just did amplify add function, then amplify function build then amplify push and received this error. From the cloudformation events nothing actually happened (no resources created, no activity at all with timestamps corresponding to the push). Verified the function doesn't exist in lambda.

But amplify status indicates it thinks it's in sync.

davegravy avatar Dec 13 '20 18:12 davegravy

I resolved this by using the default/suggested function name instead of the custom name I'd supplied which contained a hyphen.

davegravy avatar Dec 13 '20 21:12 davegravy

@davegravy I confirm I have some custom cloud formation templates which I renamed to mycategory-cloudformation-template.json. So it may be the cause as well for me

maximelebastard avatar Dec 13 '20 23:12 maximelebastard

@BardiaN Can you try looking at where it's failing in the cloudformation console?

Thanks for the comment @ammarkarachi. Yes, I have checked, there is no FAILED stack there, nested or root.

BardiaN avatar Dec 14 '20 11:12 BardiaN

Well, like everyone else here, I have also found my problem finally, but the question would be if it's Amplify problem or CloudFormation problem since we all can't find any FAILED stack there.

My problem was a bit complicated, I'll comment it here so it might help someone else:

  • So I have numerous APIs and Lambdas
  • Two of those lambdas were referencing each other's API on backend-config and their cloud-formation templates. (not each other directly, but the APIs connected to them)
  • It causes a circular dependency eventually, but no error message whatsoever.
  • I changed my design and overcame this problem but it was an actual headache to find it.

BardiaN avatar Dec 14 '20 11:12 BardiaN

Pretty sure this is an AmplifyCLI issue. Even though the CLI standard output was silent on the issue, I found the following in amplify/logs/:

2020-12-13T17:38:32.414Z|error : amplify-provider-awscloudformation.push-resources.updateCloudFormationNestedStack(["/home/davidg/xxxxxxxxxx/amplify/b$ValidationError: Template format error: Resource name function xxxxxxxxxx-xxx-xxxxxxxx is non alphanumeric.

davegravy avatar Dec 14 '20 14:12 davegravy

Pretty sure this is an AmplifyCLI issue. Even though the CLI standard output was silent on the issue, I found the following in amplify/logs/:

2020-12-13T17:38:32.414Z|error : amplify-provider-awscloudformation.push-resources.updateCloudFormationNestedStack(["/home/davidg/xxxxxxxxxx/amplify/b$ValidationError: Template format error: Resource name function xxxxxxxxxx-xxx-xxxxxxxx is non alphanumeric.

Where did you find that directory with logs?

Nxtra avatar Dec 14 '20 16:12 Nxtra

The same problem with creating policy.

stleon avatar Dec 14 '20 18:12 stleon

Pretty sure this is an AmplifyCLI issue. Even though the CLI standard output was silent on the issue, I found the following in amplify/logs/:

2020-12-13T17:38:32.414Z|error : amplify-provider-awscloudformation.push-resources.updateCloudFormationNestedStack(["/home/davidg/xxxxxxxxxx/amplify/b$ValidationError: Template format error: Resource name function xxxxxxxxxx-xxx-xxxxxxxx is non alphanumeric.

Where did you find that directory with logs?

my-project-root/amplify/logs

FYI I'm on v4.39.0

davegravy avatar Dec 14 '20 18:12 davegravy

Pretty sure this is an AmplifyCLI issue. Even though the CLI standard output was silent on the issue, I found the following in amplify/logs/:

2020-12-13T17:38:32.414Z|error : amplify-provider-awscloudformation.push-resources.updateCloudFormationNestedStack(["/home/davidg/xxxxxxxxxx/amplify/b$ValidationError: Template format error: Resource name function xxxxxxxxxx-xxx-xxxxxxxx is non alphanumeric.

Where did you find that directory with logs?

my-project-root/amplify/logs

FYI I'm on v4.39.0

It saved the log first time I ran it with --verbose but after that, the same thing happened with another resource and no log this time.

BardiaN avatar Dec 15 '20 13:12 BardiaN

Interesting. I have never run with verbose. That said there is definitely not a log entry for every amplify push I've done. Unclear what is the logic used to write logs.

Get Outlook for Androidhttps://aka.ms/ghei36


From: Bardia Navvabian [email protected] Sent: Tuesday, December 15, 2020 8:50:39 AM To: aws-amplify/amplify-cli [email protected] Cc: David Grant [email protected]; Mention [email protected] Subject: Re: [aws-amplify/amplify-cli] Amplify push shows "Error updating cloudformation stack" without specifying the error (#6155)

Pretty sure this is an AmplifyCLI issue. Even though the CLI standard output was silent on the issue, I found the following in amplify/logs/:

2020-12-13T17:38:32.414Z|error : amplify-provider-awscloudformation.push-resources.updateCloudFormationNestedStack(["/home/davidg/xxxxxxxxxx/amplify/b$ValidationError: Template format error: Resource name function xxxxxxxxxx-xxx-xxxxxxxx is non alphanumeric.

Where did you find that directory with logs?

my-project-root/amplify/logs

FYI I'm on v4.39.0

It saved the log first time I ran it with --verbose but after that, the same thing happened with another resource and no log this time.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/aws-amplify/amplify-cli/issues/6155#issuecomment-745298117, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AETG67NI4QB7T55WALZJSQLSU5SS7ANCNFSM4UXADQ2Q.

davegravy avatar Dec 15 '20 13:12 davegravy

Pretty sure this is an AmplifyCLI issue. Even though the CLI standard output was silent on the issue, I found the following in amplify/logs/:

2020-12-13T17:38:32.414Z|error : amplify-provider-awscloudformation.push-resources.updateCloudFormationNestedStack(["/home/davidg/xxxxxxxxxx/amplify/b$ValidationError: Template format error: Resource name function xxxxxxxxxx-xxx-xxxxxxxx is non alphanumeric.

Where did you find that directory with logs?

I have not got this directory too

stleon avatar Dec 16 '20 17:12 stleon

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 18 '21 07:01 stale[bot]

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

github-actions[bot] avatar May 25 '21 05:05 github-actions[bot]