paperclipai/paperclip · error

Environment customImage setup session not found

Error message

Environment customImage setup session not found

What it means

Lookup guard on the custom-image setup session route: the requested setup session id is unknown or already consumed/expired in the session store, so the guided custom-image setup cannot be continued and the route returns 404.

Source

Thrown at server/src/routes/environments.ts:800

  router.post(
    "/environments/:environmentId/custom-image-setup-sessions",
    validate(startEnvironmentCustomImageSetupSessionSchema),
    async (req, res) => {
      assertCanAccessInstanceEnvironments(req);
      const companyId = await resolveCustomImageCompanyId(req);
      const actor = getActorInfo(req);
      const result = await customImages.startSetupSession({
        environmentId: req.params.environmentId as string,
        templateId: req.body.templateId ?? null,
        ttlSeconds: req.body.ttlSeconds ?? null,
        actor: {
          userId: actor.actorType === "user" ? actor.actorId : null,
          agentId: actor.agentId,
        },
        secretContextCompanyId: companyId,
      });
      await logEnvironmentCustomImageActivity({
        actor,
        companyId,
        action: "environment.custom_image_setup.started",
        entityId: result.session.environmentId,
        details: setupSessionActivityDetails(result.session),
      });
      res.status(201).json(result);
    },
  );

  router.get("/environment-custom-image-setup-sessions/:sessionId", async (req, res) => {
    assertCanAccessInstanceEnvironments(req);
    const session = await customImages.getSessionById(req.params.sessionId as string);
    if (!session) {
      res.status(404).json({ error: "Environment customImage setup session not found" });
      return;
    }
    await resolveCustomImageSessionCompanyId(req, session);
    const result = await customImages.refreshSetupSession({

View on GitHub (pinned to 01ad858492)

Solutions

  1. Verify the id in the request path or body refers to an existing record in this company; re-list the parent collection to get a valid id.
  2. Check that the record was not deleted or archived, and that the request is scoped to the correct companyId.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/routes/environments.ts:799 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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