flowable/flowable-engine · error · FlowableException

IO exception occurred

Error message

IO exception occurred

What it means

Wrapped FlowableException thrown when reading the header text via BufferedReader.readLine() raises an IOException during HttpHeaders.parseFromString. The original IOException is preserved as the cause. It indicates the underlying character source (reader/stream) failed mid-read, not a parsing problem.

Solutions

  1. Check the cause (ex.getCause()) for the real IOException and fix the underlying source
  2. Verify the input stream/file is readable and not closed before calling parseFromString
  3. Read the header text fully into a String first (e.g. with a safe read loop) and pass the String, so IO errors surface before parsing
  4. Add retry/reconnect logic around the source if it is a network stream

Example fix

// before
httpHeaders.parseFromString(new FileReader(maybeMissingFile));
// after
String text = Files.readString(Path.of("headers.txt"));
httpHeaders.parseFromString(text);
Defensive patterns

Strategy: try-catch

Validate before calling

// ensure the source is fully readable before parsing
String headerText;
try (BufferedReader r = new BufferedReader(reader)) {
    headerText = r.lines().collect(Collectors.joining("\n"));
} catch (IOException e) {
    throw new IllegalStateException("Cannot read header source", e);
}

Try / catch

try {
    headers = HttpHeaders.parseFromString(reader);
} catch (FlowableException e) {
    Throwable cause = e.getCause();
    if (cause instanceof IOException) {
        // retry or reconnect to the underlying source
    }
    throw e;
}

Prevention

When it happens

Trigger: parseFromString is given a Reader backed by a socket, file, or stream that fails while reading (connection reset, file IO error, closed stream).

Common situations: Parsing headers read directly from a flaky network connection, a file that was truncated/deleted mid-read, or a stream already closed by another component.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/fc3002b2d2bd3675. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-http-common/src/main/java/org/flowable/http/common/api/HttpHeaders.java:166

            try (BufferedReader reader = new BufferedReader(new StringReader(headersString))) {
                String line = reader.readLine();
                while (line != null) {
                    int colonIndex = line.indexOf(':');
                    if (colonIndex > 0) {
                        String headerName = line.substring(0, colonIndex);
                        if (line.length() > colonIndex + 2) {
                            headers.add(headerName, StringUtils.strip(line.substring(colonIndex + 1)));
                        } else {
                            headers.add(headerName, "");
                        }
                        line = reader.readLine();

                    } else {
                        throw new FlowableIllegalArgumentException("Header line '" + line + "' is invalid");
                    }
                }
            } catch (IOException ex) {
                throw new FlowableException("IO exception occurred", ex);
            }
        }

        return headers;
    }

}

View on GitHub (pinned to d6d39ce1c6)