paperclipai/paperclip · error
Persisted Cloud runtime identity is malformed
Error message
Persisted Cloud runtime identity is malformed
What it means
Validation error thrown by parsePersistedIdentity in cloud-runtime-identity.ts. It fires when the persisted Cloud runtime identity row (from the general settings store) does not match the expected v1 shape: value.v !== 1 or any of stackId, claimId, previousOrigin, canonicalOrigin, stackSlug is missing or not a string. This is a generic guard against a corrupted, partially-written, or older-version identity record; the faulty input is the persisted identity document itself.
Source
Thrown at server/src/services/cloud-runtime-identity.ts:110
stackSlug: row.stackSlug,
appliedAt: row.appliedAt,
};
}
function parsePersistedIdentity(row: {
general: Record<string, unknown>;
createdAt: Date;
}): PersistedRuntimeIdentity {
const value = row.general;
if (
value.v !== 1
|| typeof value.stackId !== "string"
|| typeof value.claimId !== "string"
|| typeof value.previousOrigin !== "string"
|| typeof value.canonicalOrigin !== "string"
|| typeof value.stackSlug !== "string"
) {
throw new Error("Persisted Cloud runtime identity is malformed");
}
return {
stackId: value.stackId,
claimId: value.claimId,
previousOrigin: value.previousOrigin,
canonicalOrigin: value.canonicalOrigin,
stackSlug: value.stackSlug,
appliedAt: row.createdAt,
};
}
async function readPersistedIdentity(db: RuntimeIdentityDb): Promise<PersistedRuntimeIdentity | null> {
const row = await db
.select({
general: instanceSettings.general,
createdAt: instanceSettings.createdAt,
})
.from(instanceSettings)View on GitHub (pinned to 01ad858492)
Solutions
- Inspect the persisted identity row and delete/reset it so a fresh Cloud runtime identity claim can be written on next startup
- Verify the instance was not downgraded from a newer schema version (v mismatch) and migrate the record instead of failing
- Log which specific field failed validation to distinguish corruption from a version mismatch
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at server/src/services/cloud-runtime-identity.ts:110 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-09-10).
Data as JSON: /api/errors/b19388b65a9b48af.
Report an issue: GitHub.