gchq/CyberChef · error · OperationError

Please provide an input.

Error message

Please provide an input.

What it means

Thrown by AvroToJSON.run when the input ArrayBuffer has byteLength <= 0. The operation decodes Apache Avro binary container blocks via avro.streams.BlockDecoder, which requires actual bytes to parse; an empty input would produce no blocks and a meaningless result, so it is rejected up front.

Source

Thrown at src/core/operations/AvroToJSON.mjs:44

        this.inputType = "ArrayBuffer";
        this.outputType = "string";
        this.args = [
            {
                name: "Force Valid JSON",
                type: "boolean",
                value: true
            }
        ];
    }

    /**
     * @param {ArrayBuffer} input
     * @param {Object[]} args
     * @returns {string}
     */
    async run(input, args) {
        if (input.byteLength <= 0) {
            throw new OperationError("Please provide an input.");
        }

        const forceJSON = args[0];

        return new Promise((resolve, reject) => {
            const result = [];
            const inpArray = new Uint8Array(input);
            const decoder = new avro.streams.BlockDecoder();

            decoder
                .on("data", function (obj) {
                    result.push(obj);
                })
                .on("error", function () {
                    reject(new OperationError("Error parsing Avro file."));
                })
                .on("end", function () {
                    if (forceJSON) {

View on GitHub (pinned to 4290ea7539)

Solutions

  1. Provide non-empty Avro container binary data as the input.
  2. If chaining operations, ensure the upstream step actually produced bytes (check its output length).
  3. Load a real .avro file rather than leaving the input pane empty.

Example fix

// before
chef.avroToJSON("");

// after - feed actual Avro container bytes
chef.avroToJSON(avroBinaryString);
Defensive patterns

Strategy: validation

Validate before calling

function assertNonEmpty(input) {
  const len = input?.byteLength ?? input?.length ?? 0;
  if (len <= 0) throw new Error("AvroToJSON requires non-empty input");
}
assertNonEmpty(input);

Type guard

function hasBytes(x) {
  return (x instanceof ArrayBuffer && x.byteLength > 0)
      || (ArrayBuffer.isView(x) && x.byteLength > 0)
      || (typeof x === "string" && x.length > 0);
}

Prevention

When it happens

Trigger: Calling the operation with no input text/file, an empty string, or an upstream operation that emitted an empty ArrayBuffer.

Common situations: Recipe run before pasting input; upstream 'From Base64' of an empty string; file input that failed to load producing an empty buffer.

Related errors


AI-assisted analysis of gchq/CyberChef@4290ea7539 (2026-08-13). Data as JSON: /api/errors/6e6b12d5034fedc8. Report an issue: GitHub.