{"record":{"id":"e703bce6c5ca635b","repo":"apache/beam","slug":"service-endpoint-must-be-a-uri-got-s","errorCode":null,"errorMessage":"Service endpoint must be a URI, got: %s","messagePattern":"Service endpoint must be a URI, got: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/kinesis/KinesisReadSchemaTransformProvider.java","lineNumber":217,"sourceCode":"    }\n\n    @Override\n    public PCollectionRowTuple expand(PCollectionRowTuple input) {\n      Preconditions.checkState(\n          input.getAll().isEmpty(),\n          \"Expected zero input PCollections for this source, but found: %s\",\n          input.getAll().keySet());\n\n      AwsBasicCredentials creds =\n          AwsBasicCredentials.create(config.getAwsAccessKey(), config.getAwsSecretKey());\n      StaticCredentialsProvider provider = StaticCredentialsProvider.create(creds);\n\n      @Nullable URI endpoint = null;\n      if (config.getServiceEndpoint() != null) {\n        try {\n          endpoint = new URI(config.getServiceEndpoint());\n        } catch (URISyntaxException ex) {\n          throw new IllegalArgumentException(\n              String.format(\"Service endpoint must be a URI, got: %s\", config.getServiceEndpoint()),\n              ex);\n        }\n      }\n\n      boolean verifyCertificate =\n          config.getVerifyCertificate() == null || config.getVerifyCertificate();\n\n      KinesisIO.Read readTransform =\n          KinesisIO.read()\n              .withStreamName(config.getStreamName())\n              .withClientConfiguration(\n                  ClientConfiguration.builder()\n                      .credentialsProvider(provider)\n                      .region(Region.of(config.getRegion()))\n                      .endpoint(endpoint)\n                      .skipCertificateVerification(!verifyCertificate)\n                      .build());","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/kinesis/KinesisReadSchemaTransformProvider.java#L199-L235","documentation":"KinesisReadSchemaTransformProvider.expand parses config.getServiceEndpoint() as a java.net.URI. If the string is not valid URI syntax, the URISyntaxException is wrapped into an IllegalArgumentException with the offending value. The endpoint is optional but, when provided, must be a well-formed URI (e.g. https://kinesis.us-east-1.amazonaws.com).","triggerScenarios":"Setting service_endpoint in a YAML/schema-transform pipeline to something like 'kinesis.us-east-1.amazonaws.com' (missing scheme) or a string with spaces/illegal characters.","commonSituations":"Copy-pasting an endpoint host without https://; trailing slashes or typos; using an environment placeholder that didn't expand; local Kinesis (Kinesalite) endpoints without scheme.","solutions":["Add a scheme to the endpoint, e.g. https://host:port","Validate the endpoint string with new URI(...) in config prep before submitting the pipeline","If using Kinesalite/localstack use 'http://localhost:4566'","Remove the service_endpoint key if you intend to use the default AWS endpoint"],"exampleFix":"// before\nservice_endpoint: kinesis.us-east-1.amazonaws.com\n// after\nservice_endpoint: https://kinesis.us-east-1.amazonaws.com","handlingStrategy":"validation","validationCode":"URI ep;\ntry { ep = new URI(config.getServiceEndpoint()); } catch (URISyntaxException e) { throw new IllegalArgumentException(\"bad service_endpoint\", e); }","typeGuard":"boolean validEndpoint(String s) { try { new URI(s); return true; } catch (Exception e) { return false; } }","tryCatchPattern":"try { expand(cfg); } catch (IllegalArgumentException e) { fix endpoint syntax in pipeline options; resubmit; }","preventionTips":["Always include scheme (https://) in service_endpoint","Test the endpoint with new URI() in config prep","For localstack/Kinesalite use http://localhost:port"],"tags":["kinesis","uri","config","schema-transform"],"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"}