Dokploy/dokploy · warning · Error

Gitlab provider not found

Error message

Gitlab provider not found

What it means

testGitlabConnection validates its input and throws when gitlabId is missing/falsy, meaning no GitLab provider was selected or passed by the frontend. It is a precondition failure before any network call happens.

Source

Thrown at packages/server/src/utils/providers/gitlab.ts:273

		}
	}

	return allBranches as {
		id: string;
		name: string;
		commit: {
			id: string;
		};
	}[];
};

export const testGitlabConnection = async (
	input: z.infer<typeof apiGitlabTestConnection>,
) => {
	const { gitlabId, groupName } = input;

	if (!gitlabId) {
		throw new Error("Gitlab provider not found");
	}

	await refreshGitlabToken(gitlabId);

	const gitlabProvider = await findGitlabById(gitlabId);

	const repositories = await validateGitlabProvider(gitlabProvider);

	const filteredRepos = repositories.filter((repo: any) => {
		const { full_path, kind } = repo.namespace;

		if (groupName) {
			return groupName
				.split(",")
				.some((name: string) =>
					full_path.toLowerCase().startsWith(name.trim().toLowerCase()),
				);
		}

View on GitHub (pinned to 546686ea35)

Solutions

  1. Create and save the Gitlab provider first, then pass its id to testGitlabConnection
  2. Check the client payload includes gitlabId (inspect network request body)
  3. Guard the UI: disable the Test Connection button until a provider is selected

Example fix

// before
if (!gitlabId) {
  throw new Error("Gitlab provider not found");
}

// after (client side, avoid the call)
if (!gitlabId) {
  toast.error("Select or create a GitLab provider first");
  return;
}
Defensive patterns

Strategy: validation

Validate before calling

if (!gitlabId) {
  toast.error('Select a GitLab provider first');
  return;
}

Type guard

const hasProviderId = (id: string | null | undefined): id is string =>
  typeof id === 'string' && id.length > 0;

Prevention

When it happens

Trigger: Calling the testConnection tRPC mutation with an empty/undefined gitlabId, e.g. testing a provider that was never created or was deleted and the UI still holds a stale reference.

Common situations: User opens the test-connection dialog before saving/creating the provider; the provider record was deleted concurrently; form state lost the id.

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


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