{"record":{"id":"fbae1bb9551df2f9","repo":"actualbudget/actual","slug":"pluggy-credentials-are-not-configured","errorCode":null,"errorMessage":"Pluggy credentials are not configured","messagePattern":"Pluggy credentials are not configured","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/sync-server/src/app-pluggyai/pluggyai-service.js","lineNumber":51,"sourceCode":"    SecretName.pluggyai_clientSecret,\n    credentialFileId,\n  );\n\n  return {\n    cacheKey: JSON.stringify({\n      fileId: credentialFileId,\n      [SecretName.pluggyai_clientId]: clientId,\n      [SecretName.pluggyai_clientSecret]: clientSecret,\n    }),\n    clientId,\n    clientSecret,\n  };\n}\n\nfunction getPluggyClient(fileId) {\n  const credentialSource = getCredentialSource(fileId);\n  if (!credentialSource) {\n    throw new Error('Pluggy credentials are not configured');\n  }\n\n  const credentialFileId =\n    credentialSource === 'per-budget-file' ? fileId : null;\n  const { cacheKey, clientId, clientSecret } =\n    getCredentialsCacheEntry(credentialFileId);\n  let pluggyClient = pluggyClients.get(cacheKey);\n  if (!pluggyClient) {\n    pluggyClient = new PluggyClient({\n      clientId,\n      clientSecret,\n    });\n    pluggyClients.set(cacheKey, pluggyClient);\n  }\n\n  return pluggyClient;\n}\n","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/actualbudget/actual/blob/d4334cb6e6123f4d3bcea1ad6166608884c7e658/packages/sync-server/src/app-pluggyai/pluggyai-service.js#L33-L69","documentation":"getPluggyClient builds a PluggyClient from credentials stored in the secrets service. It resolves credentials either per-budget-file or globally; if neither source has clientId, clientSecret, and itemIds configured, it throws 'Pluggy credentials are not configured'. The server refuses to create a Pluggy client without credentials rather than failing later with an auth error from Pluggy.","triggerScenarios":"Calling any pluggyaiService method (e.g. getAccountsByItemId, getTransactions) when secrets pluggyai_clientId, pluggyai_clientSecret, or pluggyai_itemIds are missing both globally and for the given budget fileId.","commonSituations":"Self-hosted sync server without PLUGGAI_CLIENT_ID/PLUGGAI_CLIENT_SECRET/PLUGGAI_ITEM_IDS env vars set; per-budget secrets configured for a different budget file than the one being synced; credentials were deleted or the server was restarted with a different environment.","solutions":["Set the Pluggy credentials (PLUGGAI_CLIENT_ID, PLUGGAI_CLIENT_SECRET, PLUGGAI_ITEM_IDS) on the sync server environment and restart it.","If using per-budget secrets, open the specific budget and set the three Pluggy secrets in that budget's settings.","Verify isConfigured(fileId) returns true before triggering a Pluggy sync.","Check which credential source applies (per-budget vs global) and make sure the intended one is populated."],"exampleFix":"// before (server env)\n# no pluggy vars\n\n// after (server env)\nPLUGGAI_CLIENT_ID=your-client-id\nPLUGGAI_CLIENT_SECRET=your-client-secret\nPLUGGAI_ITEM_IDS=item-1,item-2","handlingStrategy":"validation","validationCode":"if (!pluggyaiService.isConfigured(fileId)) {\n  throw new Error('Pluggy credentials missing: set PLUGGAI_CLIENT_ID, PLUGGAI_CLIENT_SECRET, PLUGGAI_ITEM_IDS');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check isConfigured(fileId) before offering/triggering Pluggy sync in the UI.","Document required PLUGGAI_* env vars in deployment setup.","Verify secrets on server startup and fail fast with a clear message."],"tags":["pluggyai","configuration","missing-credentials"],"backgroundTag":"missing-env-var","analyzedSha":"d4334cb6e6123f4d3bcea1ad6166608884c7e658","analyzedAt":"2026-08-29T01:02:11.213Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}