windmill-labs/windmill · error

A resource was created at ${path} while this setup was runni

Error message

A resource was created at ${path} while this setup was running. Choose another path and try again.

What it means

writeResource claims a resource path and, when an existing resource is found, re-verifies via stillOurs that it is still the one this setup claimed before calling ResourceService.updateResource. If the path was taken by someone else during the setup, it throws pathTakenLate('resource', path).

Source

Thrown at frontend/src/lib/components/workspaceSettings/addDataTableModel.ts:531

		decryptSecret: false
	}).catch(() => undefined)
	return held ? (held.edited_at ?? held.edited_by ?? '') : undefined
}

function pathTakenLate(kind: 'variable' | 'resource', path: string): string {
	return `A ${kind} was created at ${path} while this setup was running. Choose another path and try again.`
}

async function writeResource(
	deps: RunDeps,
	claims: Claims,
	path: string,
	value: Record<string, any>,
	description: string
): Promise<Claims> {
	const held = await resourceMark(deps, path)
	if (held) {
		if (!stillOurs(claims, 'resource', path, held)) throw new Error(pathTakenLate('resource', path))
		await ResourceService.updateResource({
			workspace: deps.workspace,
			path,
			requestBody: { value, description }
		})
	} else {
		await ResourceService.createResource({
			workspace: deps.workspace,
			requestBody: { resource_type: 'postgresql', path, value, description }
		})
	}
	// Read back rather than claim the username: `created_by` survives an update, so it cannot
	// tell an edit by somebody else from no edit at all. `edited_at` moves on every write, which
	// is what makes the next attempt able to see one that happened in between.
	return claim(claims, 'resource', path, (await resourceMark(deps, path)) ?? deps.username)
}

/** `undefined` when nothing is there. */

View on GitHub (pinned to e474e8803c)

Solutions

  1. Choose a different resource path and rerun the setup
  2. Delete or rename the conflicting resource and rerun the setup
  3. Run the setup wizard one admin at a time to avoid path collisions
Defensive patterns

Strategy: retry

Validate before calling

const existing = await ResourceService.getResource({ workspace, path }).catch(() => null)
if (existing && !isOurClaim(existing)) console.warn(`Resource '${path}' already exists — choose another path`)

Try / catch

try {
  await runSetup(...)
} catch (e) {
  if (String(e.message).includes('A resource was created at')) {
    // prompt for a new resource path and retry the setup
  }
}

Prevention

When it happens

Trigger: A resource is created at the same path by another admin/session while the add-data-table setup is between its resourceMark claim and the ResourceService.updateResource call.

Common situations: Concurrent setup runs by multiple admins; another process or teammate creating the database resource path during a long-running setup wizard.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/b35298d0ab317aaf. Report an issue: GitHub.