Connect on Forge with different environments

Hi there,

we started using Connect-on-Forge and are now having problems with installing the app to the same with multiple environments.

So we are having something like in our manifest.yml

app:
  [...]
  connect:
    key: my.app.key
    remote: connect

That works totally fine. Now if I use

forge deploy -e staging && forge install -e staging,

then of course I get an error that the connect key is already in use (like explained The Connect and Forge dev loop).

If I now set the connect key to

app:
  [...]
  connect:
    key: my.app.key.staging
    remote: connect

then the forge install -e staging --verbose command fails with

  ◀️  GraphQL
Request ID: 29208054b21e455cbfa1b9a1446e0e79
Result: {
  "appInstallationTask": {
    "state": "FAILED",
    "errors": [
      {
        "message": "An unexpected error occurred",
        "extensions": {
          "errorType": "INTERNAL_SERVER_ERROR",
          "statusCode": 500
        }
      }
    ]
  }
}

Error: An unexpected error occurred

As the 500 indicates a backend error, is this some regression with the Forge systems or do I need to configure something differently?

Best
Johannes

1 Like

Just to be sure, after you changed your app key to my.app.key.staging did you redeploy that change to staging?

For now, until we get better support for different environments build for Connect Apps adopting Forge Components, I have been using the tool dhall to maintain effectively one Forge Manifest, with overrides, to make sure that I am always using the right keys/base urls in the right environments.

For example:


1 Like

Hi @JohannesKstle,

Extending upon what @rmassaioli shared, a non-2xx response from your Connect backend to the install hook can result in this error. We’re working on improving visibility of this; however for now it would be worthwhile checking that you’re returning a valid installation response.

Hey @JohannesKstle , if you still see the error after confirming that you’re deploying the key change and your backend is responding healthily, please include your app ID and the time window of your installation attempt to help us check what the issue could be.

Cheers!

1 Like

Hi @jhazelwood ,

I have retried it again and confirmed that I changed the key and redeployed, so I did:

  1. Uninstall all versions of my app from my site
  2. Deployed to development
  3. Changed the Connect key
  4. Deployed to custom environment “my-name”
  5. Installed to Development
  6. Installed to custom environment “my-name”

→ Last step has thrown the 500. I tried this right now, so between 10:45 - 11:00 CET on an app with the id dce24c3d-6542-4a41-a27d-2d06b5001edb.

Regarding the Connect backend: That actually does not exist. We only use confluenceContentProperties from Connect because they do not exist in Forge. This is a Connect property that does not use a real backend. We based this upon this post Using Connect modules in a new Forge app.

Thanks for your assistance.

Best
Johannes

Hi, @JohannesKstle

The installation failure is caused by a conflict with the macro key (com-tngtech-confluence-plugin-tableenhancer-tableenhancer-macro) in your workspace, https://kaestle.atlassian.net (please confirm this).

Could you please check if there is another macro with the same key, or try using a different macro key and redeploy your app.

Apologies for the inconvenience caused by the error message. We are currently working on improving this and a more descriptive message will be available soon.

Please let me know if this resolves the issue.

James

3 Likes

Hi @JamesByun,

this seems to work. Thank you. I will adapt my manifest.yml template to also add the environment name to the macro key.

But I have another app that also uses macros but without any connect feature. There I did not have any troubles installing multiple environments to the same site with the same macro key. Is this somehow an cross-dependency between macros, multi-environments and connect features?

Best
Johannes

1 Like

Hi, @JohannesKstle

That’s an excellent question. The previous macro conflict error is related to the clash between your app’s macro being installed and the macro key of another Connect app that was already installed in your workspace. (Keep in mind Connect does not have any multi-environment deployment concept)

For the later use case you described without Connect features, I imagine you are solely using the Forge macro. In this scenario, the macro key can remain the same. You will see the identical macro key with a different environment tag, as shown in this screenshot.

For your information, the Forge macro currently does not have a macro key conflict check. This means that it won’t prevent your app installation even if another app attempts to use the same macro key. However, only the first installed macro will be rendered. There should be some improvement in this behavior in the future.

Hope this helps
James

2 Likes