Skip to content
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

IllegalArgumentException using bmc ObjectStorage client with micronaut 4, when there are special chars in object names #1053

Open
ddifranc opened this issue Jan 7, 2025 · 0 comments
Assignees

Comments

@ddifranc
Copy link

ddifranc commented Jan 7, 2025

Expected Behavior

I should be able to programmatically create Objects, with arbitrary names including special characters like "|"

Actual Behaviour

Produces this error:

java.lang.IllegalArgumentException: Illegal character in path at index 89: https://objectstorage.us-phoenix-1.oraclecloud.com/n/mynamespace/b/mybucket/o/path%2Fwith|pipe
at java.base/java.net.URI.create(URI.java:932)
at io.micronaut.oraclecloud.httpclient.netty.NettyHttpRequest.uri(NettyHttpRequest.java:205)
at com.oracle.bmc.http.internal.ClientCall.buildServiceDetails(ClientCall.java:173)
at com.oracle.bmc.http.internal.ClientCall.callSync(ClientCall.java:1129)
at com.oracle.bmc.objectstorage.ObjectStorageClient.getObject(ObjectStorageClient.java:1018)
at ddifranc.ObjectStoreNameTest.testGet(ObjectStoreNameTest.java:25)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at io.micronaut.test.extensions.junit5.MicronautJunit5Extension$2.proceed(MicronautJunit5Extension.java:142)
at io.micronaut.test.extensions.AbstractMicronautExtension.interceptEach(AbstractMicronautExtension.java:162)
at io.micronaut.test.extensions.AbstractMicronautExtension.interceptTest(AbstractMicronautExtension.java:119)
at io.micronaut.test.extensions.junit5.MicronautJunit5Extension.interceptTestMethod(MicronautJunit5Extension.java:129)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
Caused by: java.net.URISyntaxException: Illegal character in path at index 89: https://objectstorage.us-phoenix-1.oraclecloud.com/n/mynamespace/b/mybucket/o/path%2Fwith|pipe
at java.base/java.net.URI$Parser.fail(URI.java:2995)
at java.base/java.net.URI$Parser.checkChars(URI.java:3166)
at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3248)
at java.base/java.net.URI$Parser.parse(URI.java:3196)
at java.base/java.net.URI.(URI.java:645)
at java.base/java.net.URI.create(URI.java:930)
... 12 more

Steps To Reproduce

@Test
void testGet() {
GetObjectRequest getRequest = GetObjectRequest.builder()
       .namespaceName(“mynamespace”)
       .bucketName(“mybucket”)
       .objectName(“path/with|pipe”).build();
GetObjectResponse response = osclient.getObject(getRequest);

//see example application for full test

Environment Information

MacOS
Java 17

Non-working configuration:
io.micronaut:micronaut-core:jar:4.6.6
io.micronaut.oraclecloud:micronaut-oraclecloud-bmc-objectstorage:jar:4.2.1
com.oracle.oci.sdk:oci-java-sdk-objectstorage:jar:3.47.0

working configuration (in which OCI SDK uses JerseyHttpRequest rather than netty):
io.micronaut:micronaut-core:jar:3.9.4
com.oracle.oci.sdk:oci-java-sdk-objectstorage:jar:2.71.1

Example Application

https://github.com/ddifranc/micronaut-objectstore-illegal-names

Version

4.6.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants