windmill-labs/windmill · error
Failed to deploy ${type} "${path}".
Error message
Failed to deploy ${type} "${path}". What it means
Fallback error in the chat's deployDraft tool. When the deploy path goes through deployDraftToWorkspace (the workspace-item deploy service), the tool checks result.success; if the service returned success:false, the service's own result.error is thrown — and only if that error string is missing does this generic 'Failed to deploy <type> "<path>".' appear. It signals the server-side deploy failed but the cause was not propagated.
Source
Thrown at frontend/src/lib/components/copilot/chat/global/core.ts:7326
? await ScriptService.getScriptByPath({ workspace, path })
: undefined
assertDraftBasedOnLatest('script', path, draft.parentHash, existing?.hash, force)
} else {
const existing = (await FlowService.existsFlowByPath({ workspace, path }))
? await FlowService.getFlowByPath({ workspace, path })
: undefined
assertDraftBasedOnLatest('flow', path, draft.parentVersionId, existing?.version_id, force)
}
const draftOnly =
type === 'flow'
? !(await FlowService.existsFlowByPath({ workspace, path: storagePath }))
: false
const result = await deployDraftToWorkspace(type, storagePath, workspace, {
draftOnly,
deploymentMessage
})
if (!result.success) {
throw new Error(result.error ?? `Failed to deploy ${type} "${path}".`)
}
} else {
switch (type) {
case 'schedule': {
const requestBody = draft.value as any
if (await ScheduleService.existsSchedule({ workspace, path })) {
await ScheduleService.updateSchedule({ workspace, path, requestBody })
} else {
await ScheduleService.createSchedule({ workspace, requestBody })
}
actions = [createOpenScheduleAction(path, requestBody.is_flow ? 'flow' : 'script')]
break
}
case 'trigger': {
const service = triggerServices[triggerKind!]
const requestBody = draft.value as { is_flow?: boolean }
if (await service.exists({ workspace, path })) {
await service.update({ workspace, path, requestBody })View on GitHub (pinned to e474e8803c)
Solutions
- Check the backend logs / network tab for the actual deploy request failure cause.
- Retry the deploy; if it persists, verify workspace permissions and that the item type is deployable from the draft store.
- Report/investigate the missing result.error in deployDraftToWorkspace — the generic message hides the real cause.
Example fix
// before
const result = await deployDraftToWorkspace(type, path, ws, { draftOnly })
if (!result.success) throw new Error(result.error ?? `Failed to deploy ${type} "${path}".`)
// after (make the service always return an error string)
const result = await deployDraftToWorkspace(type, path, ws, { draftOnly })
if (!result.success) throw new Error(result.error ?? 'unknown deploy failure') Defensive patterns
Strategy: try-catch
Try / catch
try {
await deployDraft(args)
} catch (e) {
if (e.message.startsWith('Failed to deploy')) {
// generic failure: check backend logs / network tab for the real cause
} else throw e
} Prevention
- Ensure deployDraftToWorkspace always returns a descriptive result.error.
- Watch the deploy request's response body when debugging failed deploys.
- Verify workspace permissions before programmatic deploys.
When it happens
Trigger: deployDraftToWorkspace(type, storagePath, workspace, { draftOnly, deploymentMessage }) returns { success: false } with an undefined/empty error field — e.g. an unexpected server failure path that didn't set a message.
Common situations: Server-side validation failing without a message; permission/401-adjacent failures swallowed by the service; transient backend errors during deploy; a bug in deployDraftToWorkspace that resolves success:false without an error string.
Related errors
- git ${args.join(" ")} failed (exit ${status}): ${r.stderr ??
- Unknown kind: ${kind}
- Datatable migration ${path} not found in ${workspaceFrom}
- Deletion not supported for kind: ${kind}
- Draft variable "${draftValue.path}" is secret but stages no
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/95e9d4974f731a22.
Report an issue: GitHub.