paperclipai/paperclip · error

Daytona interactive setup can start from image or snapshot t

Error message

Daytona interactive setup can start from image or snapshot templates only, not ${sourceKind}.

What it means

Thrown by applyInteractiveSetupSourceTemplate when sourceTemplateKind is neither 'image' nor 'snapshot' (defaults to 'snapshot' when omitted). Daytona interactive setup can only start from an image reference or a snapshot reference.

Source

Thrown at packages/plugins/sandbox-providers/daytona/src/plugin.ts:589

    .slice(0, 96);
  return cleaned || fallback;
}

function withSetupSourceTemplate(
  config: DaytonaDriverConfig,
  params: Pick<PluginEnvironmentStartInteractiveSetupParams, "sourceTemplateRef" | "sourceTemplateKind">,
): DaytonaDriverConfig {
  if (!params.sourceTemplateRef) return config;
  const sourceKind = params.sourceTemplateKind ?? "snapshot";
  if (sourceKind === "image") {
    return {
      ...config,
      image: params.sourceTemplateRef,
      snapshot: null,
    };
  }
  if (sourceKind !== "snapshot") {
    throw new Error(`Daytona interactive setup can start from image or snapshot templates only, not ${sourceKind}.`);
  }
  return {
    ...config,
    snapshot: params.sourceTemplateRef,
    image: null,
  };
}

async function createSshConnection(
  sandbox: Sandbox,
  expiresInMinutes: number,
): Promise<Pick<PluginEnvironmentInteractiveSetupSession, "connectionSummary" | "connectionPayload">> {
  const createSshAccess = (sandbox as DaytonaInteractiveSandbox).createSshAccess;
  if (typeof createSshAccess !== "function") {
    throw new Error(
      "Daytona interactive setup requires @daytonaio/sdk Sandbox.createSshAccess support.",
    );
  }

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Set sourceTemplateKind to either 'image' (to use an image ref) or 'snapshot' (the default, to use a snapshot ref).
  2. If using an image, provide sourceTemplateRef as the image identifier; for snapshot, provide the snapshot identifier.
  3. Omit sourceTemplateKind entirely if you mean 'snapshot' (the default).

Example fix

// before: unsupported kind
params.sourceTemplateKind = 'container'
// after: valid kind
params.sourceTemplateKind = 'image' // or 'snapshot'
Defensive patterns

Strategy: validation

Validate before calling

const ALLOWED_TEMPLATE_KINDS = new Set(['image', 'snapshot']);
function isValidTemplateKind(kind: string | undefined): boolean {
  return kind === undefined || ALLOWED_TEMPLATE_KINDS.has(kind);
}

Type guard

function isDaytonaTemplateKind(v: string): v is 'image' | 'snapshot' {
  return v === 'image' || v === 'snapshot';
}

Prevention

When it happens

Trigger: onEnvironmentStartInteractiveSetup is called with sourceTemplateRef set and sourceTemplateKind being some value other than 'image' or 'snapshot' (e.g. a typo, an unsupported kind, or an empty string).

Common situations: Caller passes a template kind the Daytona driver does not support; upstream code passes a generic kind like 'docker' or 'container'; sourceTemplateKind defaulted unexpectedly because the caller omitted it but supplied a ref of a different kind.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/2aacc64731f3bc67. Report an issue: GitHub.