{"record":{"id":"c9976b59a2d765d8","repo":"alibaba/spring-ai-alibaba","slug":"app-not-found","errorCode":"APP_NOT_FOUND","errorMessage":"App can not be found.","messagePattern":"App can not be found\\.","errorType":"error_code","errorClass":"BizException","httpStatus":404,"severity":"error","filePath":"spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/controller/AppComponentController.java","lineNumber":316,"sourceCode":"\t@GetMapping(\"/{appId}/detail-by-appid\")\n\tpublic Result<AppComponent> detailByAppId(@PathVariable(\"appId\") String appId) {\n\t\tRequestContext context = RequestContextHolder.getRequestContext();\n\t\tif (StringUtils.isBlank(appId)) {\n\t\t\tthrow new BizException(ErrorCode.MISSING_PARAMS.toError(\"appId\"));\n\t\t}\n\n\t\ttry {\n\t\t\tAppComponent appComponentByAppId = appComponentService.getAppComponentByAppId(appId,\n\t\t\t\t\tAppComponentStatusEnum.Published.getCode());\n\t\t\tif (appComponentByAppId == null) {\n\t\t\t\treturn Result.success(context.getRequestId(), null);\n\t\t\t}\n\t\t\t// get component inputScheme\n\t\t\tAppComponentConfig appComponentConfig = appComponentManager.getAppComponentInputConfig(appComponentByAppId);\n\n\t\t\tApplication application = appService.getApp(appId);\n\t\t\tif (application == null) {\n\t\t\t\tthrow new BizException(ErrorCode.APP_NOT_FOUND.toError());\n\t\t\t}\n\t\t\t// get application inputScheme\n\t\t\tAppComponentConfig applicationInputConfig = appComponentManager.getApplicationInputConfig(application,\n\t\t\t\t\tfalse);\n\t\t\t// merge component config\n\t\t\tapplicationInputConfig = appComponentManager.mergeConfig(applicationInputConfig, appComponentConfig);\n\t\t\tappComponentByAppId.setConfig(JsonUtils.toJson(applicationInputConfig));\n\t\t\treturn Result.success(appComponentByAppId);\n\n\t\t}\n\t\tcatch (Exception exception) {\n\t\t\tthrow new BizException(ErrorCode.APP_COMPONENT_DETAIL_ERROR.toError());\n\t\t}\n\n\t}\n\n\t/**\n\t * Queries components that reference a specific component.","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/controller/AppComponentController.java#L298-L334","documentation":"Thrown when detailByAppId finds a published AppComponent for the appId, but appService.getApp(appId) returns null for the corresponding Application. It indicates the appId references a component whose underlying application no longer exists (or was never visible), so the detail cannot be assembled.","triggerScenarios":"GET /appComponent/{appId}/detail-by-appid with an appId that has a published app_component row but no matching application record, or calling with an appId the current user/tenant cannot see.","commonSituations":"Application deleted while its component row remains; calling with the component's code instead of the application's appId; wrong workspace/namespace or tenant context; stale cached IDs.","solutions":["Verify the appId exists via the app list/detail API before querying the component detail","Check whether the application was deleted; clean up or republish the orphaned AppComponent","Confirm you are using the appId (not the component code) and that workspace/tenant context matches","Inspect appService.getApp and the underlying application table for the given appId"],"exampleFix":"// before\nGET /appComponent/component-code/detail-by-appid  // wrong identifier\n// after\nGET /appComponent/app-xxxx/detail-by-appid        // use the application's appId","handlingStrategy":"validation","validationCode":"const app = await appApi.getApp(appId); if (!app) throw new Error(`Application ${appId} not found`);","typeGuard":"const appExists = (app) => app !== null && typeof app === 'object' && Boolean(app.appId);","tryCatchPattern":"try { ... } catch (e) { if (e.code === 'APP_NOT_FOUND') { /* refresh app list / restore app */ } else throw e; }","preventionTips":["Resolve the appId from the application list API, not from stale caches","Keep component rows and applications in sync on deletion","Verify tenant/workspace context matches the appId's owner"],"tags":["rest","not-found","app-management"],"backgroundTag":"resource-not-found","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"}