{"record":{"id":"fc7f6c84d12794cf","repo":"alibaba/DataX","slug":"label-length-over-limit-maxlabellength","errorCode":null,"errorMessage":"label length over limit(${maxLabelLength})","messagePattern":"label length over limit\\((.+?)\\)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"gdbwriter/src/main/java/com/alibaba/datax/plugin/writer/gdbwriter/model/GdbElement.java","lineNumber":40,"sourceCode":"        return this.id;\n    }\n\n    public void setId(final String id) {\n        final int maxIdLength = MapperConfig.getInstance().getMaxIdLength();\n        if (id.length() > maxIdLength) {\n            throw new IllegalArgumentException(\"id length over limit(\" + maxIdLength + \")\");\n        }\n        this.id = id;\n    }\n\n    public String getLabel() {\n        return this.label;\n    }\n\n    public void setLabel(final String label) {\n        final int maxLabelLength = MapperConfig.getInstance().getMaxLabelLength();\n        if (label.length() > maxLabelLength) {\n            throw new IllegalArgumentException(\"label length over limit(\" + maxLabelLength + \")\");\n        }\n        this.label = label;\n    }\n\n    public List<GdbProperty> getProperties() {\n        return this.properties;\n    }\n\n    public void addProperty(final String propKey, final Object propValue, final PropertyType card) {\n        if (propKey == null || propValue == null) {\n            return;\n        }\n\n        final int maxPropKeyLength = MapperConfig.getInstance().getMaxPropKeyLength();\n        if (propKey.length() > maxPropKeyLength) {\n            throw new IllegalArgumentException(\"property key length over limit(\" + maxPropKeyLength + \")\");\n        }\n        if (propValue instanceof String) {","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/alibaba/DataX/blob/80ec23d5c5328eb90ca364d2749e92dfaf44541e/gdbwriter/src/main/java/com/alibaba/datax/plugin/writer/gdbwriter/model/GdbElement.java#L22-L58","documentation":"GdbElement.setLabel enforces MapperConfig.getMaxLabelLength() (typically 256) on element labels. A label resolved from the record longer than the limit throws IllegalArgumentException at mapping time. For edges with null id, label is checked after UUID generation — so label length applies equally to vertices and edges.","triggerScenarios":"Label column values exceeding the limit: dynamic labels like 'event_' + timestamp, long descriptive names from a source table's type/department column, or a mapping rule that concatenates fields into the label.","commonSituations":"Label generated from data instead of a fixed constant (e.g. per-category vertex labels from a category description column); denormalized sources where the type column is free text; no label at all is also invalid but fails the earlier 'id or label missed' check instead.","solutions":["Use a short, sanitized label vocabulary (enum-like) instead of free-text labels","Truncate/normalize long label values deterministically in the reader transform or SQL","Pre-check max label length in the source before the migration job"],"exampleFix":"-- before\nSELECT concat('event_', event_name) AS label ...\n-- after\nSELECT concat('event_', md5(event_name)) AS label ...  -- bounded length","handlingStrategy":"validation","validationCode":"static String safeLabel(String raw) {\n    int max = MapperConfig.getInstance().getMaxLabelLength();\n    return raw.length() <= max ? raw : raw.substring(0, max - 8) + \"_\" + DigestUtils.md5Hex(raw).substring(0, 7);\n}","typeGuard":"static boolean isValidGdbLabel(String s) {\n    return s != null && !s.isEmpty() && s.length() <= MapperConfig.getInstance().getMaxLabelLength();\n}","tryCatchPattern":"catch (IllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"label length over limit\")) {\n        // normalize label source to a short controlled vocabulary\n    }\n}","preventionTips":["Use fixed enum-style labels; never derive labels from free-text source columns","Pre-scan label column lengths in the source before the job"],"tags":["gdb","graph","validation","label-length"],"backgroundTag":null,"analyzedSha":"80ec23d5c5328eb90ca364d2749e92dfaf44541e","analyzedAt":"2026-08-14T15:33:51.187Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}