Dokploy/dokploy · error · TRPCError

NOT_FOUND

NOT_FOUND

Error message

Network not found

What it means

findNetworkById selects from the network table by networkId with limit 1; NOT_FOUND when no row matches. This helper backs inspect/remove/update flows, so any operation on a nonexistent network ID fails here first.

Source

Thrown at packages/server/src/services/network.ts:195

				name,
				error:
					error instanceof Error ? error.message : "Failed to inspect network",
			});
		}
	}

	return { imported, errors };
};

export const findNetworkById = async (networkId: string) => {
	const [row] = await db
		.select()
		.from(network)
		.where(eq(network.networkId, networkId))
		.limit(1);

	if (!row) {
		throw new TRPCError({
			code: "NOT_FOUND",
			message: "Network not found",
		});
	}

	return row;
};

export const createNetwork = async (
	input: z.infer<typeof apiCreateNetwork>,
	organizationId: string,
) => {
	if (IS_CLOUD) {
		if (!input.serverId) {
			throw new TRPCError({
				code: "BAD_REQUEST",
				message: "Server is required",
			});

View on GitHub (pinned to 546686ea35)

Solutions

  1. List networks via the API and use the returned networkId, not the docker name
  2. Refresh the networks page and retry
  3. If deleted intentionally, no action is needed — remove stale references
Defensive patterns

Strategy: try-catch

Validate before calling

const nets = await listNetworks();
if (!nets.some(n => n.networkId === networkId)) throw new Error("unknown networkId");

Try / catch

try { return await findNetworkById(networkId); } catch (e) { if (e instanceof TRPCError && e.code === "NOT_FOUND") return null; throw e; }

Prevention

When it happens

Trigger: Inspecting or deleting a network by an ID that was never imported, was already deleted, or is a docker network name mistaken for the DB networkId.

Common situations: Confusing docker's network name/ID with the app's internal networkId (UUID); stale UI state after another user removed the network.

Related errors


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