aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.81k stars 820 forks source link

Error updating auth to migrate resources to the latest amplify version #12784

Closed ZalgirisKaunas closed 10 months ago

ZalgirisKaunas commented 1 year ago

Amplify CLI Version

12.0.3

Question

Couldn't push new API endpoint via cli because error: "Auth triggers have been configured using an older version of the CLI and must be migrated before they can be deployed."

I then tried to do auth update but after that I still couldn't push the code and was getting Error updating the Cognito trigger: The "path" argument must be of type string. Received undefined.

not sure what should I do next

ykethan commented 1 year ago

Hey @ZalgirisKaunas, thank you for reaching out.The issue appears to have a similar message as https://github.com/aws-amplify/amplify-cli/issues/12433. Could you provide us some additional information on the version of Amplify CLI that was utilized before? Could you provide us some minimal steps that would assist us in reproducing this behaviour. Additionally, could you let us know the current amplify status output.

ZalgirisKaunas commented 1 year ago

The first time I created that API resource my aws-amplify version was 3.3.3, I'm not sure about cli version because I updated it several times after that and because of that I'm not sure how to reproduce the issue.

My amplify status:

image image

one auth resource is for my userpool and another for user pool groups

ZalgirisKaunas commented 1 year ago

I pulled the restored environment so I continue where I left it without that new endpoint. but I still get � Auth triggers have been configured using an older version of the CLI and must be migrated before they can be deployed.
Even when I do changes to resources that worked fine just a few days ago.

I'm wondering would it work if i remove auth triggers via console or in cloudformation

ykethan commented 1 year ago

Hey @ZalgirisKaunas, It is currently not recommended to modify Amplify managed resources in the AWS console as this may cause a drift between the resource. Expected if the auth resource was imported into the project.

Could you try running amplify update auth, select Walkthrough all the auth configurations and run through the flow while keeping the previous changes such as the auth triggers previously added. Could you then run amplify push --debug and let us know if the auth resource throws an error.

thathypeapp commented 1 year ago

Hi having trouble with this also but don't quite understand the issue. Its been a while since I've touched my amplify app (2022). I tried to make some changes today but I'm running into an issue where the CLI says I have to upgrade the auth. When I try to update it, it removes a bunch of files and then on amplify push, I get this error in my stack. Existing schema attributes cannot be modified or deleted. (Service: AWSCognitoIdentityProvider; Status Code: 400; Error Code: InvalidParameterException; Request ID: null; Proxy: null)

g33kracc00n commented 1 year ago

hello I have the same issue, I had Amplify CLI version 7.6.15 with node version of 12

I upgraded to node 16, but I had errors while pushing regarding the function UpdateRolesWithIDPFunction because the node version was persistent on 12.

so I read in on the related issues that I need to upgrade my amplify cli (to have a higher node version of UpdateRolesWithIDPFunction), therefore I updated amplify cli to 12.2.1 then, when running amplify push, I got the following error "Auth triggers have been configured using an older version of the CLI and must be migrated before they can be deployed"

I ran amplify auth update, and went through "Walkthrough all the auth configurations" and "Apply default configuration with Social Provider (Federation)" options, and for both them, after finishing the steps I'm getting the following error "Error updating the Cognito trigger: The "path" argument must be of type string. Received undefined"

g33kracc00n commented 1 year ago

And when pushing to the cloud I get this error as well Existing schema attributes cannot be modified or deleted. (Service: AWSCognitoIdentityProvider; Status Code: 400; Error Code: InvalidParameterException;

josefaidt commented 1 year ago

Hey @g33kracc00n @thathypeapp please be sure to port modifications to user attributes (i.e. custom attributes) by using auth overrides after migrating the resource with amplify update auth

josefaidt commented 11 months ago

Hey @g33kracc00n @thathypeapp just wanted to follow-up here and see if you're still experiencing this?

g33kracc00n commented 11 months ago

@josefaidt Hey, I tried the auth overrides but it didn't work I had to create new environment and migrate everything manually

ZalgirisKaunas commented 10 months ago

I fixed my issues manually in the cloudformation templates via console

ykethan commented 10 months ago

thank you for the confirmation, glad to hear that you were able to mitigate the issue.
Closing the GitHub issue. Please feel free in reaching out to us again.

github-actions[bot] commented 10 months ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.