question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Amplify cli tries to create Notifications even though they already exist.

See original GitHub issue

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • 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.

How did you install the Amplify CLI?

npm

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

v14.17.0

Amplify CLI Version

10.3.2

What operating system are you using?

macOS Monterey 12.6

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

No manual changes made

Amplify Categories

analytics, notifications

Amplify Commands

pull, push

Describe the bug

  • Setup push notifications with the amplify cli (APNS and FCM) and push to the cloud.
  • When pulling this on a different device (also using amplify cli) amplify wants to “create” the notifications category again. However this happened multiple months after the notifications were created, so multiple pull and push operations worked without causing any problems.
  • When pulling or pushing amplify asks me to choose an authentication method for APNs. I don’t want to do this because everything should already be set up in the cloud.

Expected behavior

after adding and setting up notifications on one device and pushing to the cloud, amplify should not try to set notifications up on a different device.

Reproduction steps

  1. create project and set up notifications with APNs and FCM on a device and push to cloud.

  2. on another device set up amplify cli and pull everything.

  3. cli will ask to choose authentication method (I then aborted the command) image

  4. my amplify-meta.json now contains the following image

  5. as you can see there is no “lastPushTimeStamp” so amplify probably believes that this resource is newly created. Also there is no other information except for the channels and service

  6. run amplify status

  7. should now look something like this image

  8. run amplify pull

  9. cli will ask to choose authentication method (I then aborted the command) image

  10. now the amplify-meta.json contains the following image

  11. setting “HasTokenKey” to “true” leads to amplify not trying to create notifications category image

  12. now change something in your project to be able to run amplify push (for example you can simply add a space in your schema.graphql)

  13. when running amplify pull again the cli again asks me again to choose an authentication method for APNs

  14. so theoretically I can push without recreating notifications. However this is not the expected behaviour and I don’t want to do the above steps each time I have to push something.

  15. I have also figured out that for some reason running amplify env pull instead of just amplify pull leads to my amplify-meta.json looking again like this image

GraphQL schema(s)

# Put schemas below this line


Project Identifier

Project Identifier: 8e7ec6dac606d8af0b67897bb966c442

Log output

# Put your logs below this line


Additional information

Seems to be related to (or exactly the same as) #6408 but I couldn’t comment or reopen this issue since it was closed. The solution there was to recreate the whole project. Since my project is already in production I would rather not do that.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
lazpavelcommented, Oct 27, 2022

Hi @ericstoecker @Mentioum we have a RC out with a fix for this issue which you can find here: https://www.npmjs.com/package/@aws-amplify/cli/v/10.4.0-rc.43121b9b9.0 and we are working to push it to latest

1reaction
Mentioumcommented, Oct 27, 2022

We’re also having this (or a similar) issue while using v10.x.x:

It resulted in us having too many Pinpoint policies being added to our auth role.
This prevented us pushing after a while with the error: can't have more than 10 policies per role

We manually deleted the invalid policies and duplicated pinpoint projects and downgraded to v9.2.1 until this is fixed.

Tagging @ralphkemp for reference.

Read more comments on GitHub >

github_iconTop Results From Across the Web

API (GraphQL) - Client code generation - AWS Amplify Docs
Codegen helps you generate native code for iOS and Android, as well as the generation of types for Flow and TypeScript. It can...
Read more >
AWS Amplify Pricing | Front-End Web & Mobile - Amazon.com
Quickly create a cross-platform AWS backend for your iOS, Android, Flutter, web, or React Native apps using Amplify CLI or Amplify Studio.
Read more >
How to build an application in minutes with AWS Amplify
In this blog post, we'll go over one of the coolest and also the easiest way of developing serverless applications with AWS Amplify....
Read more >
No Amplify backend project files detected within this folder
Amplify cli could not locate an amplify folder inside TinderClone. Try `amplify pull with these steps IN A NEW EMPTY FOLDER.
Read more >
The Amplify Series, Part 2: How does AWS Amplify work?
However, as you can already tell, this is very error-prone, and missing even one step might make a big difference. With IaC, we...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found