{"record":{"id":"f1e59e5a17c50502","repo":"apache/flink","slug":"error-in-s3-aws-uri","errorCode":null,"errorMessage":"Error in s3 aws URI - {}","messagePattern":"Error in s3 aws URI - (.+?)","errorType":"exception","errorClass":"FlinkRuntimeException","httpStatus":null,"severity":"error","filePath":"flink-filesystems/flink-s3-fs-presto/src/main/java/org/apache/flink/fs/s3presto/S3FileSystemFactory.java","lineNumber":120,"sourceCode":"        } else if (scheme != null && authority == null) {\n            initUri = createURI(scheme + \"://s3.amazonaws.com\");\n        } else {\n            initUri = fsUri;\n        }\n        return initUri;\n    }\n\n    @Nullable\n    @Override\n    protected S3AccessHelper getS3AccessHelper(FileSystem fs) {\n        return null;\n    }\n\n    private URI createURI(String str) {\n        try {\n            return new URI(str);\n        } catch (URISyntaxException e) {\n            throw new FlinkRuntimeException(\"Error in s3 aws URI - \" + str, e);\n        }\n    }\n}\n","sourceCodeStart":102,"sourceCodeEnd":124,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-filesystems/flink-s3-fs-presto/src/main/java/org/apache/flink/fs/s3presto/S3FileSystemFactory.java#L102-L124","documentation":"S3FileSystemFactory.createURI wraps java.net.URISyntaxException in a FlinkRuntimeException when the configured S3 URI/endpoint string cannot be parsed by java.net.URI. This is a hard configuration error raised during factory/filesystem initialization, before any S3 traffic happens.","triggerScenarios":"Setting s3.endpoint or scheme config values containing illegal URI characters — spaces, unencoded braces/brackets (IPv6 endpoints without brackets), a colon in the wrong place, backslashes, or control characters — so 'new URI(str)' fails.","commonSituations":"Endpoint URLs copy-pasted with trailing spaces or percent-encoding missing (e.g. 'http://minio:9000/path with space'); IPv6 literal endpoints not wrapped in brackets; Windows-style paths in config; env-var interpolation injecting quotes or newlines into the URI.","solutions":["Fix the URI string: scheme://host:port, percent-encode spaces and special characters, wrap IPv6 literals in brackets ([::1]:9000).","Validate config early: new URI(endpoint) in a startup check or a ConfigOption validator so the job fails before submitting.","Print the exact string in logs (it is included in the message) and diff it against the intended endpoint for hidden whitespace/quotes.","Avoid env interpolation that can inject quotes; sanitize variables used inside s3.* properties."],"exampleFix":"# before (flink-conf.yaml)\ns3.endpoint: http://minio.myco internal:9000\n\n# after\ns3.endpoint: http://minio.myco-internal:9000","handlingStrategy":"validation","validationCode":"try {\n    new URI(endpoint);\n} catch (URISyntaxException e) {\n    throw new IllegalArgumentException(\"Bad s3.endpoint: '\" + endpoint + \"'\", e);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Percent-encode special characters in endpoint config.","Bracket IPv6 literals: http://[::1]:9000.","Trim whitespace and strip quotes from env-injected config values."],"tags":["s3","presto","config","uri","startup"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}