{"record":{"id":"bca53ddac019d76b","repo":"alibaba/DataX","slug":"property-key-length-over-limit-maxpropkeylength","errorCode":null,"errorMessage":"property key length over limit(${maxPropKeyLength})","messagePattern":"property key 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":56,"sourceCode":"        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) {\n            final int maxPropValueLength = MapperConfig.getInstance().getMaxPropValueLength();\n            if (((String)propValue).length() > maxPropKeyLength) {\n                throw new IllegalArgumentException(\"property value length over limit(\" + maxPropValueLength + \")\");\n            }\n        }\n\n        this.properties.add(new GdbProperty(propKey, propValue, card));\n    }\n\n    public void addProperty(final String propKey, final Object propValue) {\n        addProperty(propKey, propValue, PropertyType.single);\n    }\n\n    @Override\n    public String toString() {\n        final StringBuffer sb = new StringBuffer(this.id + \"[\" + this.label + \"]{\");","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/alibaba/DataX/blob/80ec23d5c5328eb90ca364d2749e92dfaf44541e/gdbwriter/src/main/java/com/alibaba/datax/plugin/writer/gdbwriter/model/GdbElement.java#L38-L74","documentation":"GdbElement.addProperty rejects property keys longer than MapperConfig.getMaxPropKeyLength() with IllegalArgumentException. Note an adjacent bug: the string *value* length check compares against maxPropKeyLength, not maxPropValueLength, but throws the 'property value length over limit' message printing maxPropValueLength — so over-long string values may be rejected by the wrong limit or wrongly pass.","triggerScenarios":"Property keys built dynamically from data (column-name arrays, composite property names like 'addr.line1.city') exceeding the key-length limit; string property values longer than the limit hitting the (buggy) value check immediately after this key check.","commonSituations":"Flattening nested JSON into dotted property keys; i18n/long descriptive column names mapped straight to GDB property keys; large text columns (descriptions, bodies) as string property values tripping the value-length branch with a misleading threshold.","solutions":["Shorten/mapping-rename property keys to a bounded vocabulary (GDB recommends short keys — they are stored per element)","For long text values, store externally (OSS/S3) and keep a reference in the property, or truncate","If you control the build, fix the value-check bug: compare ((String)propValue).length() > maxPropValueLength, not maxPropKeyLength","Pre-scan source column names and lengths before migration"],"exampleFix":"// before (in GdbElement.addProperty)\nif (((String)propValue).length() > maxPropKeyLength) {\n    throw new IllegalArgumentException(\"property value length over limit(\" + maxPropValueLength + \")\");\n}\n// after\nif (((String)propValue).length() > maxPropValueLength) {\n    throw new IllegalArgumentException(\"property value length over limit(\" + maxPropValueLength + \")\");\n}","handlingStrategy":"validation","validationCode":"static String safePropKey(String key, int max) {\n    return key.length() <= max ? key : \"p_\" + DigestUtils.md5Hex(key);\n}\n// NOTE: also beware the value-length bug: values are compared to maxPropKeyLength, not maxPropValueLength","typeGuard":"static boolean isValidPropKey(String k) {\n    return k != null && !k.isEmpty() && k.length() <= MapperConfig.getInstance().getMaxPropKeyLength();\n}","tryCatchPattern":"catch (IllegalArgumentException e) {\n    String m = e.getMessage();\n    if (m != null && m.startsWith(\"property key length over limit\")) { /* shorten keys */ }\n    else if (m != null && m.startsWith(\"property value length over limit\")) { /* offload/truncate long text; remember the threshold check itself is buggy */ }\n}","preventionTips":["Map long source column names to short GDB property keys in the writer column config","Keep property keys short by design — they are stored per element and bloat storage","If building the plugin yourself, fix the value-check that compares against maxPropKeyLength while printing maxPropValueLength"],"tags":["gdb","graph","validation","property","bug"],"backgroundTag":null,"analyzedSha":"80ec23d5c5328eb90ca364d2749e92dfaf44541e","analyzedAt":"2026-08-14T15:33:51.187Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}