Amplify push shows "Error updating cloudformation stack" without specifying the error
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

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 Can you try looking at where it's failing in the cloudformation console?
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.
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
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.
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.
I resolved this by using the default/suggested function name instead of the custom name I'd supplied which contained a hyphen.
@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
@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.
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-configand 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.
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.
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?
The same problem with creating policy.
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
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/logsFYI 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.
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.
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
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.
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.