plane icon indicating copy to clipboard operation
plane copied to clipboard

[bug]: GitHub Enterprise Server connect fails with error=4033, GHES drops `state` on install redirect

Open amirmes opened this issue 2 weeks ago • 2 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Current behavior

Setting up the GitHub Enterprise Server integration on self-hosted Plane and consistently running into an issue. This is confirmed with setting up new integrations and not sure if this affects existing integrations as well.

After filling out the fields to integrate with the GHES (on https://.com//settings/integrations/github-enterprise/), click Connect, go through the GHES install, click Install, and I always end up at https://<plane-host>/error/?error=4033. Same thing after uninstalling the app and doing a fresh install.

Silo logs:

GET /api/oauth/github-enterprise/auth/callback?installation_id=147&setup_action=install 302
ERROR OAuth handleCallback error for provider: github-enterprise
  error: "Invalid GitHub OAuth state"
  at decodeStateParam
  at decodeGithubState
  at GithubEnterpriseStrategy.handleCallback

The callback has no state param, so silo can't tell which workspace the install is for and redirects to the generic 4033.

What I found: for GHES, Silo builds the install link as

https://<ghes-host>/github-apps/<app-slug>/installations/select_target?state=<base64>

The state in that link is fine, but by the time GHES calls the setup URL, state is gone, every time.

Workaround (confirmed working): add the state to the URL during the integration set up

Update the URL from:

https://<ghes-host>/github-apps/<app-slug>/installations/new/permissions?target_id=<org_id>

to:

https://<ghes-host>/github-apps/<app-slug>/installations/new/permissions?target_id=<org_id>&state=<same value from silo's link>

Click Install, callback comes back with state, connection gets created, webhooks go from 401 to 202.

Semi-related issue: https://github.com/makeplane/plane/issues/8076

Steps to reproduce

  1. Self-hosted plane commercial v4.0.1 with GHES 3.19.6
  2. Create a GitHub App on GHES per the Plane docs (setup URL /silo/api/oauth/github-enterprise/auth/callback, "Redirect on update" on)
  3. In Plane go to Workspace Settings → Integrations → GitHub Enterprise, fill out the required fields and click Connect
  4. Github opens .../installations/select_target?state=..., go through the install and click Install
  5. You land on /error/?error=4033 and Silo logs Invalid GitHub OAuth state. Callback URL is ?installation_id=<id>&setup_action=install with no state

Environment

Production

Browser

Google Chrome

Edition

Commercial

Version

v4.0.1

amirmes avatar Nov 14 '26 00:11 amirmes

Thanks for the report and the workaround, @amirmes. We've confirmed the bug: GHES drops state during the install, so Plane can't match the install to your workspace. We'll update here once this issue is fixed and released in next patch.

Prashant-Surya avatar Nov 14 '26 15:11 Prashant-Surya