{"record":{"id":"06908ab4d4a8bab4","repo":"apache/seatunnel","slug":"invalid-graph-schema-06908a","errorCode":"INVALID_GRAPH_SCHEMA","errorMessage":"No read context for label '%s'.","messagePattern":"No read context for label '(.+?)'\\.","errorType":"error_code","errorClass":"HugeGraphConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/source/HugeGraphSourceReader.java","lineNumber":147,"sourceCode":"        this.context = context;\n        this.sourceConfig = sourceConfig;\n        this.labelContexts = labelContexts;\n        this.client = client;\n    }\n\n    /**\n     * The label the given split reads: a LABEL_LIST split names it directly; a SHARD split scans a\n     * key range of all labels and inherits the single configured label (shard splits are only\n     * created in single-label mode).\n     */\n    private String activeLabel(HugeGraphSourceSplit split) {\n        return split.getLabel() != null ? split.getLabel() : sourceConfig.getLabel();\n    }\n\n    private LabelTableContext contextFor(String label) {\n        LabelTableContext ctx = labelContexts.get(label);\n        if (ctx == null) {\n            throw new HugeGraphConnectorException(\n                    HugeGraphConnectorErrorCode.INVALID_GRAPH_SCHEMA,\n                    String.format(\"No read context for label '%s'.\", label));\n        }\n        return ctx;\n    }\n\n    @Override\n    public void open() {\n        // Read-all mode auto-discovers each label's row type from the server, so there is no user\n        // schema to validate against (it cannot mismatch). Skip validation; the reader resolves\n        // each split's context by label at read time.\n        if (sourceConfig.isReadAllLabels()) {\n            return;\n        }\n        try {\n            // validateLabelAndSchema triggers the lazy client connection; if it throws (unknown\n            // label, type mismatch, unreachable server) the framework may not call close(), so\n            // release the just-opened client here to avoid leaking connection pools/threads.","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/source/HugeGraphSourceReader.java#L129-L165","documentation":"HugeGraphSourceReader keeps a map of per-label read contexts (LabelTableContext) built at source initialization. When a split references a label that has no entry in that map, contextFor() fails fast with INVALID_GRAPH_SCHEMA rather than dereferencing null, indicating an internal inconsistency between split enumeration and context building.","triggerScenarios":"A SourceSplit's label (split.getLabel() or sourceConfig.getLabel()) is not a key in labelContexts; called from ctx() or propertyRowType() during read/poll processing.","commonSituations":"Label deleted or renamed between split enumeration and reading; mismatch between the label used when splits were created and the labels captured in contexts (e.g., config changed on restart/recovery from an old checkpoint); all-labels read where labels changed server-side mid-job.","solutions":["Rerun the job with the current config so splits and contexts are rebuilt consistently.","Verify the label still exists in HugeGraph and matches the configured 'label' option.","If recovering from a checkpoint taken with different labels/config, discard the old checkpoint and start fresh.","Report as a bug if it reproduces with an unchanged config — split enumeration and context building should agree."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// ensure split label was part of context building\nif (!labelContexts.containsKey(splitLabel)) { /* rebuild/restart job */ }","typeGuard":null,"tryCatchPattern":"try {\n  LabelTableContext ctx = reader.contextFor(label);\n} catch (HugeGraphConnectorException e) {\n  if (e.getErrorCode() == INVALID_GRAPH_SCHEMA) { /* restart job / discard stale checkpoint */ }\n}","preventionTips":["Avoid changing label config between checkpoint and recovery.","Verify labels are stable (not renamed/deleted) during a job.","Start fresh (no old checkpoint) after label-related config changes."],"tags":["source","reader","state","hugegraph"],"backgroundTag":"internal-invariant-violation","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}