{"record":{"id":"37fb6d3b751effb1","repo":"floci-io/floci","slug":"resourcenotfoundexception-37fb6d","errorCode":"ResourceNotFoundException","errorMessage":"Export {exportArn} not found.","messagePattern":"Export (.+?) not found\\.","errorType":"exception","errorClass":"AwsException","httpStatus":400,"severity":"error","filePath":"src/main/java/io/github/hectorvent/floci/services/bcmdataexports/BcmDataExportsService.java","lineNumber":191,"sourceCode":"            return null;\n        }\n        exportStore.delete(key);\n        // Also remove any executions tied to this export to avoid orphan records.\n        String execPrefix = exportArn + \"::\";\n        for (String execKey : new ArrayList<>(executionStore.keys())) {\n            if (execKey.startsWith(execPrefix)) {\n                executionStore.delete(execKey);\n            }\n        }\n        LOG.infov(\"Deleted BCM export: {0}\", exportArn);\n        return existing;\n    }\n\n    /** {@code ListExecutions} — returns every recorded execution for the export. */\n    public List<ExportExecution> listExecutions(String exportArn) {\n        requireNonEmpty(exportArn, \"ExportArn\");\n        if (exportStore.get(exportKey(exportArn)).isEmpty()) {\n            throw new AwsException(\"ResourceNotFoundException\",\n                    \"Export \" + exportArn + \" not found.\", 400);\n        }\n        String prefix = exportArn + \"::\";\n        return new ArrayList<>(executionStore.scan(key -> key.startsWith(prefix)));\n    }\n\n    /** {@code GetExecution} — returns one execution record. */\n    public ExportExecution getExecution(String exportArn, String executionId) {\n        requireNonEmpty(exportArn, \"ExportArn\");\n        requireNonEmpty(executionId, \"ExecutionId\");\n        return executionStore.get(executionKey(exportArn, executionId))\n                .orElseThrow(() -> new AwsException(\"ResourceNotFoundException\",\n                        \"Execution \" + executionId + \" not found.\", 400));\n    }\n\n    // ── Internal helpers exposed package-private for the emitter (next step) ──\n\n    /**","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/floci-io/floci/blob/62ff490619e7bd3554597c28c704081b4c15add5/src/main/java/io/github/hectorvent/floci/services/bcmdataexports/BcmDataExportsService.java#L173-L209","documentation":"Thrown by Floci's BCM Data Exports emulator from ListExecutions when the supplied ExportArn does not exist in the export store. The service requires a non-empty ARN and an existing export before scanning its execution records; missing exports yield ResourceNotFoundException. Note the emulator returns HTTP 400 here whereas real AWS uses 404 for this error code.","triggerScenarios":"bcmDataExportsClient.listExecutions(r -> r.exportArn(arn)) with an ARN of a deleted or never-created export, or an ARN with a wrong export name segment.","commonSituations":"Polling executions of an export that failed to create earlier in the workflow; using an ARN from a previous emulator session after storage reset; deleting the export then continuing to poll; malformed ARN built by hand.","solutions":["Confirm the export exists via GetExport/ListExports and use its exact exportArn.","If the export was deleted, stop polling; executions are removed with the export.","Capture and persist the exportArn returned by CreateExport instead of constructing ARNs manually.","Recreate the export if the workflow requires execution history."],"exampleFix":"// before\nbcm.listExecutions(r -> r.exportArn(\"arn:aws:bcm-data-exports:us-east-1:123456789012:export/guess\"));\n\n// after\nString arn = bcm.createExport(r -> r.name(\"cost\").dataQuery(dq).refreshCadence(rc)).exportArn();\nbcm.listExecutions(r -> r.exportArn(arn));","handlingStrategy":"validation","validationCode":"Optional<String> arn = bcm.listExports().exports().stream()\n    .map(ExportSummary::exportArn)\n    .filter(a -> a.equals(candidateArn)).findFirst();\nif (arn.isEmpty()) { /* do not poll executions */ }","typeGuard":null,"tryCatchPattern":"try {\n    bcm.listExecutions(r -> r.exportArn(arn));\n} catch (software.amazon.awssdk.services.bcmdataexports.model.ResourceNotFoundException e) {\n    // export gone: stop the polling loop\n}","preventionTips":["Persist the exportArn from CreateExport and use it for all subsequent calls.","DeleteExport should cancel any execution-polling job.","Never build the ARN by string concatenation."],"tags":["bcm-data-exports","resource-not-found","floci","java"],"backgroundTag":null,"analyzedSha":"62ff490619e7bd3554597c28c704081b4c15add5","analyzedAt":"2026-08-14T14:25:23.764Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}