paperclipai/paperclip · error

Policy resource not found

Error message

Policy resource not found

What it means

The authorization policy update targeted neither project nor issue and the fallback company branch also failed, meaning the resourceId did not resolve to a policy-bearing resource in this company. Generic 'resource does not exist' guard for the policy API.

Source

Thrown at server/src/services/plugin-host-services.ts:3152

          else delete executionPolicy.authorizationPolicy;
          await db
            .update(issuesTable)
            .set({ executionPolicy, updatedAt: new Date() })
            .where(eq(issuesTable.id, issue.id));
        } else {
          const company = await companies.getById(params.resourceId);
          if (!company || company.id !== companyId) throw new Error("Company not found");
          throw new Error("Company authorization policy updates are not supported by the current core schema");
        }
        await logPluginActivity({
          companyId,
          action: "authorization.policy_updated_by_plugin",
          entityType: params.resourceType,
          entityId: params.resourceId,
          details: { hasPolicy: Boolean(policy) },
        });
        const updated = await readAuthorizationPolicy(companyId, params.resourceType, params.resourceId);
        if (!updated) throw new Error("Policy resource not found");
        return updated;
      },
      async previewAssignment(params) {
        const companyId = ensureCompanyId(params.companyId);
        await ensurePluginAvailableForCompany(companyId);
        return authorization.decide({
          actor: pluginAssignmentActor(params.actor),
          action: "tasks:assign",
          resource: { type: "issue", companyId, ...params.target },
          scope: {
            issueId: params.target.issueId ?? null,
            projectId: params.target.projectId ?? null,
            parentIssueId: params.target.parentIssueId ?? null,
            assigneeAgentId: params.target.assigneeAgentId ?? null,
            assigneeUserId: params.target.assigneeUserId ?? null,
          },
        });
      },

View on GitHub (pinned to a7e689b3c3)

Solutions

  1. Check that the policy resource identifier exists; list policy resources for the company and use a valid one.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/services/plugin-host-services.ts:3143 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/c3db7db00abc9535. Report an issue: GitHub.