{"record":{"id":"a07464b6eec09476","repo":"apache/beam","slug":"unknown-kinesis-failure-when-trying-to-reach-kinesis","errorCode":null,"errorMessage":"Unknown kinesis failure, when trying to reach kinesis","messagePattern":"Unknown kinesis failure, when trying to reach kinesis","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/kinesis/SimplifiedKinesisClient.java","lineNumber":241,"sourceCode":"      return callable.call();\n    } catch (ExpiredIteratorException e) {\n      throw e;\n    } catch (LimitExceededException | ProvisionedThroughputExceededException e) {\n      throw new KinesisClientThrottledException(\n          \"Too many requests to Kinesis. Wait some time and retry.\", e);\n    } catch (SdkServiceException e) {\n      if (e.isThrottlingException()\n          || SdkDefaultRetrySetting.RETRYABLE_STATUS_CODES.contains(e.statusCode())) {\n        throw new TransientKinesisException(\"Kinesis backend failed. Wait some time and retry.\", e);\n      }\n      throw e; // others, such as 4xx, are not retryable\n    } catch (SdkClientException e) {\n      if (SdkDefaultRetrySetting.RETRYABLE_EXCEPTIONS.contains(e.getClass())) {\n        throw new TransientKinesisException(\"Retryable failure\", e);\n      }\n      throw e;\n    } catch (Exception e) {\n      throw new RuntimeException(\"Unknown kinesis failure, when trying to reach kinesis\", e);\n    }\n  }\n\n  @Override\n  public void close() throws Exception {\n    try (AutoCloseable c1 = kinesis;\n        AutoCloseable c2 = cloudWatch) {\n      // nothing to do\n    }\n  }\n\n  /** Memoizing supplier that closes resources appropriately. */\n  private static class LazyResource<T extends AutoCloseable> implements Supplier<T>, AutoCloseable {\n    private final Supplier<T> initializer;\n    private volatile T resource = null;\n\n    private LazyResource(Supplier<T> initializer) {\n      this.initializer = initializer;","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/kinesis/SimplifiedKinesisClient.java#L223-L259","documentation":"The final catch-all in wrapExceptions wraps any Exception not previously classified (not an ExpiredIteratorException, limit/throughput, SdkServiceException or SdkClientException) into a RuntimeException with 'Unknown kinesis failure, when trying to reach kinesis'. It is a last-resort guard so callers always get a Kinesis-related wrapper exception.","triggerScenarios":"Any unchecked or unexpected exception thrown inside getShardIterator, listShardsFollowingClosedShard, getRecords or getBacklogBytes — e.g. NPEs, IllegalArgumentException from argument validation, or a third-party exception escaping the AWS SDK.","commonSituations":"Passing invalid stream names or iterator arguments; bugs in custom watermark/client configuration; unexpected runtime errors during client invocation that the AWS SDK lets propagate.","solutions":["Inspect the cause chain (the wrapped exception) to find the real root cause — this message itself is not diagnostic.","Validate inputs (stream name, shard id, iterator) before calling SimplifiedKinesisClient methods.","If caused by a library bug, report to Apache Beam with the full stack trace."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// validate before calling\nif (streamName == null || streamName.isEmpty()) throw new IllegalArgumentException(\"streamName required\");\nif (shardId == null || shardId.isEmpty()) throw new IllegalArgumentException(\"shardId required\");","typeGuard":null,"tryCatchPattern":"catch (RuntimeException e) {\n  log.error(\"Kinesis call failed\", e.getCause()); // inspect the wrapped cause\n}","preventionTips":["Always inspect the cause chain of this RuntimeException","Validate stream/shard arguments before client calls"],"tags":["kinesis","runtime-error","unexpected"],"backgroundTag":"internal-invariant-violation","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"}