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

amplify add storage with an imported User Pool (no identity pool) errors with stack trace #13240

Open
2 tasks done
josefaidt opened this issue Sep 19, 2023 · 10 comments
Open
2 tasks done
Labels
auth Issues tied to the auth category of the CLI bug Something isn't working import Issues related to importing resources into an Amplify project p3 storage Issues tied to the storage category

Comments

@josefaidt
Copy link
Contributor

How did you install the Amplify CLI?

pnpm

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

20.x

Amplify CLI Version

12.4.0

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.

n/a

Describe the bug

➜  amplify add storage
? Select from one of the below mentioned services: Content (Images, audio, video, etc.)
✔ Provide a friendly name for your resource that will be used to label this category in the project: · s36fd2fba9

✔ Provide bucket name: · importauthwithstorag3c42c9878f8744c7a9c5be63582
✔ Who should have access: · Auth users only
✔ What kind of access do you want for Authenticated users? · create/update
✔ Do you want to add a Lambda Trigger for your S3 Bucket? (y/N) · no
🛑 The imported auth config is not compatible with the specified storage config
🛑 An error occurred when adding the storage resource
ConfigurationError: The imported auth config is not compatible with the specified storage config
    at checkStorageAuthenticationRequirements (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-storage/lib/provider-utils/awscloudformation/service-walkthroughs/s3-auth-api.js:45:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async addWalkthrough (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-storage/lib/provider-utils/awscloudformation/service-walkthroughs/s3-walkthrough.js:90:5)
    at async Object.executeAmplifyCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-storage/lib/index.js:252:3)
    at async executePluginModuleCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:139:5)
    at async executeCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:37:9)
    at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:121:5)

Expected behavior

  1. stack trace is not printed when running amplify add storage
    🛑 The imported auth config is not compatible with the specified storage config
    🛑 An error occurred when adding the storage resource
    
  2. stack trace is printed when running amplify add storage with --debug
    🛑 The imported auth config is not compatible with the specified storage config
    🛑 An error occurred when adding the storage resource
    ConfigurationError: The imported auth config is not compatible with the specified storage config
        at checkStorageAuthenticationRequirements (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-storage/lib/provider-utils/awscloudformation/service-walkthroughs/s3-auth-api.js:45:11)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async addWalkthrough (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-storage/lib/provider-utils/awscloudformation/service-walkthroughs/s3-walkthrough.js:90:5)
        at async Object.executeAmplifyCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-storage/lib/index.js:252:3)
        at async executePluginModuleCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:139:5)
        at async executeCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:37:9)
        at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:121:5)
    
  3. Auth configuration is validated at the start amplify add storage rather than at the end

Reproduction steps

  1. create an Amazon Cognito User Pool in the AWS Console
  2. create a new Amplify project with amplify init -y
  3. amplify import auth > Cognito User Pool only
  4. amplify add storage
  5. step through prompts
  6. observe error

Project Identifier

No response

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.
@josefaidt josefaidt added the pending-triage Issue is pending triage label Sep 19, 2023
@ykethan
Copy link
Member

ykethan commented Sep 19, 2023

Marking as bug due to stack trace.

@ykethan ykethan added auth Issues tied to the auth category of the CLI storage Issues tied to the storage category import Issues related to importing resources into an Amplify project bug Something isn't working and removed pending-triage Issue is pending triage labels Sep 19, 2023
@ykethan
Copy link
Member

ykethan commented Sep 19, 2023

similar error message will occur on amplify add analytics with an imported auth resource.


ConfigurationError: The imported auth config is not compatible with the specified analytics config
    at configure (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\amplify-category-analytics\lib\provider-utils\awscloudformation\service-walkthroughs\pinpoint-walkthrough.js:61:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.executeAmplifyCommand (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\amplify-category-analytics\lib\index.js:169:3)
    at async executePluginModuleCommand (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cli-internal\lib\execution-manager.js:139:5)
    at async executeCommand (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cli-internal\lib\execution-manager.js:37:9)
    at async Object.run (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cli-internal\lib\index.js:121:5)
🛑 There was an error adding the analytics resource

mitigation steps: enable allowUnauthenticatedIdentities on Cognito identity pool.

@josefaidt josefaidt added the p3 label Sep 19, 2023
@fourman-alex
Copy link

Can someone clarify what is the solution if auth was imported with amplify import auth and now amplify add anayltics throws The imported auth config is not compatible with the specified analytics config?

@fourman-alex
Copy link

mitigation steps: enable allowUnauthenticatedIdentities on Cognito identity pool.

@ykethan what if identity pool is not configured, any ideas what can be done in that case?

@qndrey
Copy link

qndrey commented Nov 29, 2023

We just faced this error as well. Any workarounds ?

@rendermouse
Copy link

rendermouse commented Dec 14, 2023

I get the same issue, but when I run "amplify update storage" after linking a User Pool (with an identity pool) in Amplify Studio, configuring Storage in Studio, and pulling to my local machine.

Studio gives me this message in Storage, Identity Pool is configured:
image

@izner32
Copy link

izner32 commented Feb 29, 2024

We just faced this error as well. Any workarounds ?

-> Create an identity pool.
-> Connect it with the user pool you imported.
-> Remove the imported auth with 'amplify remove auth'
-> Re-import the auth along with the created identity pool using 'amplify import auth'

@PopBot
Copy link

PopBot commented Mar 11, 2024

So we still must create a new User pool, or can we remove the old, attach the identity pool, and re-add it?

@sumitsahoo
Copy link

We are also getting the same error. We are using a custom cognito user pool with Azure AD SAML provider.

@PopBot
Copy link

PopBot commented Mar 29, 2024

I got it working by creating the S3 storage bucket, and assigning proper role permissions to the Cognito user pool for access. Then the import worked.

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 bug Something isn't working import Issues related to importing resources into an Amplify project p3 storage Issues tied to the storage category
Projects
None yet
Development

No branches or pull requests

8 participants