Dokploy/dokploy · error

Github Installation not found

Error message

Github Installation not found

What it means

The GitHub webhook payload must include installation.id (GitHub App installation events). If githubBody.installation.id is missing the endpoint responds 400 'Github Installation not found'.

Source

Thrown at apps/dokploy/pages/api/deploy/github.ts:42

} from "./[refreshToken]";

const getGithubRepositoryOwner = (githubBody: any) =>
	githubBody?.repository?.owner?.name ?? githubBody?.repository?.owner?.login;

export default async function handler(
	req: NextApiRequest,
	res: NextApiResponse,
) {
	const signature = req.headers["x-hub-signature-256"];
	if (!signature) {
		res.status(401).json({ message: "Missing signature header" });
		return;
	}

	const githubBody = req.body;

	if (!githubBody?.installation?.id) {
		res.status(400).json({ message: "Github Installation not found" });
		return;
	}

	const githubResult = await db.query.github.findFirst({
		where: eq(github.githubInstallationId, githubBody.installation.id),
	});

	if (!githubResult) {
		res.status(400).json({ message: "Github Installation not found" });
		return;
	}

	if (!githubResult.githubWebhookSecret) {
		res.status(400).json({ message: "Github Webhook Secret not set" });
		return;
	}
	const webhooks = new Webhooks({
		secret: githubResult.githubWebhookSecret,

View on GitHub (pinned to 546686ea35)

Solutions

  1. Use the GitHub App (Dokploy app) webhook flow rather than a plain repo webhook
  2. When testing manually, include "installation":{"id": <your installation id>} in the payload
  3. Verify the GitHub App is installed on the repository and the event payload is unmodified

Example fix

// manual test payload must include installation
{
  "installation": { "id": 12345678 },
  "action": "created",
  "repositories": [ { "full_name": "org/repo" } ]
}
Defensive patterns

Strategy: type-guard

Validate before calling

if (!req.body?.installation?.id) return res.status(400).json({ message: 'Github Installation not found' });

Type guard

const isAppWebhookPayload = (b: any): b is { installation: { id: number } } =>
  typeof b?.installation?.id === 'number';

Try / catch

const r = await fetch('/api/deploy/github', ...);
if (r.status === 400) includeInstallationInNextPayload();

Prevention

When it happens

Trigger: Webhook fired for events that carry no installation object (e.g. some repository/organization webhooks configured as plain repo webhooks instead of GitHub App webhooks), or a hand-crafted test payload without installation.

Common situations: Configured a standard repository webhook instead of the GitHub App webhook; ping events with unexpected shape; sending a push event from a non-App integration.

Related errors


AI-assisted analysis of Dokploy/dokploy@546686ea35 (2026-08-27). Data as JSON: /api/errors/a3402beadcc3ae03. Report an issue: GitHub.