{"record":{"id":"a72a8085b3407260","repo":"apache/beam","slug":"service-endpoint-must-be-uri-format-got-s","errorCode":null,"errorMessage":"Service endpoint must be URI format, got: %s","messagePattern":"Service endpoint must be URI format, got: (.+?)","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/kinesis/KinesisTransformRegistrar.java","lineNumber":139,"sourceCode":"      public void setPartitionKey(String partitionKey) {\n        this.partitionKey = partitionKey;\n      }\n    }\n\n    @Override\n    public PTransform<PCollection<byte[]>, KinesisIO.Write.Result> buildExternal(\n        Configuration configuration) {\n      AwsBasicCredentials creds =\n          AwsBasicCredentials.create(configuration.awsAccessKey, configuration.awsSecretKey);\n      String pk = configuration.partitionKey;\n      StaticCredentialsProvider provider = StaticCredentialsProvider.create(creds);\n      SerializableFunction<byte[], byte[]> serializer = v -> v;\n      @Nullable URI endpoint = null;\n      if (configuration.serviceEndpoint != null) {\n        try {\n          endpoint = new URI(configuration.serviceEndpoint);\n        } catch (URISyntaxException ex) {\n          throw new RuntimeException(\n              String.format(\n                  \"Service endpoint must be URI format, got: %s\", configuration.serviceEndpoint));\n        }\n      }\n      KinesisIO.Write<byte[]> writeTransform =\n          KinesisIO.<byte[]>write()\n              .withStreamName(configuration.streamName)\n              .withClientConfiguration(\n                  ClientConfiguration.builder()\n                      .credentialsProvider(provider)\n                      .region(Region.of(configuration.region))\n                      .endpoint(endpoint)\n                      .skipCertificateVerification(!configuration.verifyCertificate)\n                      .build())\n              .withPartitioner(p -> pk)\n              .withSerializer(serializer);\n\n      if (configuration.aggregationEnabled) {","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/kinesis/KinesisTransformRegistrar.java#L121-L157","documentation":"KinesisTransformRegistrar.buildExternal (write path) parses configuration.serviceEndpoint into a java.net.URI. On URISyntaxException it throws a RuntimeException with a message naming the offending value. The endpoint, when present, must be valid URI syntax.","triggerScenarios":"Cross-language (transform service) pipeline with a kinesis write transform whose serviceEndpoint config is malformed (missing scheme, illegal characters).","commonSituations":"Hand-authored JSON pipeline options; missing https:// prefix; port typos like 'host::8080'; unexpanded template variables.","solutions":["Prefix the endpoint with a scheme (https:// or http:// for localstack/Kinesalite)","Validate with new URI(endpoint) before submitting the pipeline JSON","Drop the serviceEndpoint field to use the default AWS endpoint"],"exampleFix":"// before\n\"serviceEndpoint\": \"kinesis.eu-west-1.amazonaws.com\"\n// after\n\"serviceEndpoint\": \"https://kinesis.eu-west-1.amazonaws.com\"","handlingStrategy":"validation","validationCode":"try { new URI(configuration.serviceEndpoint); } catch (URISyntaxException e) { /* fix before submission */ }","typeGuard":"boolean isUri(String s){ try { new URI(s); return true; } catch (Exception e){ return false; } }","tryCatchPattern":"try { registrar.buildExternal(cfg); } catch (RuntimeException e) { correct serviceEndpoint in the pipeline JSON; retry expansion; }","preventionTips":["Validate cross-language config JSON before staging","Include scheme in endpoints","Avoid unexpanded template variables in endpoint values"],"tags":["kinesis","uri","cross-language","config"],"backgroundTag":"invalid-url-format","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"}