How to debug failed Forge deploy?

Is there any way to get insight into why a forge deploy fails? I have written a small Forge app and after adding and importing the googleapis package deployments fail (forge version 0.27.0).

I have tried to run forge deploy --verbose which leads to the following log (failure at Snapshotting functions stage) but does not really provide more insight:

     ... (removed successful log events)
          {
            "__typename": "AppDeploymentTransitionEvent",
            "stepName": "Validate manifest",
            "createdAt": "2020-12-22T08:02:09.571Z",
            "newStatus": "DONE"
          }
        ]
      },
      {
        "description": "Snapshotting functions",
        "events": [
          {
            "__typename": "AppDeploymentTransitionEvent",
            "stepName": "Generate snapshot step",
            "createdAt": "2020-12-22T08:02:09.572Z",
            "newStatus": "STARTED"
          },
          {
            "__typename": "AppDeploymentLogEvent",
            "stepName": "Generate snapshot step",
            "createdAt": "2020-12-22T08:02:19.484Z",
            "message": "Deployment failed with unknown error",
            "level": "ERROR"
          },
          {
            "__typename": "AppDeploymentTransitionEvent",
            "stepName": "Generate snapshot step",
            "createdAt": "2020-12-22T08:02:19.485Z",
            "newStatus": "FAILED"
          }
        ]
      },
      {
        "description": "Deploying to environment",
        "events": []
      }
    ]
  }
}
  Deployment failed with unknown error

Error: Deployment failed

Error: Deployment failed
    at ArtifactDeployer.handleErrorEvent (/usr/local/lib/node_modules/@forge/cli/out/deploy/deployer/deployer.js:135:15)
    at ArtifactDeployer.pollAndCheckEvents (/usr/local/lib/node_modules/@forge/cli/out/deploy/deployer/deployer.js:61:18)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async ArtifactDeployer.monitorDeployment (/usr/local/lib/node_modules/@forge/cli/out/deploy/deployer/deployer.js:72:28)
    at async ArtifactDeployer.deploy (/usr/local/lib/node_modules/@forge/cli/out/deploy/deployer/deployer.js:36:9)
    at async PackageUploadDeployCommand.execute (/usr/local/lib/node_modules/@forge/cli/out/deploy/package-upload-deploy.js:14:9)
    at async CommandLineUI.displayProgress (/usr/local/lib/node_modules/@forge/cli/node_modules/@forge/cli-shared/out/ui/command-line-ui.js:44:28)
    at async DeployView.reportDeploymentProgress (/usr/local/lib/node_modules/@forge/cli/out/command-line/view/deploy-view.js:31:24)
    at async DeployController.run (/usr/local/lib/node_modules/@forge/cli/out/command-line/controller/deploy-controller.js:58:27)
    at async Command.actionProcessor (/usr/local/lib/node_modules/@forge/cli/out/command-line/command.js:60:32)

I wonder if this is due to beta limitations e.g. unsupported built-in Node modules. Would Forge fail at the snapshotting functions stage if it fails due to unsupported Node modules or would that rather be a runtime error?

Hi @tbinna,

The error message here seems inadequate so I’ve created https://ecosystem.atlassian.net/browse/FRGE-195.

I’ll reach out to the Forge team to see if they can help you proceed.

Regards,
Dugald

Hi @tbinna, could you provide log output that includes a traceId or requestId?

Snapshots have known to fail on things such as large buffers, could you try bypass the snapshot by adding this to your manifest under the app entry:

runtime:
  snapshots: false

https://developer.atlassian.com/platform/forge/manifest-reference/runtime/#snapshot-context for more info

2 Likes

@nhur, it seems that by disabling the snapshots it works.

I will PM you the log output of a failed deployment (when snapshots are enabled)

Thanks!

Hi @nhur / @dmorrow ,

seems like I’m running into the same issue, but disabling snapshots doesn’t fix it for me.

This happens with a new app created by forge create from forge CLI 0.27.0 where the CLI created a UI-Kit -> confluence macro module for me.

When I run forge deploy with modifying the manifest I get this:

Request ID: ba2bba1a96c20b1b
...
      {
        "description": "Snapshotting functions",
        "events": [
          {
            "__typename": "AppDeploymentTransitionEvent",
            "stepName": "Generate snapshot step",
            "createdAt": "2021-01-18T09:12:15.630Z",
            "newStatus": "STARTED"
          },
          {
            "__typename": "AppDeploymentLogEvent",
            "stepName": "Generate snapshot step",
            "createdAt": "2021-01-18T09:12:15.914Z",
            "message": "Deployment failed with unknown error",
            "level": "ERROR"
          },
          {
            "__typename": "AppDeploymentTransitionEvent",
            "stepName": "Generate snapshot step",
            "createdAt": "2021-01-18T09:12:15.916Z",
            "newStatus": "FAILED"
          }

After disabling snapshot it fails at a different stage:

Request ID: 8799f0a1c2fffec6


          {
            "__typename": "AppDeploymentLogEvent",
            "stepName": "Release Lambda functions",
            "createdAt": "2021-01-18T09:52:37.234Z",
            "message": "Deploying function \"main\" for the first time",
            "level": "INFO"
          },
          {
            "__typename": "AppDeploymentLogEvent",
            "stepName": "Release Lambda functions",
            "createdAt": "2021-01-18T09:52:39.769Z",
            "message": "Deployment failed with unknown error",
            "level": "ERROR"
          },
          {
            "__typename": "AppDeploymentTransitionEvent",
            "stepName": "Release Lambda functions",
            "createdAt": "2021-01-18T09:52:39.770Z",
            "newStatus": "FAILED"
          }

Is there something I can do to fix this?

Thanks!

Hi @jens, I tried looking at the logs for your deployment and couldn’t find anything specific — was this an unmodified app from the template? I’d be happy to look at your app code to try to debug it (feel free to DM)

Hi @jens, are you by any chance using NodeJS v15? Type node --version to determine what version you are using.

We’ve had someone experience the same issue as you when using NodeJS v15. The Forge CLI currently only supports NodeJS LTS versions (of which NodeJS v14 is the latest). Can you install NodeJS v14, run node --version to double check you’re using the version 14 of Node and try running forge deploy again?

Yes, this worked! Thanks a lot.

I followed the Getting Started page in the docs which only says that docker and node are required. As I had those already installed I didn’t read their specific installation instructions (on the OS-specific pages).
Maybe you could add a quick note on the getting started page about the LTS requirement to prevent others from falling into the same pit, or even add a runtime check to the CLI :slight_smile:

Thanks for confirming @jens. For the benefit of others, the solution was to change the version of Node to v14.

I have created https://ecosystem.atlassian.net/browse/FRGE-203 to improve the documentation and/or have the Forge CLI enforce the use of a supported version of Node.

2 Likes

Folks, I’m facing the same issue, the deploy stopped working for me today, and the last time I deployed successfully was 2 or 3 days ago.

I updated Node to 14.15 and also disabled snapshots. Still getting:

{
            "__typename": "AppDeploymentLogEvent",
            "stepName": "Release Lambda functions",
            "createdAt": "2021-01-26T22:11:21.230Z",
            "message": "Updated function \"main\" configuration",
            "level": "INFO"
          },
          {
            "__typename": "AppDeploymentLogEvent",
            "stepName": "Release Lambda functions",
            "createdAt": "2021-01-26T22:11:25.042Z",
            "message": "Deployment failed with unknown error",
            "level": "ERROR"
          },
          {
            "__typename": "AppDeploymentTransitionEvent",
            "stepName": "Release Lambda functions",
            "createdAt": "2021-01-26T22:11:25.043Z",
            "newStatus": "FAILED"
          }

Any ideas? Could it be specific to the environment where the deployment is made? In my case the deployment url is: https://deployment-artifacts-372253104996-us-west-2.s3.us-west-2.amazonaws.com/

1 Like

I started seeing this error too. I actually deployed many versions of this macro today successfully and then it just started failing and it fails even when I revert my latest changes. I was running node 13.8.0 successfully until it started failing. After finding this thread I tried updating to V14.15.1 and I tried turning off snapshots but it is still failing. Here are the final verbose deployment messages before the failure.

      {
        "description": "Deploying to environment",
        "events": [
          {
            "__typename": "AppDeploymentTransitionEvent",
            "stepName": "Validate hosted resource upload step",
            "createdAt": "2021-01-26T23:01:09.705Z",
            "newStatus": "STARTED"
          },
          {
            "__typename": "AppDeploymentTransitionEvent",
            "stepName": "Release Lambda functions",
            "createdAt": "2021-01-26T23:01:11.590Z",
            "newStatus": "STARTED"
          },
          {
            "__typename": "AppDeploymentTransitionEvent",
            "stepName": "Validate hosted resource upload step",
            "createdAt": "2021-01-26T23:01:11.590Z",
            "newStatus": "DONE"
          },
          {
            "__typename": "AppDeploymentLogEvent",
            "stepName": "Release Lambda functions",
            "createdAt": "2021-01-26T23:01:11.592Z",
            "message": "Found 3 function definitions",
            "level": "INFO"
          },
          {
            "__typename": "AppDeploymentLogEvent",
            "stepName": "Release Lambda functions",
            "createdAt": "2021-01-26T23:01:11.593Z",
            "message": "Deploying \"resolver\" function",
            "level": "INFO"
          },
          {
            "__typename": "AppDeploymentLogEvent",
            "stepName": "Release Lambda functions",
            "createdAt": "2021-01-26T23:01:11.730Z",
            "message": "Updated function \"resolver\" configuration",
            "level": "INFO"
          },
          {
            "__typename": "AppDeploymentLogEvent",
            "stepName": "Release Lambda functions",
            "createdAt": "2021-01-26T23:01:17.486Z",
            "message": "Deployment failed with unknown error",
            "level": "ERROR"
          },
          {
            "__typename": "AppDeploymentTransitionEvent",
            "stepName": "Release Lambda functions",
            "createdAt": "2021-01-26T23:01:17.487Z",
            "newStatus": "FAILED"
          }
        ]
      }
    ]
  }
}
  Deployment failed with unknown error

Error: Deployment failed
2 Likes

Hi @jeffryan @IgorAndriushchenkp,

We’re currently investigating these deployment issues. We will come back with an update as soon as possible!

Hi @jeffryan @IgorAndriushchenkp,

We’ve resolved the above deployment issues. These were caused by an internal problem and we’ll ensure it doesn’t happen again. Can you please try deploying again? Let us know if your deployments continue to fail.

My deploys are working again! Thanks for the quick response - much appreciated!

1 Like

@kchan my deploys are also working, thanks for the quick fix!

1 Like

@kchan My deployments continue to fail when I instantiate googleapis object.

Hi @vanlykim, are you able to create a new CDAC post for this issue? The fix for this issue ended up being unrelated to googleapis.

It would also be helpful to provide some additional information about your app in that post. For example, what behaviour are you experiencing? What gets returned by the forge deploy --verbose comand? Have you determined that it works without googleapis and breaks with it?

Hi @kchan! Thank you for the quick response. I’ve created a new CDAC post for this issue here: Failed to integrate with googleapis