alibaba/DataX · error · IllegalArgumentException

request length over limit(${maxRequestLength})

Error message

request length over limit(${maxRequestLength})

What it means

Thrown by ScriptGdbGraph.checkSplitDsl when the Gremlin script request built for one element exceeds maxRequestLength (the GDB server's script-request size cap). For the first add of an element the length is requestLength + attachLength (DSL text plus attachment bytes), so a single oversized element cannot be split further and fails immediately.

Source

Thrown at gdbwriter/src/main/java/com/alibaba/datax/plugin/writer/gdbwriter/model/ScriptGdbGraph.java:146

                firstAdd = false;
                subParams.clear();
                requestLength = idLength;
            }

            requestLength += appendLength;
            subParams.add(entry);
        }
        if (!subParams.isEmpty() || firstAdd) {
            checkSplitDsl(firstAdd, requestLength, attachLength, 0, 0);
            setGraphDbElement(element, subParams, isVertex, firstAdd);
        }
    }

    private boolean checkSplitDsl(final boolean firstAdd, final int requestLength, final int attachLength, final int appendLength,
								  final int propNum) {
        final int length = firstAdd ? requestLength + attachLength : requestLength;
        if (length > this.maxRequestLength) {
            throw new IllegalArgumentException("request length over limit(" + this.maxRequestLength + ")");
        }
        return length + appendLength > this.maxRequestLength || propNum >= this.propertiesBatchNum;
    }

    private Tuple2<String, Map<String, Object>> buildDsl(final GdbElement element, final List<GdbElement.GdbProperty> properties,
														 final boolean isVertex, final boolean firstAdd) {
        final Map<String, Object> params = new HashMap<>();
        final StringBuilder sb = new StringBuilder();
        if (isVertex) {
            sb.append(firstAdd ? ADD_V_START : UPDATE_V_START);
        } else {
            sb.append(firstAdd ? ADD_E_START : UPDATE_E_START);
        }

        for (int i = 0; i < properties.size(); i++) {
            final GdbElement.GdbProperty prop = properties.get(i);

            sb.append(".property(");

View on GitHub (pinned to 80ec23d5c5)

Solutions

  1. Reduce per-element payload size: drop, truncate, or shrink large property values in the transformation step before they reach gdbwriter.
  2. Lower the number of properties attached in the first request (propertiesBatchNum / mapper settings) so more properties go into follow-up update requests.
  3. Verify the value of maxRequestLength in the gdbwriter config and align it with what the GDB server actually accepts; do not set it above the server cap.

Example fix

// before
record.put("description", hugeJsonString); // 8MB string
// after
record.put("description", hugeJsonString.substring(0, 60_000)); // keep within request cap
Defensive patterns

Strategy: validation

Validate before calling

// estimate serialized size before writing
int est = elementDslLength + serializedPropertyBytes(element);
if (est > maxRequestLength) {
    // split/shrink properties or fail this record with a clear message
}

Try / catch

try {
    graph.setGraphDbElement(element, subParams, isVertex, firstAdd);
} catch (IllegalArgumentException e) {
    // deterministic data-size failure: shrink the element's properties, do not retry unchanged
}

Prevention

When it happens

Trigger: Writing a vertex or edge whose accumulated DSL text plus attached property payloads (firstAdd case in setGraphDbElement -> checkSplitDsl(firstAdd=true, ...)) exceeds this.maxRequestLength; the batching logic can defer properties to follow-up requests, but a single element whose first request already exceeds the cap aborts.

Common situations: Importing elements with very large or very many String properties (JSON blobs, long text) into Alibaba GDB; multi-MB payloads per row; maxRequestLength left at default while source columns grew.

Related errors


AI-assisted analysis of alibaba/DataX@80ec23d5c5 (2026-08-14). Data as JSON: /api/errors/9eb530275f7c34f0. Report an issue: GitHub.