Amplify push fails after adding a function #13760
Labels
functions
Issues tied to the functions category
pending-response
Issue is pending response from the issue author
pending-triage
Issue is pending triage
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v21.7.3
Amplify CLI Version
11.0.5
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No
Describe the bug
So I added with amplify add function a new lambda function. Added in package.json the "type":"module".
And wrote my function. Then added custom policies to the table and wanted to push the changes, and amplify fails with this error:
This function is the new created one.
In aws.console:
Embedded stack arn:aws:cloudformation:eu-north-1:816334333069:stack/amplify-newapp-dev-c053d-functionacceptOrgFollowing-3DQVL14IIR53/2cb22be0-08bb-11ef-887e-0a25218daa9a5 was not successfully created: The following resource(s) failed to create: [LambdaFunction].
02/05/2024, 21:40:34 | amplify-newapp-dev-c053d | UPDATE_ROLLBACK_COMPLETE | Failed(X)
02/05/2024, 21:40:33 | authnewapp248a1258 (auth) | UPDATE_COMPLETE | -
02/05/2024, 21:40:33 | apinewapp (api) | UPDATE_COMPLETE | -
02/05/2024, 21:38:47 | functionnewapp768a1253PostConfirmation (function) | UPDATE_COMPLETE | -
02/05/2024, 21:38:47 | functioncreateOrgAndEverything (function) | UPDATE_COMPLETE | -
02/05/2024, 21:38:36 | storagenewapp (storage) | UPDATE_COMPLETE | -
02/05/2024, 21:38:35 | amplify-newapp-dev-c053d | UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS
Until this error message below it takes like over 30 minutes until it appears . I don't think this is normal.
Rolled back (6 of 5)
🛑 ["Index: 4 State: {"deploy":"waitingForDeployment"} Message: Resource is not in the state stackUpdateComplete"]
Then I tried to add a new env and tried to push it, and it worked. WHY?
Honestly it's kinda annoying, It really stops me in my development.
Please solve this issue.
Maybe if I did something wrong then every hint is really appreciated.
Expected behavior
Should work after adding Lambda functions
Reproduction steps
amplify add function
amplify update function
Resource access permission
storage
amplify push
Project Identifier
ebfc1cb67b3e849d27a343745c7d5874
Log output
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: