-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CloudStorageFileSystem: java.net.URISyntaxException: Illegal character in hostname #1218
Comments
Support case filed: https://console.cloud.google.com/support/cases/detail/v2/45924691 |
FYI via the Google support ticket [1], there is also the suggestion that
[1] https://console.cloud.google.com/support/cases/detail/v2/45924691 The workaround involves Still, I'm just passing along the above option forwarded by Google's support team just in case. |
The library java-storage-nio did not allow buckets with underscores (googleapis/java-storage-nio#1218). Updating to the latest version to get the fix for this issue. BUG=296379989
The library java-storage-nio did not allow buckets with underscores (googleapis/java-storage-nio#1218). Updating to the latest version to get the fix for this issue. BUG=296379989
The library java-storage-nio did not allow buckets with underscores (googleapis/java-storage-nio#1218). Updating to the latest version to get the fix for this issue. BUG=296379989
The library java-storage-nio did not allow buckets with underscores (googleapis/java-storage-nio#1218). Updating to the latest version to get the fix for this issue. BUG=296379989
Environment details
Steps to reproduce
Paths.get(URI.create("<path_in_your_bucket"))
with the GCS path in your bucketCode example
Stack trace
External references such as API reference guides
Any additional information below
According to RCF 2396, a URI may contain an “Authority Component” (section 3.2). That authority may be “Server-based” (section 3.2.2) or “Registry-based” (section 3.2.1).
All Google bucket names are not server-based authorities. The Google bucket naming documentation mentions “You can use a bucket name in a DNS record as part of a CNAME or A redirect.” but it does not say “You must”.
Since the bucket names are not hostnames then under RFC 2396 the URI may still be constructed using the “Registry-based” form.
URI.create("gs://bucket_with_authority/path")
produces a validjava.net.URI
, it’s just not “Server-based” according to the RFC.The stack trace appears to be caused by the
CloudStorageFileSystem
internal use of thejava.net.URI
API. In a number of places theCloudStorageFileSystem
attempts to construct URIs with hostnames, or retrieve the hostname from “Server-based” URIs instead of “Registry-based” URIs.The fix is to internally use the
java.net.URI
APIs that support all RFC 2396 section 3.2.1 and section 3.2.2 authorities, not the APIs that only support the section 3.2.2 "Server-based" authorities.Thanks!
The text was updated successfully, but these errors were encountered: