{"record":{"id":"b4f38f7c9e00ef41","repo":"alibaba/nacos","slug":"resource-not-found-b4f38f","errorCode":"RESOURCE_NOT_FOUND","errorMessage":"Pipeline execution not found: {pipelineId}","messagePattern":"Pipeline execution not found: (.+?)","errorType":"http","errorClass":"NacosApiException","httpStatus":404,"severity":"error","filePath":"ai/src/main/java/com/alibaba/nacos/ai/service/pipeline/PipelineQueryService.java","lineNumber":55,"sourceCode":"public class PipelineQueryService {\n    \n    private final PipelineExecutionRepository repository;\n    \n    public PipelineQueryService(PipelineExecutionRepository repository) {\n        this.repository = repository;\n    }\n    \n    /**\n     * Get a single pipeline execution by ID.\n     *\n     * @param pipelineId the execution ID\n     * @return the pipeline execution\n     * @throws NacosException if not found\n     */\n    public PipelineExecution getPipeline(String pipelineId) throws NacosException {\n        PipelineExecution execution = repository.findById(pipelineId);\n        if (execution == null) {\n            throw new NacosApiException(HttpStatus.NOT_FOUND.value(), ErrorCode.RESOURCE_NOT_FOUND,\n                \"Pipeline execution not found: \" + pipelineId);\n        }\n        return execution;\n    }\n    \n    /**\n     * List pipeline executions with pagination.\n     *\n     * @param resourceType the resource type (required)\n     * @param resourceName the resource name (optional)\n     * @param namespaceId  the namespace ID (optional)\n     * @param version      the version (optional)\n     * @param pageNo       the page number (1-based)\n     * @param pageSize     the page size\n     * @return paginated results\n     * @throws NacosException if query fails\n     */\n    public Page<PipelineExecution> listPipelines(String resourceType, String resourceName,","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/service/pipeline/PipelineQueryService.java#L37-L73","documentation":"Thrown by PipelineQueryService.getPipeline when repository.findById(pipelineId) returns null — no pipeline execution record exists for the given ID. Pipelines are execution records (not definitions), so the ID must reference a concrete run that was created and persisted. Reported as RESOURCE_NOT_FOUND with HTTP 404 (uses HttpStatus.NOT_FOUND.value()).","triggerScenarios":"GET /pipeline/{pipelineId} with an ID that was never created; an ID from a deleted/expired execution; a malformed or truncated ID; referencing an execution from a different cluster/namespace store.","commonSituations":"Client polling an old execution ID after retention cleanup; typo or copy error in the ID; execution stored in-memory (volatile repository) and lost on restart; cross-environment ID that does not exist locally.","solutions":["Use the listPipelines endpoint to find a valid execution ID for the resource.","Start a new pipeline execution to obtain a fresh ID.","Verify the repository backend (in-memory vs persistent) matches your durability expectations; configure persistence if executions must survive restarts.","Handle the 404 in the client and surface a 'not found / expired' message to the user."],"exampleFix":"// before\nexec = pipelineQueryService.getPipeline(\"old-or-invalid-id\"); // 404\n// after\nPage<PipelineExecution> page = pipelineQueryService.listPipelines(rt, rn, ns, ver, 1, 20);\nif (page.getPageItems().isEmpty()) {\n    exec = pipelineService.start(rt, rn, ns, ver); // create a new run\n} else {\n    exec = pipelineQueryService.getPipeline(page.getPageItems().get(0).getId());\n}","handlingStrategy":"validation","validationCode":"// Verify the execution ID exists before fetching\nif (pipelineId == null || pipelineId.isBlank()\n    || !pipelineRepository.existsById(pipelineId)) {\n    throw new IllegalArgumentException(\"Unknown pipelineId: \" + pipelineId);\n}\nexec = pipelineQueryService.getPipeline(pipelineId);","typeGuard":null,"tryCatchPattern":"try {\n    exec = pipelineQueryService.getPipeline(id);\n} catch (NacosApiException e) {\n    if (e.getErrCode() == HttpStatus.NOT_FOUND.value()) {\n        // list recent executions or start a new one\n        Page<PipelineExecution> p = pipelineQueryService.listPipelines(rt, rn, ns, ver, 1, 1);\n        exec = p.getPageItems().isEmpty() ? startNew(rt, rn, ns, ver)\n            : pipelineQueryService.getPipeline(p.getPageItems().get(0).getId());\n    } else { throw e; }\n}","preventionTips":["Use IDs returned by start/list endpoints; do not construct IDs manually.","Configure a persistent repository if executions must survive restarts.","Expire/clear client references to executions after retention cleanup."],"tags":["pipeline","resource-not-found","execution","query","nacos-ai"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}