paperclipai/paperclip · error

Project workspace not found before starting runtime services

Error message

Project workspace not found before starting runtime services

What it means

The same locking path selected the referenced project workspace FOR UPDATE and found no row for this company. The project workspace disappeared or is out of scope, so parent locking for runtime service start fails.

Source

Thrown at server/src/services/workspace-runtime.ts:7158

        ),
      )
      .for("update");
    if (!lockedExecutionWorkspace) throw new Error("Execution workspace not found before starting runtime services");
    allowFixedPortFallback = lockedExecutionWorkspace.mode === "isolated_workspace";
  }

  if (input.workspace.workspaceId) {
    const [lockedProjectWorkspace] = await db
      .select({ id: projectWorkspaces.id })
      .from(projectWorkspaces)
      .where(
        and(
          eq(projectWorkspaces.id, input.workspace.workspaceId),
          eq(projectWorkspaces.companyId, input.actor.companyId),
        ),
      )
      .for("update");
    if (!lockedProjectWorkspace) throw new Error("Project workspace not found before starting runtime services");
  }

  return allowFixedPortFallback;
}

function canRetryDeferredPortBindCollision(
  service: Record<string, unknown>,
  allowFixedPortFallback: boolean,
) {
  const portConfig = parseObject(service.port);
  const portType = asString(portConfig.type, "");
  const explicitPort = asNumber(portConfig.value, asNumber(service.port, 0));
  return portType === "auto" || Boolean(allowFixedPortFallback && explicitPort > 0);
}

async function discardFailedDeferredRuntimeStart(db: Db, record: RuntimeServiceRecord) {
  clearIdleTimer(record);
  if (runtimeServicesById.get(record.id) === record) runtimeServicesById.delete(record.id);

View on GitHub (pinned to a7e689b3c3)

Solutions

  1. Ensure the project workspace exists before starting runtime services; recreate or re-link it, then retry.
  2. Verify the project still references a valid workspace.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/services/workspace-runtime.ts:6520 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@a7e689b3c3 (2026-08-18). Data as JSON: /api/errors/6ec74524987f3a18. Report an issue: GitHub.