Dokploy/dokploy · error · TRPCError

NOT_FOUND

NOT_FOUND

Error message

Select a server to add the registry

What it means

In createRegistry, when running Dokploy Cloud (IS_CLOUD) and the request omits serverId (or it is undefined while not being the literal 'none'), a NOT_FOUND error 'Select a server to add the registry' is thrown before the docker login is attempted. Self-hosted (non-cloud) instances skip this check entirely.

Source

Thrown at packages/server/src/services/registry.ts:62

	return await db.transaction(async (tx) => {
		const newRegistry = await tx
			.insert(registry)
			.values({
				...input,
				organizationId: organizationId,
			})
			.returning()
			.then((value) => value[0]);

		if (!newRegistry) {
			throw new TRPCError({
				code: "BAD_REQUEST",
				message: "Error input:  Inserting registry",
			});
		}

		if (IS_CLOUD && !input.serverId && input.serverId !== "none") {
			throw new TRPCError({
				code: "NOT_FOUND",
				message: "Select a server to add the registry",
			});
		}
		const loginCommand = safeDockerLoginCommand(
			input.registryUrl,
			input.username,
			input.password,
		);
		try {
			if (input.serverId && input.serverId !== "none") {
				await execAsyncRemote(input.serverId, loginCommand);
			} else if (newRegistry.registryType === "cloud") {
				await execAsync(loginCommand);
			}
		} catch (error) {
			const sanitized = sanitizeRegistryError(error, input.password);
			throw new TRPCError({ code: "BAD_REQUEST", message: sanitized });

View on GitHub (pinned to 546686ea35)

Solutions

  1. Send a valid serverId of a connected server in the create-registry request
  2. Send the literal string 'none' if the login should run on the main Dokploy server (cloud self server)
  3. If self-hosting is an option, note this check does not apply when IS_CLOUD is false

Example fix

// before
await trpc.registry.create.mutate({ registryUrl, username, password, registryType: "cloud" });

// after
await trpc.registry.create.mutate({ registryUrl, username, password, registryType: "cloud", serverId: "none" });
Defensive patterns

Strategy: validation

Validate before calling

if (IS_CLOUD && !input.serverId) input.serverId = "none"; // or a real server ID from the servers list

Type guard

const hasServerSelection = (v: unknown): v is { serverId: string } =>
  typeof v === "object" && v !== null && typeof (v as any).serverId === "string" && (v as any).serverId !== "";

Try / catch

null

Prevention

When it happens

Trigger: On Dokploy Cloud, POSTing a new registry without a serverId field, or with serverId: null/undefined, while expecting the login to run on a specific server. The condition is only false when serverId is 'none' (local execution) or a real server ID.

Common situations: Cloud users building API integrations that worked against self-hosted Dokploy (where serverId is optional); UI form not sending the selected server after a refactor; passing empty string instead of 'none'.

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/5324f27788f34c1c. Report an issue: GitHub.