Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with auth migration #13093

Closed
2 tasks done
dan-hook opened this issue Aug 8, 2023 · 5 comments
Closed
2 tasks done

Problem with auth migration #13093

dan-hook opened this issue Aug 8, 2023 · 5 comments
Labels
auth Issues tied to the auth category of the CLI migration-issue Issues tied to migration of the project between major CLI versions pending-triage Issue is pending triage

Comments

@dan-hook
Copy link

dan-hook commented Aug 8, 2023

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

18.17.0

Amplify CLI Version

12.2.3

What operating system are you using?

Ubuntu (on WSL2)

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No manual changes made, to the best of my knowledge.

Describe the bug

I have an amplify environment that was last deployed with amplify 7.6.19
When I run amplify push, I get:
"Auth triggers have been configured using an older version of the CLI and must be migrated before they can be deployed"
Then running amplify update auth I eventually get "Error updating the Cognito trigger: The "path" argument must be of type string. Received undefined"

The user pool does have a post confirmation trigger.

vscode ➜ /workspaces/gene-panel-api/project (sandbox)(1.3vanilla ✗) $ amplify update auth
Please note that certain attributes may not be overwritten if you choose to use defaults settings.

You have configured resources that might depend on this Cognito resource. Updating this Cognito resource could have unintended side effects.

Using service: Cognito, provided by: awscloudformation
What do you want to do? Walkthrough all the auth configurations
Select the authentication/authorization services that you want to use: User Sign-Up, Sign-In, connected with AWS IAM controls (Enables per-user Storage features for images or other content, Analytics, and more)
Allow unauthenticated logins? (Provides scoped down permissions that you can control via AWS IAM) No
Do you want to enable 3rd party authentication providers in your identity pool? No
Do you want to add User Pool Groups? No
Do you want to add an admin queries API? No
Multifactor authentication (MFA) user login options: OFF
Email based user registration/forgot password: Enabled (Requires per-user email entry at registration)
Specify an email verification subject: Your verification code
Specify an email verification message: Your verification code is {####}
Do you want to override the default password policy for this User Pool? No
Specify the app's refresh token expiration period (in days): 30
Do you want to specify the user attributes this app can read and write? No
Do you want to enable any of the following capabilities?
Do you want to use an OAuth flow? No
? Do you want to configure Lambda Triggers for Cognito? Yes
? Which triggers do you want to enable for Cognito Post Confirmation
? What functionality do you want to use for Post Confirmation Create your own module
Error updating the Cognito trigger: The "path" argument must be of type string. Received undefined

Expected behavior

I'm hoping to successfully migrate the auth trigger to the current version of the CLI.

Reproduction steps

  1. I'm not sure how to reproduce this. If I had to, I would create an auth resource with 7.6.19
  2. add a post confirmation trigger
  3. upgrade to 12.2.3
  4. run amplify update auth

Project Identifier

c37455c75a0b236cc110a2f4c2509776

Log output

# Put your logs below this line


Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@dan-hook dan-hook added the pending-triage Issue is pending triage label Aug 8, 2023
@josefaidt
Copy link
Contributor

Hey @dan-hook 👋 thanks for raising this! As we begin to look at this in more depth would you mind running the same command with --debug and paste the stack trace here?

@ykethan ykethan added auth Issues tied to the auth category of the CLI migration-issue Issues tied to migration of the project between major CLI versions pending-response Issue is pending response from the issue author labels Aug 9, 2023
@dan-hook
Copy link
Author

dan-hook commented Aug 20, 2023

It didn't display a stack trace:
vscode ➜ /workspaces/gene-panel-api/project (sbxc)(v1.4upgrade ✗) $ amplify update auth --debug
Please note that certain attributes may not be overwritten if you choose to use defaults settings.

You have configured resources that might depend on this Cognito resource. Updating this Cognito resource could have unintended side effects.

cli-inputs.json doesn't exist

A migration is needed to support latest updates on auth resources.
Recommended to try in a non-production environment first. Run "amplify env add" to create or clone an environment.
Custom CloudFormation changes will NOT be preserved. Custom changes can be made with "amplify auth override" after migration.
Learn more about this migration: https://docs.amplify.aws/cli/migration/override
Do you want to migrate auth resource "genepanelapi8323d4d5"? (Y/n) · yes
Starting Migration Process
Migration is Successful
Using service: Cognito, provided by: awscloudformation
What do you want to do? Walkthrough all the auth configurations
Select the authentication/authorization services that you want to use: User Sign-Up, Sign-In, connected with AWS IAM controls (Enables per-user Storage features for images or other content, Analytics, and more)
Allow unauthenticated logins? (Provides scoped down permissions that you can control via AWS IAM) No
Do you want to enable 3rd party authentication providers in your identity pool? No
Do you want to add User Pool Groups? No
Do you want to add an admin queries API? No
Multifactor authentication (MFA) user login options: OFF
Email based user registration/forgot password: Enabled (Requires per-user email entry at registration)
Specify an email verification subject: Your verification code
Specify an email verification message: Your verification code is {####}
Do you want to override the default password policy for this User Pool? No
Specify the app's refresh token expiration period (in days): 30
Do you want to specify the user attributes this app can read and write? No
Do you want to enable any of the following capabilities?
Do you want to use an OAuth flow? No
? Do you want to configure Lambda Triggers for Cognito? No
Error updating the Cognito trigger: The "path" argument must be of type string. Received undefined

I get the same result if I choose:
? Do you want to configure Lambda Triggers for Cognito? Yes
? Which triggers do you want to enable for Cognito Post Confirmation
? What functionality do you want to use for Post Confirmation Create your own module
Error updating the Cognito trigger: The "path" argument must be of type string. Received undefined

Would it be worthwhile to try removing the trigger using amplify 7.6.19, then migrating without it, and adding it back using the latest amplify?

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Aug 20, 2023
@josefaidt
Copy link
Contributor

Hey @dan-hook it's interesting that did not print a stack trace. I'll work with the team to resolve that, but

Would it be worthwhile to try removing the trigger using amplify 7.6.19, then migrating without it, and adding it back using the latest amplify?

Yes, this would be the easiest path forward, however I'd like to take a look at what may be going wrong in the migration before you do so. Would you be open to sharing a zip archive of your amplify/ directory? (without sensitive information)

@josefaidt josefaidt added the pending-response Issue is pending response from the issue author label Aug 23, 2023
@dan-hook
Copy link
Author

Removing the trigger and then re-adding worked. There probably won't be that many users going from version 7 to 12. Thanks for your time.

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Aug 23, 2023
@github-actions
Copy link

⚠️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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Issues tied to the auth category of the CLI migration-issue Issues tied to migration of the project between major CLI versions pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

3 participants