{"record":{"id":"65a116b844dcbdbb","repo":"alibaba/spring-ai-alibaba","slug":"system-error","errorCode":"SYSTEM_ERROR","errorMessage":"system error","messagePattern":"system error","errorType":"error_code","errorClass":"BizException","httpStatus":500,"severity":"error","filePath":"spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/base/manager/ProviderManager.java","lineNumber":274,"sourceCode":"\t */\n\tpublic ProviderConfigInfo getProviderDetail(String provider, boolean mask) {\n\t\tRequestContext context = RequestContextHolder.getRequestContext();\n\t\tString workspaceId = context == null ? null : context.getWorkspaceId();\n\t\ttry {\n\t\t\tProviderEntity providerEntity = getProviderEntity(provider, workspaceId);\n\t\t\tif (providerEntity == null) {\n\t\t\t\tlog.error(\"provider [{}]does not exists.\", provider);\n\t\t\t\tthrow new BizException(ErrorCode.INVALID_PARAMS.toError(\"input_params\", \"provider not found\"));\n\t\t\t}\n\n\t\t\treturn toProviderConfig(providerEntity, mask);\n\t\t}\n\t\tcatch (BizException e) {\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tlog.error(\"get provider error: {}\", e.getMessage(), e);\n\t\t\tthrow new BizException(ErrorCode.SYSTEM_ERROR.toError());\n\t\t}\n\t}\n\n\t/**\n\t * Get provider entity from cache or database\n\t * @param provider Provider ID\n\t * @param workspaceId Workspace ID\n\t * @return Provider entity\n\t */\n\tprivate ProviderEntity getProviderEntity(String provider, String workspaceId) {\n\t\tString key = getProviderCacheKey(provider, workspaceId);\n\t\tProviderEntity entity = redisManager.get(key);\n\t\tif (entity != null) {\n\t\t\tif (CACHE_EMPTY_ID.equals(entity.getId())) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn entity;","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/base/manager/ProviderManager.java#L256-L292","documentation":"getProviderDetail wraps any non-BizException thrown during the provider lookup/conversion in BizException(ErrorCode.SYSTEM_ERROR) with message 'system error'. This is a catch-all for unexpected failures — DB/cache access errors, exceptions in toProviderConfig (e.g. decryption or masking of the API key), NPEs, or RequestContextHolder failures. The original exception is logged (log.error with stack trace) but not exposed to the caller.","triggerScenarios":"Any runtime exception inside getProviderDetail other than the intentional 'provider not found' BizException: database connection failure or query error during getProviderEntity's DB fallback, cache client errors, exceptions thrown by toProviderConfig while masking/decrypting credentials, or a NullPointerException on malformed provider data.","commonSituations":"Database down or connection pool exhausted; Redis/cache client misconfigured; provider row contains corrupt or legacy-format credentials that fail decryption during masking; serialization mismatch after a schema/version upgrade.","solutions":["Check the server log for 'get provider error: ...' — it contains the root cause and stack trace","Verify database and cache connectivity from the admin server","Inspect the provider row for corrupt credentials and re-save the API key","After fixing the root cause, retry getProviderDetail"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    ProviderConfig detail = providerManager.getProviderDetail(provider, mask);\n} catch (BizException e) {\n    if (\"system error\".equals(e.getMessage())) {\n        // inspect server log 'get provider error' for root cause; retry after infra check\n    } else {\n        throw e;\n    }\n}","preventionTips":["Monitor database and cache health of the admin server; this error usually means an infra failure","Keep provider credential data schema-compatible across upgrades to avoid masking/decryption failures","Check the server-side log for 'get provider error: {}' — the cause never reaches the client response"],"tags":["system-error","internal","database","provider"],"backgroundTag":"internal-invariant-violation","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}