Forge install fails on production environment

I developed an app for Confluence. I could deploy and install it on my development environment with forge deploy and forge install commands successfully.

I could run forge deploy -e production sucessfully. When running forge install -e production the app fails.

> forge install -e production --verbose
Select the product your app uses.

? Select a product: Confluence

Enter your site. For example, your-domain.atlassian.net

? Enter the site URL: oliver-rolle.atlassian.net

Installing your app onto an Atlassian site.
Press Ctrl+C to cancel.

▶️  GraphQL https://api.atlassian.com/graphql
Query:
      query forge_cli_getApplicationEnvironmentLatestVersions($appId: ID!, $environmentKey: String!, $firstN: Int!) {
        app(id: $appId) {
          environmentByKey(key: $environmentKey) {
            versions(first: $firstN) {
              nodes {
                permissions {
                  egress {
                    addresses
                  }
                  scopes {
                    key
                  }
                }
              }
            }
          }
        }
      }

Variables: {
  "appId": "ari:cloud:ecosystem::app/cc207864-42bd-4887-b324-fc304b60e252",
  "environmentKey": "production",
  "firstN": 2
}
◀️  GraphQL
Request ID: 124587787823d7ec
Result: {
  "app": {
    "environmentByKey": {
      "versions": {
        "nodes": [
          {
            "permissions": [
              {
                "egress": [],
                "scopes": [
                  {
                    "key": "read:me"
                  },
                  {
                    "key": "read:confluence-content.all"
                  },
                  {
                    "key": "read:confluence-props"
                  },
                  {
                    "key": "read:confluence-content.summary"
                  },
                  {
                    "key": "read:confluence-space.summary"
                  }
                ]
              }
            ]
          },
          {
            "permissions": [
              {
                "egress": [],
                "scopes": []
              }
            ]
          }
        ]
      }
    }
  }
}
Your app will be installed with the following scopes:
- read:me
- read:confluence-content.all
- read:confluence-props
- read:confluence-content.summary
- read:confluence-space.summary

? Do you want to continue? Yes

Installing your app on to production...

  ▶️  GraphQL https://api.atlassian.com/graphql
Query:
      query forge_cli_getCloudIfForTenantContexts($hostNames: [String!]) {
        tenantContexts(hostNames: $hostNames) {
          cloudId
        }
      }

Variables: {
  "hostNames": [
    "oliver-rolle.atlassian.net"
  ]
}
  ◀️  GraphQL
Request ID: 247c3bac6afa1182
Result: {
  "tenantContexts": [
    {
      "cloudId": "c8b4df98-9018-44d2-bd68-6b2576d7a221"
    }
  ]
}
  ▶️  GraphQL https://api.atlassian.com/graphql
Query:
      mutation forge_cli_installApplication($input: AppInstallationInput!) {
        installApp(input: $input) {
          success
          taskId
          errors {
            message
            extensions {
              errorType
            }
          }
        }
      }

Variables: {
  "input": {
    "installationContext": "ari:cloud:confluence::site/c8b4df98-9018-44d2-bd68-6b2576d7a221",
    "appId": "ari:cloud:ecosystem::app/cc207864-42bd-4887-b324-fc304b60e252",
    "environmentKey": "production",
    "async": true
  }
}
  ◀️  GraphQL
Request ID: da3e4c31123c2b7d
Result: {
  "installApp": {
    "success": true,
    "taskId": "30dc2478-3296-48f5-8aec-819aae425473",
    "errors": null
  }
}
  ▶️  GraphQL https://api.atlassian.com/graphql
Query:
      query forge_cli_getInstallationTask($id: ID!) {
        appInstallationTask(id: $id) {
          state
          errors {
            message
            extensions {
              errorType
            }
          }
        }
      }

Variables: {
  "id": "30dc2478-3296-48f5-8aec-819aae425473"
}
  ◀️  GraphQL
Request ID: c283389e2189ab90
Result: {
  "appInstallationTask": {
    "state": "PENDING",
    "errors": null
  }
}
  ▶️  GraphQL https://api.atlassian.com/graphql
Query:
      query forge_cli_getInstallationTask($id: ID!) {
        appInstallationTask(id: $id) {
          state
          errors {
            message
            extensions {
              errorType
            }
          }
        }
      }

Variables: {
  "id": "30dc2478-3296-48f5-8aec-819aae425473"
}
  ◀️  GraphQL
Request ID: 12f8f6b48074f9eb
Result: {
  "appInstallationTask": {
    "state": "PENDING",
    "errors": null
  }
}
  ▶️  GraphQL https://api.atlassian.com/graphql
Query:
      query forge_cli_getInstallationTask($id: ID!) {
        appInstallationTask(id: $id) {
          state
          errors {
            message
            extensions {
              errorType
            }
          }
        }
      }

Variables: {
  "id": "30dc2478-3296-48f5-8aec-819aae425473"
}
  ◀️  GraphQL
Request ID: c22579ad5b8597f2
Result: {
  "appInstallationTask": {
    "state": "PENDING",
    "errors": null
  }
}
  ▶️  GraphQL https://api.atlassian.com/graphql
Query:
      query forge_cli_getInstallationTask($id: ID!) {
        appInstallationTask(id: $id) {
          state
          errors {
            message
            extensions {
              errorType
            }
          }
        }
      }

Variables: {
  "id": "30dc2478-3296-48f5-8aec-819aae425473"
}
  ◀️  GraphQL
Request ID: f0331fbab7ea4c57
Result: {
  "appInstallationTask": {
    "state": "PENDING",
    "errors": null
  }
}
  ▶️  GraphQL https://api.atlassian.com/graphql
Query:
      query forge_cli_getInstallationTask($id: ID!) {
        appInstallationTask(id: $id) {
          state
          errors {
            message
            extensions {
              errorType
            }
          }
        }
      }

Variables: {
  "id": "30dc2478-3296-48f5-8aec-819aae425473"
}
  ◀️  GraphQL
Request ID: 195289b6c1582646
Result: {
  "appInstallationTask": {
    "state": "PENDING",
    "errors": null
  }
}
  ▶️  GraphQL https://api.atlassian.com/graphql
Query:
      query forge_cli_getInstallationTask($id: ID!) {
        appInstallationTask(id: $id) {
          state
          errors {
            message
            extensions {
              errorType
            }
          }
        }
      }

Variables: {
  "id": "30dc2478-3296-48f5-8aec-819aae425473"
}
  ◀️  GraphQL
Request ID: b38494404b593541
Result: {
  "appInstallationTask": {
    "state": "PENDING",
    "errors": null
  }
}
  ▶️  GraphQL https://api.atlassian.com/graphql
Query:
      query forge_cli_getInstallationTask($id: ID!) {
        appInstallationTask(id: $id) {
          state
          errors {
            message
            extensions {
              errorType
            }
          }
        }
      }

Variables: {
  "id": "30dc2478-3296-48f5-8aec-819aae425473"
}
  ◀️  GraphQL
Request ID: f9b5b3a28e85cb25
Result: {
  "appInstallationTask": {
    "state": "FAILED",
    "errors": [
      {
        "message": "An unexpected error occurred",
        "extensions": {
          "errorType": "INTERNAL_SERVER_ERROR"
        }
      }
    ]
  }
}

Error: An unexpected error occurred

Error: An unexpected error occurred
    at InstallationsGraphqlClient.monitorAppInstallOrUpgrade (C:\Users\Oliver\AppData\Roaming\npm\node_modules\@forge\cli\out\installations\graphql-client.js:177:23)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async InstallationsGraphqlClient.installAppIntoSite (C:\Users\Oliver\AppData\Roaming\npm\node_modules\@forge\cli\out\installations\graphql-client.js:134:9)
    at async InstallAppSiteCommand.execute (C:\Users\Oliver\AppData\Roaming\npm\node_modules\@forge\cli\out\installations\install-app-site.js:11:16)
    at async C:\Users\Oliver\AppData\Roaming\npm\node_modules\@forge\cli\out\command-line\controller\install-controller.js:43:17
    at async CommandLineUI.displayProgress (C:\Users\Oliver\AppData\Roaming\npm\node_modules\@forge\cli\node_modules\@forge\cli-shared\out\ui\command-line-ui.js:44:28)
    at async InstallController.run (C:\Users\Oliver\AppData\Roaming\npm\node_modules\@forge\cli\out\command-line\controller\install-controller.js:129:34)
    at async C:\Users\Oliver\AppData\Roaming\npm\node_modules\@forge\cli\out\command-line\register-installation-commands.js:21:9
    at async Command.actionProcessor (C:\Users\Oliver\AppData\Roaming\npm\node_modules\@forge\cli\out\command-line\command.js:76:32)

Hey @OliverRolle, thanks for sharing.
We will investigate what happened here and post back.

Hi Dmitrii, could you look into this problem? I tired again and it still fails.

Hi @OliverRolle. Sorry, the ticket got lost somewhere in the jungle of internal comms. The backend team tracked down your problem and they were fixing it last week. Let me ask them to post updates here.

1 Like

Hi Oliver thanks for your patience. I’m on the team investigating this.

The investigation is in progress and we’re currently following a lead. Will update you by tomorrow (Sydney time) on what the progress is.

Investigation has not lead to any concrete leads.
The production version is on marketplace which may be causing problems.

@OliverRolle is it possible to install the production environment on other sites or are other sites also not working?

Hello,

I have the same issue. I’m unable to install production on one of my environments.
My app is rejected because of a bug that only happens in the production environment and I’m unable to reproduce.
I’m using forge-cli 6.4.0.

Thanks!

Request ID: a8b8357ece29bf54
Result: {
  "appInstallationTask": {
    "state": "FAILED",
    "errors": [
      {
        "message": "An unexpected error occurred",
        "extensions": {
          "errorType": "INTERNAL_SERVER_ERROR"
        }
      }
    ]
  }
}

Error: An unexpected error occurred

Error: An unexpected error occurred
    at InstallationsGraphqlClient.monitorAppInstallOrUpgrade (C:\Users\cosmin\AppData\Roaming\npm\node_modules\@forge\cli\out\installations\graphql-client.js:193:23)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async InstallationsGraphqlClient.installAppIntoSite (C:\Users\cosmin\AppData\Roaming\npm\node_modules\@forge\cli\out\installations\graphql-client.js:142:9)
    at async InstallAppSiteCommand.execute (C:\Users\cosmin\AppData\Roaming\npm\node_modules\@forge\cli\out\installations\install-app-site.js:11:16)
    at async C:\Users\cosmin\AppData\Roaming\npm\node_modules\@forge\cli\out\command-line\controller\install-controller.js:43:17
    at async CommandLineUI.displayProgress (C:\Users\cosmin\AppData\Roaming\npm\node_modules\@forge\cli\node_modules\@forge\cli-shared\out\ui\command-line-ui.js:46:28)
    at async InstallController.run (C:\Users\cosmin\AppData\Roaming\npm\node_modules\@forge\cli\out\command-line\controller\install-controller.js:132:34)
    at async C:\Users\cosmin\AppData\Roaming\npm\node_modules\@forge\cli\out\command-line\register-installation-commands.js:19:9
    at async Command.actionProcessor (C:\Users\cosmin\AppData\Roaming\npm\node_modules\@forge\cli\out\command-line\command.js:84:32)

Hi would you be able to provide more from these failed installations?

There’s a log that should look like this

  ▶️  GraphQL https://api.atlassian.com/graphql
Query: 
      query forge_cli_getInstallationTask($id: ID!) {
        appInstallationTask(id: $id) {
          state
          errors {
            message
            extensions {
              errorType
            }
          }
        }
      }
    
Variables: {
  "id": "0859e0a7-736e-4b27-a091-d939ecf4ccde"
}

The id here would be helpful for investigations.

Would you also be able to provide the app id and the site you are installing on?

Also it may be worth creating a new post for this.

This may be a different problem to what we see above.

Hello,

Thank you for your reply!

Here’s the log you requested below.

Cosmin

  ▶️  GraphQL https://api.atlassian.com/graphql
Query:
      query forge_cli_getInstallationTask($id: ID!) {
        appInstallationTask(id: $id) {
          state
          errors {
            message
            extensions {
              errorType
            }
          }
        }
      }

Variables: {
  "id": "0b01c506-4e28-446d-9efa-b7f6d6655054"
}