paperclipai/paperclip · error

The device login start request is invalid.

Error message

The device login start request is invalid.

What it means

The device login start spine rejected the request body: requestSchema validation failed on the start payload (e.g. missing/invalid environmentId or adapter fields); invalidRequestError is the configured generic message.

Source

Thrown at server/src/routes/adapter-login-route-spine.ts:95

 * null when a step sends a response; the caller must then stop.
 */
export async function runAdapterLoginStartSpine<TData extends { environmentId: string }>(
  input: AdapterLoginStartSpineInput<TData>,
): Promise<AdapterLoginStartResolution<TData> | null> {
  const ownerUserId = await input.deriveOwner();

  if (input.guardBeforeValidate) {
    await input.guardBeforeValidate();
  }

  const body =
    input.req.body && typeof input.req.body === "object"
      ? (input.req.body as Record<string, unknown>)
      : {};
  const candidate = input.requestOverrides ? { ...body, ...input.requestOverrides } : body;
  const parsed = input.requestSchema.safeParse(candidate);
  if (!parsed.success) {
    input.res.status(400).json({ error: input.invalidRequestError });
    return null;
  }
  const data = parsed.data;

  if (input.guardAfterValidate) {
    const stop = await input.guardAfterValidate(data);
    if (stop) return null;
  }

  await input.assertSandbox(data);
  return { ownerUserId, data };
}

View on GitHub (pinned to a7e689b3c3)

Solutions

  1. Check the request body against the device login start schema
  2. Ensure environmentId is present and valid
  3. Remove unknown/incorrectly-typed fields and retry the start
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/routes/adapter-login-route-spine.ts:95 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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