aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.81k stars 821 forks source link

amplify update notifications error: pushTransform already has a running timer #12734

Open snozoka opened 1 year ago

snozoka commented 1 year ago

How did you install the Amplify CLI?

npm

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

v16.15.1

Amplify CLI Version

12.0.3

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

I ran 'amplify update notifications' and get the follow error/resolution message:

" Edit your schema at /.../schema.graphql or place .graphql files in a directory at /...schema Deployment state saved successfully.

GraphQL transformer version: 2

πŸ›‘ pushTransform already has a running timer

Resolution: Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the project identifier from: 'amplify diagnose --send-report' Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/

"

Expected behavior

I expect 'notifications' category to be updated (even though I have not made any manual change). I also expect to be able to run 'amplify pull --appId XXX --envName staging' and 'amplify push' successfully. Currently I'm getting "Could not initialize categories for 'staging': Cannot read properties of undefined (reading 'Soar4JrbB')" when I run 'amplify pull'

Reproduction steps

  1. Run 'amplify update notifications' in Android Studio terminal window

Project Identifier

adf24a36f9a97bc1518d1dfa8861c7ae

Log output

``` # Put your logs below this line ```

" β § Building resource api/Soarβœ… GraphQL schema compiled successfully.

Edit your schema at /.../schema.graphql or place .graphql files in a directory at /...schema Deployment state saved successfully.

GraphQL transformer version: 2

πŸ›‘ pushTransform already has a running timer

Resolution: Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the project identifier from: 'amplify diagnose --send-report' Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/

Session Identifier: c774bd85-f540-4c40-b2db-a822f7201ecf

βœ… Report saved: /...zip

βœ” Done

"

Additional information

No response

Before submitting, please confirm:

ykethan commented 1 year ago

Hey @snozoka, thank you for reaching out. Could you try adding the --debug and provide the output being displayed. The issue appears to be similar to https://github.com/aws-amplify/amplify-cli/issues/12747 where i observed the update command threw a different error. Additionally, for could you try pulling the Amplify backend with the --debug in a new directory and re-run amplify update notification then run amplify push --debug. Do let us know if you observe the same error message.

snozoka commented 1 year ago

Hi @ykethan thanks for your response. Here's what I get when I run 'amplify update notification --debug' :

πŸ›‘ pushTransform already has a running timer

Resolution: Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the project identifier from: 'amplify diagnose --send-report'
Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/

UnknownFault: pushTransform already has a running timer
    at genericErrorToAmplifyException (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/amplify-exception-handler.js:126:49)
    at handleException (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/amplify-exception-handler.js:27:28)
    at process.<anonymous> (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/index.js:48:93)
    at process.emit (node:events:513:28)
    at process.processEmit [as emit] (/snapshot/repo/build/node_modules/signal-exit/index.js:199:34)
    at process._fatalException (node:internal/process/execution:149:25)

pushTransform already has a running timer
Error: pushTransform already has a running timer
    at UsageData.startCodePathTimer (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/domain/amplify-usageData/UsageData.js:74:19)
    at AmplifyToolkit.pushResources (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/extensions/amplify-helpers/push-resources.js:38:23)
    at run (/snapshot/repo/build/node_modules/@aws-amplify/amplify-category-analytics/lib/commands/analytics/push.js:17:18)
    at inAppMessagingMigrationCheck (/snapshot/repo/build/node_modules/@aws-amplify/amplify-category-analytics/lib/migrations/in-app-messaging-migration.js:125:41)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async analyticsMigrations (/snapshot/repo/build/node_modules/@aws-amplify/amplify-category-analytics/lib/migrations/index.js:11:3)
    at async migrationCheck (/snapshot/repo/build/node_modules/@aws-amplify/amplify-category-notifications/lib/migrations/index.js:7:9)
    at async Object.executeAmplifyCommand (/snapshot/repo/build/node_modules/@aws-amplify/amplify-category-notifications/lib/index.js:57:5)
    at async executePluginModuleCommand (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:135:5)
    at async executeCommand (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:33:9)
    at async Object.run (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/index.js:117:5)

Session Identifier: 34e25dc3-ff52-463f-bf84-f94a1145959e

βœ… Report saved: /tmp/Soar/report-1687094368886.zip

βœ” Done

Project Identifier: adf24a36f9a97bc1518d1dfa8861c7ae
snozoka commented 1 year ago

Additionally, below is the error I get when I try pulling the Amplify backend with the '--debug'

"

⚠️ Local changes detected. ⚠️ Pulling changes from the cloud will override your local changes. ? Are you sure you would like to continue? Yes β Έ Fetching updates to backend environment: staging from the cloud.Overrides functionality is not implemented for this category β ΄ Building resource api/Soar[WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated. use addDependency This API will be removed in the next major release. [WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated. use addDependency This API will be removed in the next major release. [WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated. use addDependency This API will be removed in the next major release. [WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated. use addDependency This API will be removed in the next major release. [WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated. use addDependency This API will be removed in the next major release. [WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated. use addDependency This API will be removed in the next major release. [WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated. use addDependency This API will be removed in the next major release. [WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated. use addDependency This API will be removed in the next major release. β § Building resource api/Soarβœ… GraphQL schema compiled successfully.

Edit your schema at /Users/Scott/Documents/GitHub/Soar/amplify/backend/api/Soar/schema.graphql or place .graphql files in a directory at /Users/Scott/Documents/GitHub/Soar/amplify/backend/api/Soar/schema Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category βœ” Successfully pulled backend environment staging from the cloud. βœ” Successfully retrieved channel information for FCM. βœ” Channel information retrieved for Email βœ– There was an error initializing your environment. πŸ›‘ Could not initialize categories for 'staging': Cannot read properties of undefined (reading 'Soar4JrbB')

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 'Soar4JrbB') at initializeEnv (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/initialize-env.js:114:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async pullBackend (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/pull-backend.js:31:5) at async Object.run (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/commands/pull.js:46:17) at async Object.executeAmplifyCommand (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/index.js:189:9) at async executePluginModuleCommand (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:135:5) at async executeCommand (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:33:9) at async Object.run (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/index.js:117:5)

Cannot read properties of undefined (reading 'Soar4JrbB') TypeError: Cannot read properties of undefined (reading 'Soar4JrbB') at writeData (/snapshot/repo/build/node_modules/@aws-amplify/amplify-category-notifications/lib/multi-env-manager-utils.js:60:89) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.initEnv (/snapshot/repo/build/node_modules/@aws-amplify/amplify-category-notifications/lib/multi-env-manager.js:76:13) at async initEnv (/snapshot/repo/build/node_modules/@aws-amplify/amplify-category-notifications/lib/index.js:47:5)

Session Identifier: e4911749-7286-403f-83b5-139e56e41269

βœ… Report saved: /tmp/Soar/report-1687094787166.zip

βœ” Done

Project Identifier: adf24a36f9a97bc1518d1dfa8861c7ae

snozoka commented 1 year ago

And here's what I get when I run amplify push --debug:


Not pulling components because this project is not configured as a javascript frontend.
β ‹ Fetching updates to backend environment: staging from the cloud.Overrides functionality is not implemented for this category
β ™ Fetching updates to backend environment: staging from the cloud.[WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated.
  use addDependency
  This API will be removed in the next major release.
[WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated.
  use addDependency
  This API will be removed in the next major release.
[WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated.
  use addDependency
  This API will be removed in the next major release.
[WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated.
  use addDependency
  This API will be removed in the next major release.
[WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated.
  use addDependency
  This API will be removed in the next major release.
[WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated.
  use addDependency
  This API will be removed in the next major release.
[WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated.
  use addDependency
  This API will be removed in the next major release.
[WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated.
  use addDependency
  This API will be removed in the next major release.
β Έ Fetching updates to backend environment: staging from the cloud.βœ… GraphQL schema compiled successfully.

Edit your schema at /Users/Scott/Documents/GitHub/Soar/amplify/backend/api/Soar/schema.graphql or place .graphql files in a directory at /Users/Scott/Documents/GitHub/Soar/amplify/backend/api/Soar/schema
Overrides functionality is not implemented for this category
Overrides functionality is not implemented for this category
βœ” Successfully pulled backend environment staging from the cloud.

    Current Environment: staging

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Category      β”‚ Resource name         β”‚ Operation β”‚ Provider plugin   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Auth          β”‚ soar                  β”‚ No Change β”‚ awscloudformation β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Api           β”‚ Soar                  β”‚ No Change β”‚ awscloudformation β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Function      β”‚ soarlambdafunction    β”‚ No Change β”‚ awscloudformation β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Notifications β”‚ Soar4JrbB             β”‚ No Change β”‚                   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Storage       β”‚ s3soarstoragecb023aae β”‚ No Change β”‚ awscloudformation β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
βœ” Are you sure you want to continue? (Y/n) Β· yes
Overrides functionality is not implemented for this category
β Ό Building resource api/Soar[WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated.
  use addDependency
  This API will be removed in the next major release.
[WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated.
  use addDependency
  This API will be removed in the next major release.
[WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated.
  use addDependency
  This API will be removed in the next major release.
[WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated.
  use addDependency
  This API will be removed in the next major release.
[WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated.
  use addDependency
  This API will be removed in the next major release.
[WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated.
  use addDependency
  This API will be removed in the next major release.
[WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated.
  use addDependency
  This API will be removed in the next major release.
[WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated.
  use addDependency
  This API will be removed in the next major release.
β ¦ Building resource api/Soarβœ… GraphQL schema compiled successfully.

Edit your schema at /Users/Scott/Documents/GitHub/Soar/amplify/backend/api/Soar/schema.graphql or place .graphql files in a directory at /Users/Scott/Documents/GitHub/Soar/amplify/backend/api/Soar/schema
Overrides functionality is not implemented for this category
Overrides functionality is not implemented for this category
Deployment state saved successfully.

GraphQL transformer version: 2

Not pulling components because this project is not configured as a javascript frontend.
ykethan commented 1 year ago

Hey @snozoka, thank you for the information. Could you let us know the Amplify CLI version the project and the notifications category created on as this would enable us in reproducing the issue? Additionally, if possible could you try removing the notifications channel and then re-add the channels back in?

Marking this as bug for further investigation.

snozoka commented 1 year ago

Hi @ykethan below are the responses to your question. I attempted to remove the notifications category but it still appears when I run 'amplify status'

... % sudo amplify status

Current Environment: staging

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Category β”‚ Resource name β”‚ Operation β”‚ Provider plugin β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ Auth β”‚ soar β”‚ No Change β”‚ awscloudformation β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ Api β”‚ Soar β”‚ No Change β”‚ awscloudformation β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ Function β”‚ soarlambdafunction β”‚ No Change β”‚ awscloudformation β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ Notifications β”‚ Soar4JrbB β”‚ No Change β”‚ β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ Storage β”‚ s3soarstoragecb023aae β”‚ No Change β”‚ awscloudformation β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Pinpoint URL to track events GraphQL endpoint: GraphQL API KEY:

GraphQL transformer version: 2

... % sudo amplify remove notifications Password: ? Choose the notification channel to remove …
FCM | » Firebase Push Notifications ❯ All channels on Pinpoint resource : Soar4JrbB

βœ” Choose the notification channel to remove Β· All channels on Pinpoint resource : Soar4JrbB βœ” Confirm that you want to delete the associated Amazon Pinpoint application (y/N) Β· yes Deployment state saved successfully. The Pinpoint application has been successfully deleted. ...Soar % sudo amplify remove notifications Password: ? Choose the notification channel to remove … (Use arrow keys or type to filter) ❯ FCM | Β» Firebase Push Notifications Email All channels on Pinpoint resource : Soar4JrbB Cancel

ykethan commented 1 year ago

Hey @snozoka, thank you for the information. I observed that the project currently does not have a analytics resource present in the project as when adding a notifications resource a analytics pinpoint resource automatically gets added to the project. was the analytics resource manually removed? unfortunately it appears we may have to manually remove the resource from the project. To remove the notifications and analytics from the project we can utilize the following steps.

  1. remove the analytics and notifications directory if present under amplify/backend/
  2. carefully remove the analytics and pinpoint references in amplify/team-provider-info.json
  3. carefully remove the analytics and pinpoint references references in amplify/backend/backend-config.json. this includes the parameters as well.
  4. run amplify env checkout <current-env-name>
  5. this should now show your analytics and notifications in the DELETE state
  6. push with amplify push -y
snozoka commented 1 year ago

Hi @ykethan it appears the analytics and notifications resources are removed, but for some reason I'm still not able to pull the project from Amplify Studio; I'm getting an error saying "Cannot read properties of undefined" (se images below) which was the error I was previously getting, and which was related to Notifications.

I'm now thinking it may be best to start all over, clean AWS from the Android project and pull the project from Amplify Studio; how can I do this?

image image
snozoka commented 1 year ago

Hello,

Any help with the above?

I'm still not able to pull the project from the cloud or save and deploy my data model.

Thanks

snozoka commented 1 year ago

Please ignore; I've deleted the Amplify project and started over.