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 notifications error on specific environment #14056

Closed
2 tasks done
charith-eLovu opened this issue Jan 3, 2025 · 5 comments
Closed
2 tasks done

Amplify notifications error on specific environment #14056

charith-eLovu opened this issue Jan 3, 2025 · 5 comments
Labels
notifications Issues tied to the notifications category pending-triage Issue is pending triage

Comments

@charith-eLovu
Copy link

How did you install the Amplify CLI?

No response

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

No response

Amplify CLI Version

12.14.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.

No manual changes made

Describe the bug

Since yesterday we notice some problem with notifications on our amplify project .
When i try to switch to this environment from other env i get Cannot read properties of undefined (reading 'Id')
amplify update notifications throws the same error.

Other environments seems fine, this env is configure for us-west-1 which does not have pinpoint available, amplify did setup it in us-west-2 was working all fine for over a year now .

i see this output when i do amplify env checkout staging --debug

✔ Initialized provider successfully.
✔ Channel information retrieved for APNS
✔ Successfully retrieved channel information for FCM.
⠋ Retrieving channel information for In-App Messaging.⠋ Retrieving channel information for Email.✖ There was an error initializing your environment.
🛑 Could not initialize categories for 'staging': Cannot read properties of undefined (reading 'Id')

Resolution: Review the error message and stack trace for additional information.
Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/

ProjectInitFault: Could not initialize categories for 'staging': Cannot read properties of undefined (reading 'Id')
    at initializeEnv (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/initialize-env.js:122:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/commands/env/checkout.js:48:5)
    at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/commands/env.js:52:13)
    at async Object.executeAmplifyCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:194:9)
    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)

Cannot read properties of undefined (reading 'Id')
TypeError: Cannot read properties of undefined (reading 'Id')
    at getNotificationsAppListMeta (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-notifications/lib/notifications-amplify-meta-api.js:148:58)
    at getNotificationsAppMeta (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-notifications/lib/notifications-amplify-meta-api.js:47:44)
    at Object.pull (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-notifications/lib/channel-in-app-msg.js:104:98)
    at /snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-notifications/lib/notifications-manager.js:112:51
    at /snapshot/amplify-cli/build/node_modules/promise-sequential/index.js:16:18
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
⠙ Retrieving channel information for Email.
Session Identifier: e275d41d-8209-4757-9d50-1c742b6a51f9

Expected behavior

Should work without any issues on this env like other env's

Reproduction steps

Not sure on how to reproduce the error, but i can say we did not make any changes to config recently .

Project Identifier

471b11adc8ed24241581a56cb8dcfb7a

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.
@charith-eLovu charith-eLovu added the pending-triage Issue is pending triage label Jan 3, 2025
@ykethan
Copy link
Member

ykethan commented Jan 6, 2025

Hey, thank you for reaching out. The issue does appear to be similar to #13653.
For a quick confirmation, could check the amplify-meta.json file in the S3 deployment bucket and confirm if it does contain a notifications block?

  1. download the #current-cloud-backend.zip from your project deployment bucket from AWS S3 console. The bucket name should have a pattern amplify-<project-name>-<env-name>-<random-number>-deployment.
  2. extract and open amplify-meta.json.

@ykethan ykethan added notifications Issues tied to the notifications category pending-response Issue is pending response from the issue author labels Jan 6, 2025
@charith-eLovu
Copy link
Author

yes i can see 'notifications' block inside 'amplify-meta.json`

"notifications": {
    "myXXXapp": {
      "channels": [
        "APNS",
        "FCM"
      ],
      "service": "Pinpoint"
    }
  }

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Jan 7, 2025
@charith-eLovu
Copy link
Author

Hi @ykethan ,
i have tried the steps suggested in #13653 and it worked.
we no longer face this issue .
Thanks for you help and quick response .

@ykethan
Copy link
Member

ykethan commented Jan 7, 2025

@charith-eLovu Glad to hear that it mitigated your issue.
Closing this issue, do reach out if you require any assistance on a new issue.

@ykethan ykethan closed this as completed Jan 7, 2025
Copy link

github-actions bot commented Jan 7, 2025

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
notifications Issues tied to the notifications category pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

2 participants