{"record":{"id":"84319c442dd2c729","repo":"alibaba/DataX","slug":"property-value-length-over-limit-maxpropvaluelen","errorCode":null,"errorMessage":"property value length over limit(${maxPropValueLength})","messagePattern":"property value 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":61,"sourceCode":"    }\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 + \"]{\");\n        this.properties.forEach(n -> {\n            sb.append(n.cardinality.name());\n            sb.append(\"[\");\n            sb.append(n.key);\n            sb.append(\" - \");","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/alibaba/DataX/blob/80ec23d5c5328eb90ca364d2749e92dfaf44541e/gdbwriter/src/main/java/com/alibaba/datax/plugin/writer/gdbwriter/model/GdbElement.java#L43-L79","documentation":"Thrown by GdbElement.addProperty when a String property value exceeds the configured maximum length from MapperConfig. Note a bug in this code: the check compares propValue.length() against maxPropKeyLength (not maxPropValueLength), while the message reports maxPropValueLength — so the reported limit may not be the limit actually enforced. It is an IllegalArgumentException raised during record assembly before any network call.","triggerScenarios":"Calling gdbwriter's row-to-GdbElement conversion (addProperty) with a vertex/edge property whose String value length exceeds MapperConfig.getInstance().getMaxPropKeyLength(). Non-String property values never trigger it.","commonSituations":"Loading source columns containing long JSON blobs, base64 strings, URLs with query strings, or free-text descriptions into GDB vertex properties; defaults for maxPropKeyLength/maxPropValueLength left untouched.","solutions":["Shorten or truncate the offending property value at source (transform step or SQL substring) so it fits the limit.","If the data legitimately needs longer values, raise the value-length limit in the gdbwriter job configuration (MapperConfig maxPropValueLength) within server limits.","Patch the comparison bug: change 'if (((String)propValue).length() > maxPropKeyLength)' to use maxPropValueLength so the enforced limit matches the message."],"exampleFix":"// before\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":"int maxLen = MapperConfig.getInstance().getMaxPropValueLength();\nObject v = record.getColumn(i).asObject();\nif (v instanceof String && ((String) v).length() > maxLen) {\n    // truncate or reject before addProperty\n    v = ((String) v).substring(0, maxLen);\n}","typeGuard":null,"tryCatchPattern":"try {\n    element.addProperty(key, value);\n} catch (IllegalArgumentException e) {\n    // log offending key/value length and fail the record, not the whole task\n    throw DataXException.asDataXException(GdbWriterErrorCode.ILLEGAL_VALUE, \"prop too long: \" + key, e);\n}","preventionTips":["Profile source column max lengths before a GDB load and cap them in the transform step.","Set maxPropKeyLength/maxPropValueLength explicitly in the job config instead of relying on defaults.","Be aware the current check compares against maxPropKeyLength — the enforced limit differs from the message."],"tags":["gdb","graph-database","datax","validation","property-limit"],"backgroundTag":null,"analyzedSha":"80ec23d5c5328eb90ca364d2749e92dfaf44541e","analyzedAt":"2026-08-14T15:33:51.187Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}