{"record":{"id":"ec796395d383bd18","repo":"iflytek/astron-agent","slug":"user-app-id-not-existe-ec7963","errorCode":"USER_APP_ID_NOT_EXISTE","errorMessage":"USER_APP_ID_NOT_EXISTE","messagePattern":"USER_APP_ID_NOT_EXISTE","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/publish/impl/PublishApprovalServiceImpl.java","lineNumber":286,"sourceCode":"        return PublishApprovalTypeEnum.MARKET == publishType || PublishApprovalTypeEnum.API == publishType;\n    }\n\n    private void validateApprovalTarget(PublishApprovalSubmitDto submitDto) {\n        if (PublishApprovalResourceTypeEnum.BOT == submitDto.getResourceType()) {\n            Integer botId = parseBotId(submitDto.getResourceId());\n            int hasPermission = chatBotBaseMapper.checkBotPermission(\n                    botId,\n                    submitDto.getRequesterUid(),\n                    submitDto.getSpaceId());\n            if (hasPermission <= 0) {\n                throw new BusinessException(ResponseEnum.BOT_NOT_EXISTS);\n            }\n        }\n\n        if (PublishApprovalTypeEnum.API == submitDto.getPublishType()\n                && (StringUtils.isBlank(submitDto.getTargetId())\n                        || appMstService.getByAppId(submitDto.getRequesterUid(), submitDto.getTargetId()) == null)) {\n            throw new BusinessException(ResponseEnum.USER_APP_ID_NOT_EXISTE);\n        }\n    }\n\n    private Integer parseBotId(String resourceId) {\n        if (StringUtils.isBlank(resourceId)) {\n            throw new BusinessException(ResponseEnum.PARAMETER_ERROR);\n        }\n        try {\n            return Integer.valueOf(resourceId);\n        } catch (NumberFormatException e) {\n            throw new BusinessException(ResponseEnum.PARAMETER_ERROR);\n        }\n    }\n\n    private Workflow resolveWorkflow(String resourceId) {\n        if (StringUtils.isBlank(resourceId)) {\n            throw new BusinessException(ResponseEnum.PARAMETER_ERROR);\n        }","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/publish/impl/PublishApprovalServiceImpl.java#L268-L304","documentation":"USER_APP_ID_NOT_EXISTE in validateApprovalTarget is thrown when an API-type publish approval has a blank targetId or the targetId does not resolve to an app_mst record for the requester. The API publish target must reference an existing application owned by the user.","triggerScenarios":"PublishApprovalTypeEnum.API submission with targetId null/blank, or appMstService.getByAppId(requesterUid, targetId) returning null.","commonSituations":"Client omits targetId for API publishes; appId of a deleted app; appId created under another account; publish type set to API without a target.","solutions":["Provide a valid non-blank targetId (existing appId owned by the requester).","Create the app first and use its appId as the target.","Verify app_mst has a row for (requesterUid, targetId).","Confirm the publish type is correct if a BOT approval was intended."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (submitType == PublishApprovalTypeEnum.API\n        && (targetId == null || targetId.isBlank()\n            || appMstService.getByAppId(requesterUid, targetId) == null)) {\n    // invalid/missing appId target; abort before submitting\n    return;\n}","typeGuard":null,"tryCatchPattern":"try {\n    publishApprovalService.submitIfRequired(submitDto);\n} catch (BusinessException e) {\n    if (\"USER_APP_ID_NOT_EXISTE\".equals(String.valueOf(e.getCode()))) {\n        // prompt user to select a valid app as target\n    }\n}","preventionTips":["Require targetId selection in the UI for API publishes.","Validate appId ownership at form time.","Prevent deleting apps referenced by pending approvals."],"tags":["app","not-found","publish-approval"],"backgroundTag":"resource-not-found","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}