{"record":{"id":"d55eb6bedb4e2278","repo":"apache/beam","slug":"something-went-wrong","errorCode":null,"errorMessage":"Something went wrong","messagePattern":"Something went wrong","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/changestreams/dao/ChangeStreamDao.java","lineNumber":89,"sourceCode":"      StreamProgress streamProgress,\n      @Nullable Instant endTime,\n      Duration heartbeatDuration)\n      throws IOException {\n    ReadChangeStreamQuery query =\n        ReadChangeStreamQuery.create(tableId).streamPartition(partition.getPartition());\n\n    ChangeStreamContinuationToken currentToken = streamProgress.getCurrentToken();\n    Instant startTime = partition.getStartTime();\n    List<ChangeStreamContinuationToken> changeStreamContinuationTokenList =\n        partition.getChangeStreamContinuationTokens();\n    if (currentToken != null) {\n      query.continuationTokens(Collections.singletonList(currentToken));\n    } else if (startTime != null) {\n      query.startTime(toThreetenInstant(startTime));\n    } else if (changeStreamContinuationTokenList != null) {\n      query.continuationTokens(changeStreamContinuationTokenList);\n    } else {\n      throw new IOException(\"Something went wrong\");\n    }\n    if (endTime != null) {\n      query.endTime(TimestampConverter.toThreetenInstant(endTime));\n    }\n    query.heartbeatDuration(org.threeten.bp.Duration.ofMillis(heartbeatDuration.getMillis()));\n    return dataClient.readChangeStream(query);\n  }\n}\n","sourceCodeStart":71,"sourceCodeEnd":98,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/changestreams/dao/ChangeStreamDao.java#L71-L98","documentation":"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.","triggerScenarios":"Calling readChangeStreamPartition with startTime == null, currentToken == null, and changeStreamContinuationTokenList == null simultaneously — i.e. no start position of any kind for the change stream.","commonSituations":"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.","solutions":["Always supply a start position: pass a startTimestamp (e.g. pipeline start time) when no continuation token exists.","Restore the last committed continuation token from the connector's metadata table before resuming.","Check pipeline options/runner state restoration so the source restriction is initialized with a valid token."],"exampleFix":"// before\ndao.readChangeStreamPartition(partition, null, null, heartbeat, tokenList == null ? null : tokenList);\n// after\norg.joda.time.Instant start = token != null ? null : pipelineStartTime; // ensure one is set\ndao.readChangeStreamPartition(partition, start, token, heartbeat, tokenList);","handlingStrategy":"validation","validationCode":"if (currentToken == null && startTime == null\n    && (changeStreamContinuationTokenList == null || changeStreamContinuationTokenList.isEmpty())) {\n  startTime = org.joda.time.Instant.now(); // or a known pipeline start; do not call the DAO with all null\n}","typeGuard":null,"tryCatchPattern":"try {\n  dao.readChangeStreamPartition(partition, startTime, token, heartbeat, tokenList);\n} catch (IOException e) {\n  if (e.getMessage().contains(\"Something went wrong\")) {\n    // no start position provided: recover token from metadata table or default to a start time\n  }\n}","preventionTips":["Always provide either a start time or a continuation token to the change stream reader.","Persist and restore the last continuation token from the metadata table on restart.","Initialize source restrictions in DoFn.setup()/split() with a valid start position."],"tags":["bigtable","changestream","io","missing-parameter"],"backgroundTag":"missing-required-argument","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}