#✅ - Amplify push ends with 'Done', but Deploying sits on: 0/n

29 messages · Page 1 of 1 (latest)

icy ginkgo
#

When I use amplify push, the logs goes: "Deploying function ... [ ----] 0/4" etc. , but then the next line says "Done" and nothing is updated. and there are no error logs.
I tried amplify pull and then push again with same result.
amplify --version: 12.12.2, aws --version: aws-cli/2.16.7 Python/3.11.8 Darwin/23.3.0 exe/x86_64
Please help.
Thanks

arctic plover
#

do see the updated code on Lambda console?
try adding --debug to the push command?
if the function is small the deploying may not show 4/4 the indicator would be the complete/done which indicated the uploaded state

icy ginkgo
#

Hi thanks for helping, the debug message is showing me this: Stack is in UPDATE_ROLLBACK_FAILED state and can not be updated. There is a message in CloudFormation about the auth: The following resource(s) failed to update: [HostedUIProvidersCustomResource, HostedUICustomResource]. Those are 2 lambda functions, must be system functions I didn't write them.

icy ginkgo
#

sigh Now nothing works. I can't add new storage/tables. I can't edit my app the amplify thing just wont come right. I get messages like " Auth triggers have been configured using an older version of the CLI and must be migrated before they can be deployed." and then executing: "amplify auth update" and then use " Apply default configuration with Social Provider (Federation) " and trying to push then I get "Overrides functionality is not implemented for this category" probably because I changed "Runtime": "nodejs12.x" to 18 because I got messages about 12 not being supported anymore and there is no other way for me to change this - so I changed the values in the "...function-cloudformation-template.json" files. and I also changed the functions runtime versions in the lambda console. And not sure where to go from here.

arctic plover
# icy ginkgo ***sigh*** Now nothing works. I can't add new storage/tables. I can't edit my ap...

hey you can ignore the Overrides functionality is not implemented for this category it only gets outputed on the debug, it refers to the amplify override <category> which is not supported on functions. but looking at the stack status it appears cloudforamtion failed, you will need to rollback on the cloudformation console, then update the function cloudforamtion templates locally and do run amplify update auth to update the auth inline functions as well, then run push

icy ginkgo
#

I kept getting UPDATE_ROLLBACK_FAILED in console, even if I skip the auth rollback. the auth stack issues showed Status Reason of: "The following resource(s) failed to update: [HostedUIProvidersCustomResource, HostedUICustomResource]." so I tried rollback excluding auth, which still failed, then I tried rollback just excluding these: "[HostedUIProvidersCustomResource, HostedUICustomResource]" and console is now showing this red message: X UPDATE_ROLLBACK_COMPLETE

icy ginkgo
#

And back in the IDE, amplify env checkout dev --restore, then updated auth and pushed again. previous issues are gone, but now I have issues with : The following resources failed to deploy: Resource Name: UserPoolClient (AWS::Cognito::UserPoolClient) Event Type: update Reason: Resource handler returned message: "User pool client does not exist. (Service: CognitoIdentityProvider, Status Code: 400, Request ID: UUID)" (RequestToken: UUID, HandlerErrorCode: NotFound) I think I changed the app clients way back when... how do I go about updating the amplify configs to point to the current existing clients? I recall it was always a hassle in the past I've always had to change the client id and secrets values in the generated "amplifyconfiguration.json" and "awsconfiguration.json" files after pull/push/builds etc.

icy ginkgo
#

Do I need to go into the s3 bucket and update all the ClientId info to the currently existing app clients? I tried doing this inside Android studio before I pushed, but still got the clients don't exist errors.

icy ginkgo
#

@arctic plover, I appreciate your support, any suggestions with the rest of troubles I am experiencing?

arctic plover
#

hey @icy ginkgo , apologies on the delay. Is this a dev environment?
is the userpool client deleted on the console by any chance?
are you able to run amplify update auth -> reselect the prompts and run push. does this still occur?

icy ginkgo
#

Hi thanks for getting back to me :).
"are you able to run amplify update auth -> reselect the prompts and run push. does this still occur?" yes, it still fails after going through the prompts.
Yes, this is the dev environment. The app clients have been deleted (years ago) and new ones are being used.
It looks like the results from ' amplify env checkout dev --restore' gives me auth client names that I can only find in my prod user pool in the console. Or maybe it's files I'm looking at that are not brought down from the pull and exists only in android studio and doesn't get updated when I pull ? idk?
How do I clean the project files in android studio and get the amplify files back in the project?

arctic plover
#

hey you may have to switch the environment to dev. you can pull the dev environment using the pull command amplify pull --appId app-id --envName dev
But the main problem here the is clients, Amplify ties the client id's on CloudFormation, if the clients are deleted manually on the Console this introduces a drift on CloudFormation. Unfortunately, we cannot recreate the clients or tie newly created clients to the auth template without recreating the user pool auth resource
https://github.com/aws-amplify/amplify-cli/issues/10871 : currently being tracked on this issue.

GitHub

Is this feature request related to a new or existing Amplify category? auth Is this related to another service? No response Describe the feature you'd like to request When creating a new Amplif...

icy ginkgo
icy ginkgo
#

In Android studio i started a new project then did amplify pull, then went to my app in my region and got dev, and got this error:
There was an error initializing your environment.
🛑 Failed to download the following parameters from ParameterStore:
/amplify/xxxxx/dev/AMPLIFY_function_myappPostConfirmation_GROUP

arctic plover
#

thats odd, could you check the parameter store in System manager on console to check if this parameter exists.
https://docs.amplify.aws/gen1/react/tools/cli/reference/ssm-parameter-store/

icy ginkgo
icy ginkgo
#

@arctic plover I'm not sure what to do here. everything seems broken. How can I continue working on this app? What are my options? I need to be able to add storage and functions to the app and not lose my users accounts or data in dynamodb or s3 when moving things to prod env.

arctic plover
#

@icy ginkgo do ensure you are in the correct region when checking the parameters. If the parameter does not exist, after the pull fails could you run amplify env checkout <existing-env-name> which should prompt you for the variable or you would need to either manually create the parameter similar to https://docs.amplify.aws/gen1/react/tools/cli/reference/ssm-parameter-store/ then pull the environment.

icy ginkgo
# arctic plover <@346162979336749067> do ensure you are in the correct region when checking the ...

@arctic plover There were no parameters in paramater-stores on any of the regions. I added a parameter in my apps region ap-southeast-2 but there is no say what the value of it should be so I added "" since it won't allow me to save it otherwise. and after i created the param, and pulled nothing changed in my existing project, and on the new android project on 'amplify pull' I still get the same message:✖ There was an error initializing your environment.
🛑 Failed to download the following parameters from ParameterStore:
/amplify/xxxxx/dev/AMPLIFY_function_myAppPostConfirmation_GROUP
does it need a particular value on the parameter? i don't know what this is.

arctic plover
#

@icy ginkgo this looks like a env variable post confirmation trigger on function that adds users to a group on cognito.Do ensure the path when recreating the paramter is the same and do add --debug to check if there may be additional information on the error message
if you head to the cognito resource and check the triggers the function should be attached to the resource

icy ginkgo
# arctic plover <@346162979336749067> this looks like a env variable post confirmation trigger o...

@arctic plover the --debug shows the AWS access keys used to execute amplify cli cmds is not authorized: AccessDeniedException: User: arnawsiam::xxxxxxx:user/xxxxxx is not authorized to perform: ssm:GetParameters on resource: arnawsssm:ap-southeast-2:xxxxxx:parameter/amplify/xxxxxx/dev/AMPLIFY_function_myAppPostConfirmation_GROUP because no identity-based policy allows the ssm:GetParameters action

I added the role in iam and this error is at least gone now.

I still can't make changes because I get this when amplify push:
Resource is not in the state stackUpdateComplete
Name: UserPoolClient (AWS::Cognito::UserPoolClient), Event Type: update, Reason: Resource handler returned message: "User pool client does not exist. (Service: CognitoIdentityProvider, Status Code: 400, Request ID: UUID)” (RequestToken: UUID, HandlerErrorCode: NotFound), IsCustomResource: false

Name: UserPoolClientWeb (AWS::Cognito::UserPoolClient), Event Type: update, Reason: Resource handler returned message: "User pool client does not exist. (Service: CognitoIdentityProvider, Status Code: 400, Request ID: UUID)” (RequestToken: UUID, HandlerErrorCode: NotFound), IsCustomResource: false

icy ginkgo
#

How do I go about getting amplify to work for me again? I am not so worried about the dev branch. As long as I can start doing some work on my app. and of course not lose anything for my users in prod.

arctic plover
#

hey i see you were able to add the permission to allow the parameter.
For the client issue, if this if client was only deleted manually in dev environment and there are no users in the Cognito user pool, then you should be able to recreate the environment.
But if the client was manually removed in the prod env, unfortunately, we cannot recreate the client mappings. you will need to remove the auth resource and recreate it.

icy ginkgo
arctic plover
#

@icy ginkgo actually, you should not need to recreate the env, you should just be able to remove auth and re-add auth.
amplify remove auth and amplify add auth to recreate a new auth resource.
but for future precautions, I would not suggest making manual modification to the resources on console that are deployed by cloudformation
but if you need to have a fresh env, you can checkout to a different env using amplify env checkout <your other env> then add a new env using amplify add env <enc-name>. then run amplify push to create the new env resources. you can remove the old env using amplify env remove

icy ginkgo
arctic plover
#

Glad to hear you were able to resolve the issue. Do reach out if you need any assistance on a new thread.

fringe gullBOT
#

✅ - Amplify push ends with 'Done', but Deploying sits on: 0/n

#

Answer selected!

`amplify remove auth` and `amplify add auth` to recreate a new auth resource. 
but for future precautions, I would not suggest making manual modification to the resources on console that are deployed by cloudformation
but if you need to have a fresh env, you can checkout to a different env using `amplify env checkout <your other env>` then add a new env using `amplify add env <enc-name>`. then run `amplify push` to create the new env resources. you can remove the old env using `amplify env remove````
Kudos to @arctic plover!
[#1250696806472351795 message](/guild/705853757799399426/thread/1250696806472351795/p/1250696806472351795/#msg-1256074019023749130)