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 pinpoint - There was an error adding the analytics resource #13595

Closed
2 tasks done
dotto95 opened this issue Feb 15, 2024 · 5 comments
Closed
2 tasks done
Labels
analytics Issues tied to the analytics category of the CLI import Issues related to importing resources into an Amplify project pending-response Issue is pending response from the issue author pending-triage Issue is pending triage

Comments

@dotto95
Copy link

dotto95 commented Feb 15, 2024

How did you install the Amplify CLI?

yarn

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

18.16.0

Amplify CLI Version

12.8.1

What operating system are you using?

Windows 11

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

No manual changes made

Describe the bug

After amplify pull --appId xxxxx --envName prod

amplify analytics add --debug
Output:

? Select an Analytics provider Amazon Pinpoint
√ Provide your pinpoint resource name: · appui
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

I read that: #13240
but after enabled guest doesn't work (i didn't found unauthenticated users feature):

image

Expected behavior

add pinpoint

Reproduction steps

  1. launch "amplify add pinpoint"

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.
@dotto95 dotto95 added the pending-triage Issue is pending triage label Feb 15, 2024
@ykethan
Copy link
Member

ykethan commented Feb 15, 2024

Hey @dotto95, thank you for reaching out. Tried reproducing the issue with the following steps and latest Amplify CLI version.

  1. created a new user pool with app client and sample providers

Screenshot 2024-02-15 at 12 53 17 PM

Screenshot 2024-02-15 at 12 53 56 PM

  1. created an identity pool with guest access and Authenticated access enabled. Authenticated identity source as Cognito user pool
    Screenshot 2024-02-15 at 12 45 02 PM

  2. amplify import auth -> Cognito User Pool and Identity Pool

  3. amplify add analytics -> Pinpoint
    the analytics resource was successfully added. Does the reproduction steps align with your current environment?

@ykethan ykethan added analytics Issues tied to the analytics category of the CLI import Issues related to importing resources into an Amplify project pending-response Issue is pending response from the issue author labels Feb 15, 2024
@dotto95
Copy link
Author

dotto95 commented Feb 15, 2024

Hey there,

Thank you for the detailed walkthrough. The steps you've described do align with my environment, and the analytics resource was added successfully.

However, I'm looking to integrate this with my existing Cognito user pool, where I already have users registered. As you can see in the screenshots, I've also enabled guest users.

image

During my testing, I encountered an error when using the amplify pull command.


 amplify pull --appId yyyyyyyyyyyyyyyyyy--envName xxxxxxxxxxxxxx --debug
Opening link: https://eu-central-1.admin.amplifyapp.com/admin/xxxxxxxxxxxxxx/prodrest/verify/?loginVersion=1
⠋ Confirm login in the browser or manually paste in your CLI login key:
Successfully received Amplify Studio tokens.                                                                                                                           
Amplify AppID found: xxxxxxxxxxxxxx. Amplify App name is: appui
Backend environment prodrest found in Amplify Console app: appui
? Choose your default editor: Visual Studio Code
√ Choose the type of app that you're building · javascript
Please tell us about your project
? What javascript framework are you using react
? Source Directory Path:  src
? Distribution Directory Path: build
? Build Command:  yarn build
? Start Command: yarn start
No AppSync API configured. Please add an API
TypeError: Cannot read properties of undefined (reading 'length')
Skipping UI component generation since none are found.
? Do you plan on modifying this backend? Yes
/ Fetching updates to backend environment: prodrest from the cloud.Overrides functionality is not implemented for this category
√ Successfully pulled backend environment prodrest from the cloud.
✅ 

✅ Successfully pulled backend environment prodrest from the cloud.
Run 'amplify pull' to sync future upstream changes.

No AppSync API configured. Please add an API
TypeError: Cannot read properties of undefined (reading 'length')
Skipping UI component generation since none are found.

Could you provide guidance on how to integrate Amplify with an existing Cognito user pool and resolve the issue encountered with amplify pull?

Thanks in advance for your assistance.

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Feb 15, 2024
@ykethan
Copy link
Member

ykethan commented Feb 17, 2024

Hey @dotto95, curious when running amplify import auth are you importing both the user pool and identity pool?
you should be able to import the existing user pool and the identity pool. Diving the code here:


the resource check if the project has an identity pool and unauthenticated access enabled.

@ykethan ykethan added the pending-response Issue is pending response from the issue author label Feb 17, 2024
@ykethan
Copy link
Member

ykethan commented May 3, 2024

Closing the issue due to inactivity. Do reach out to us if you require any assistance.

@ykethan ykethan closed this as not planned Won't fix, can't repro, duplicate, stale May 3, 2024
Copy link

github-actions bot commented May 3, 2024

This issue is now closed. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analytics Issues tied to the analytics category of the CLI import Issues related to importing resources into an Amplify project pending-response Issue is pending response from the issue author pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

2 participants