{"record":{"id":"f24dd4480f3a6f06","repo":"paperclipai/paperclip","slug":"paperclip-runner-aws-agentcore-profile-invalid","errorCode":"paperclip_runner_aws_agentcore_profile_invalid","errorMessage":"The qualified AWS AgentCore profile is missing ${key}.","messagePattern":"The qualified AWS AgentCore profile is missing (.+?)\\.","errorType":"error_code","errorClass":"PaperclipRunnerProviderProfileError","httpStatus":null,"severity":"error","filePath":"server/src/services/native-runtime/provider-profile.ts","lineNumber":554,"sourceCode":"  if (profile.provider === \"aws_agentcore\") {\n    const stored = input.agentCoreProfile;\n    if (\n      !stored\n      || (\n        profile.agentCoreProfileId !== stored.id\n        && profile.agentCoreProfileId !== stored.profileKey\n      )\n    ) {\n      throw new PaperclipRunnerProviderProfileError(\n        \"paperclip_runner_aws_agentcore_profile_mismatch\",\n        \"The qualified AWS AgentCore profile does not match the adapter selection.\",\n      );\n    }\n    const remote = asRecord(stored.configuration);\n    const required = (key: string): string => {\n      const value = optionalString(remote[key]);\n      if (!value) {\n        throw new PaperclipRunnerProviderProfileError(\n          \"paperclip_runner_aws_agentcore_profile_invalid\",\n          `The qualified AWS AgentCore profile is missing ${key}.`,\n        );\n      }\n      return value;\n    };\n    if (remote.eventExpiryDays !== 90) {\n      throw new PaperclipRunnerProviderProfileError(\n        \"paperclip_runner_aws_agentcore_retention_unqualified\",\n        \"The qualified AWS AgentCore profile must retain Memory events for exactly 90 days.\",\n      );\n    }\n    const maxEstimatedSessionCostUsd = profile.maxEstimatedSessionCostUsd\n      ?? positiveNumberOrNull(\n        remote.defaultMaxEstimatedSessionCostUsd,\n        \"paperclip_runner_aws_agentcore_spend_cap_invalid\",\n        \"The AWS AgentCore profile requires a positive estimated session spend ceiling.\",\n      );","sourceCodeStart":536,"sourceCodeEnd":572,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/native-runtime/provider-profile.ts#L536-L572","documentation":"The AWS AgentCore profile's stored configuration record must contain a complete set of ARNs/identifiers (region, accountId, harnessArn, harnessVersion, endpointArn, endpointQualifier, agentRuntimeArn, memoryArn, memoryId, invocationRoleArn, contextBucket, contextPrefix, contextKmsKeyArn, qualificationRevision, defaultModel). The local required() closure throws whenever a key is absent or empty, naming the missing key in the message. Each key is read via required() while assembling the resolved agentCoreProfile input.","triggerScenarios":"resolvePaperclipRunnerNativeProviderInput runs with provider=aws_agentcore and stored.configuration lacks one of the required keys — e.g. required('memoryId') or required('contextKmsKeyArn') finds undefined/empty string. The message interpolates the exact missing key, e.g. 'The qualified AWS AgentCore profile is missing memoryId.'","commonSituations":"A partially completed AgentCore qualification/provisioning flow that stored configuration before all resources were created; a CloudFormation/CDK stack failing mid-way so e.g. endpointArn never populated; manual JSON editing of the configuration column dropping a field; schema drift after an upgrade adds a new required key to old profiles.","solutions":["Read the message's ${key} to identify the missing field, then populate it in the stored profile configuration via the AgentCore profile service/API.","Re-run the AgentCore qualification flow so all resources (memory, endpoint, harness, context bucket/KMS) are provisioned and their identifiers saved.","If an AWS resource is genuinely missing (e.g. the KMS key or endpoint), recreate it and update configuration with the new ARN.","Compare the stored configuration object against the full required-key list in provider-profile.ts:585-599 and backfill every gap."],"exampleFix":"// before (stored configuration)\n{ \"region\": \"us-east-1\", \"accountId\": \"111122223333\", \"memoryArn\": \"arn:...\" }\n// after (missing key added)\n{ \"region\": \"us-east-1\", \"accountId\": \"111122223333\", \"memoryArn\": \"arn:...\", \"memoryId\": \"mem-abc123\", \"contextKmsKeyArn\": \"arn:aws:kms:...\" }","handlingStrategy":"validation","validationCode":"const REQUIRED_AGENTCORE_KEYS = [\"region\",\"accountId\",\"harnessArn\",\"harnessVersion\",\"endpointArn\",\"endpointQualifier\",\"agentRuntimeArn\",\"memoryArn\",\"memoryId\",\"invocationRoleArn\",\"contextBucket\",\"contextPrefix\",\"contextKmsKeyArn\",\"qualificationRevision\",\"defaultModel\"] as const;\nconst missing = REQUIRED_AGENTCORE_KEYS.filter(k => !storedProfile.configuration?.[k]);\nif (missing.length) throw new Error(`AgentCore profile incomplete; missing: ${missing.join(\", \")}`);","typeGuard":"const hasAllAgentCoreKeys = (\n  c: Record<string, unknown> | null | undefined,\n): c is Record<(typeof REQUIRED_AGENTCORE_KEYS)[number], string> =>\n  !!c && REQUIRED_AGENTCORE_KEYS.every(k => typeof c[k] === \"string\" && c[k].length > 0);","tryCatchPattern":"try {\n  await executeRun(run);\n} catch (e) {\n  if (e instanceof PaperclipRunnerProviderProfileError && e.code === \"paperclip_runner_aws_agentcore_profile_invalid\") {\n    const key = /missing (\\w+)\\.$/.exec(e.message)?.[1];\n    throw new Error(`Re-run AgentCore qualification to populate configuration.${key}`);\n  }\n  throw e;\n}","preventionTips":["Run qualification to completion before marking a profile qualified","Check CloudFormation/CDK stack status — partial deploys leave configuration keys empty","Diff stored configuration against the required-key list after every schema upgrade","Block profile activation until all required keys are non-empty strings"],"tags":["configuration","aws-agentcore","incomplete-config","provider-profile"],"backgroundTag":"missing-config-field","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-02T18:44:00.616Z","contentChangedAt":"2026-09-02T18:44:00.616Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}