apache/beam · error · IOException

Something went wrong

Error message

Something went wrong

What it means

ChangeStreamDao.readChangeStreamPartition builds a ReadChangeStreamQuery from its parameters. Exactly one of continuationToken, startTime, or a continuation token list must be provided; if all are null the DAO cannot construct a valid query and throws IOException "Something went wrong" as a (poorly-worded) catch-all.

Solutions

  1. Always supply a start position: pass a startTimestamp (e.g. pipeline start time) when no continuation token exists.
  2. Restore the last committed continuation token from the connector's metadata table before resuming.
  3. Check pipeline options/runner state restoration so the source restriction is initialized with a valid token.

Example fix

// before
dao.readChangeStreamPartition(partition, null, null, heartbeat, tokenList == null ? null : tokenList);
// after
org.joda.time.Instant start = token != null ? null : pipelineStartTime; // ensure one is set
dao.readChangeStreamPartition(partition, start, token, heartbeat, tokenList);
Defensive patterns

Strategy: validation

Validate before calling

if (currentToken == null && startTime == null
    && (changeStreamContinuationTokenList == null || changeStreamContinuationTokenList.isEmpty())) {
  startTime = org.joda.time.Instant.now(); // or a known pipeline start; do not call the DAO with all null
}

Try / catch

try {
  dao.readChangeStreamPartition(partition, startTime, token, heartbeat, tokenList);
} catch (IOException e) {
  if (e.getMessage().contains("Something went wrong")) {
    // no start position provided: recover token from metadata table or default to a start time
  }
}

Prevention

When it happens

Trigger: Calling readChangeStreamPartition with startTime == null, currentToken == null, and changeStreamContinuationTokenList == null simultaneously — i.e. no start position of any kind for the change stream.

Common situations: Pipeline restart where the DoFn's checkpointed continuation token was lost or never initialized; programmatic use of the DAO without setting a start time or token; a bug/resume-path leaving the restriction state empty.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/d55eb6bedb4e2278. Report an issue: GitHub.

Appendix: source

Thrown at sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/changestreams/dao/ChangeStreamDao.java:89

      StreamProgress streamProgress,
      @Nullable Instant endTime,
      Duration heartbeatDuration)
      throws IOException {
    ReadChangeStreamQuery query =
        ReadChangeStreamQuery.create(tableId).streamPartition(partition.getPartition());

    ChangeStreamContinuationToken currentToken = streamProgress.getCurrentToken();
    Instant startTime = partition.getStartTime();
    List<ChangeStreamContinuationToken> changeStreamContinuationTokenList =
        partition.getChangeStreamContinuationTokens();
    if (currentToken != null) {
      query.continuationTokens(Collections.singletonList(currentToken));
    } else if (startTime != null) {
      query.startTime(toThreetenInstant(startTime));
    } else if (changeStreamContinuationTokenList != null) {
      query.continuationTokens(changeStreamContinuationTokenList);
    } else {
      throw new IOException("Something went wrong");
    }
    if (endTime != null) {
      query.endTime(TimestampConverter.toThreetenInstant(endTime));
    }
    query.heartbeatDuration(org.threeten.bp.Duration.ofMillis(heartbeatDuration.getMillis()));
    return dataClient.readChangeStream(query);
  }
}

View on GitHub (pinned to 12126d8942)