Openstack juno with Jclouds API generating URISyntaxException because of an extra space in response

167 Views Asked by At

Openstack juno orchestration endpoint having extra space in response, so it is giving me exception while using Jclouds API to use openstack, is there anything we can do?

{
    "endpoints": [{
        "adminURL": "http://115.249.4.66:8004/v1/38bc976fd99d4ef4b6d48be6729b8576",
        "region": "IPTC",
        "internalURL": "http://115.249.4.66:8004/v1/38bc976fd99d4ef4b6d48be6729b8576 ",
        "id": "64667a399bb446d0bf0f6537e113ec52",
        "publicURL": "http://115.249.4.66:8004/v1/38bc976fd99d4ef4b6d48be6729b8576"
    }],
    "endpoints_links": [],
    "type": "orchestration",
    "name": "heat"
},

As shown above the line

"htttp://115.249.4.66:8004/v1/38bc976fd99d4ef4b6d48be6729b8576 ",

has an extra space before the double quotes closing the URL (I manually added extra 't' with http)

but in all other Endpoints there is no extra space,

the same response from trystack.org is shown below,

{
    "endpoints": [{
        "adminURL": "http://10.100.0.222:8004/v1/18b792582bba4385ac9c4820af4a8b5e",
        "region": "RegionOne",
        "internalURL": "http://10.100.0.222:8004/v1/18b792582bba4385ac9c4820af4a8b5e",
        "id": "38fa4f9afce34d4ca0f5e0f90fd758dd",
        "publicURL": "http://8.21.28.222:8004/v1/18b792582bba4385ac9c4820af4a8b5e"
    }],
    "endpoints_links": [],
    "type": "orchestration",
    "name": "heat"
},

as you can see in the URL "htttp://10.100.0.222:8004/v1/18b792582bba4385ac9c4820af4a8b5e", there is no space before the double quotes. (I manually added extra 't' with http)

Because of extra space there with the URL, the error in jclouds is as follows,

Exception in thread "main" com.google.common.util.concurrent.UncheckedExecutionException: com.google.gson.JsonIOException: java.net.URISyntaxException: Illegal character in path at index 61: htttp://115.249.4.66:8004/v1/38bc976fd99d4ef4b6d48be6729b8576 
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2201)
    at com.google.common.cache.LocalCache.get(LocalCache.java:3934)
    at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938)
    at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821)
    at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827)
    at org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule$2.get(KeystoneAuthenticationModule.java:234)
    at org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule$2.get(KeystoneAuthenticationModule.java:231)
    at org.jclouds.openstack.keystone.v2_0.suppliers.LocationIdToURIFromAccessForTypeAndVersion.get(LocationIdToURIFromAccessForTypeAndVersion.java:94)
    at org.jclouds.openstack.keystone.v2_0.suppliers.LocationIdToURIFromAccessForTypeAndVersion.get(LocationIdToURIFromAccessForTypeAndVersion.java:54)
    at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:73)
    at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:57)
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524)
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317)
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280)
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195)
    at com.google.common.cache.LocalCache.get(LocalCache.java:3934)
    at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938)
    at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821)
    at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.get(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:119)
    at org.jclouds.openstack.neutron.v2.functions.VersionAwareRegionToEndpoint.apply(VersionAwareRegionToEndpoint.java:55)
    at org.jclouds.openstack.neutron.v2.functions.VersionAwareRegionToEndpoint.apply(VersionAwareRegionToEndpoint.java:33)
    at org.jclouds.rest.internal.RestAnnotationProcessor.getEndpointInParametersOrNull(RestAnnotationProcessor.java:495)
    at org.jclouds.rest.internal.RestAnnotationProcessor.getEndpointFor(RestAnnotationProcessor.java:518)
    at org.jclouds.rest.internal.RestAnnotationProcessor.apply(RestAnnotationProcessor.java:188)
    at org.jclouds.rest.internal.RestAnnotationProcessor.apply(RestAnnotationProcessor.java:129)
    at org.jclouds.rest.internal.InvokeHttpMethod.toCommand(InvokeHttpMethod.java:188)
    at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:84)
    at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73)
    at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44)
    at org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117)
    at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87)
    at com.sun.proxy.$Proxy62.list(Unknown Source)
    at example.JcloudsDemo.Operations(JcloudsDemo.java:159)
    at example.JcloudsDemo.main(JcloudsDemo.java:146)
Caused by: com.google.gson.JsonIOException: java.net.URISyntaxException: Illegal character in path at index 61: htttp://115.249.4.66:8004/v1/38bc976fd99d4ef4b6d48be6729b8576 
    at com.google.gson.internal.bind.TypeAdapters$19.read(TypeAdapters.java:469)
    at com.google.gson.internal.bind.TypeAdapters$19.read(TypeAdapters.java:458)
    at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$ParameterReader.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:272)
    at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:184)
    at org.jclouds.json.internal.NullFilteringTypeAdapterFactories$IterableTypeAdapter.readAndBuild(NullFilteringTypeAdapterFactories.java:90)
    at org.jclouds.json.internal.NullFilteringTypeAdapterFactories$SetTypeAdapter.read(NullFilteringTypeAdapterFactories.java:180)
    at org.jclouds.json.internal.NullFilteringTypeAdapterFactories$SetTypeAdapter.read(NullFilteringTypeAdapterFactories.java:166)
    at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$ParameterReader.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:272)
    at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:184)
    at org.jclouds.json.internal.NullFilteringTypeAdapterFactories$IterableTypeAdapter.readAndBuild(NullFilteringTypeAdapterFactories.java:90)
    at org.jclouds.json.internal.NullFilteringTypeAdapterFactories$SetTypeAdapter.read(NullFilteringTypeAdapterFactories.java:180)
    at org.jclouds.json.internal.NullFilteringTypeAdapterFactories$SetTypeAdapter.read(NullFilteringTypeAdapterFactories.java:166)
    at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$ParameterReader.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:272)
    at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:184)
    at com.google.gson.Gson.fromJson(Gson.java:803)
    at org.jclouds.http.functions.ParseFirstJsonValueNamed.apply(ParseFirstJsonValueNamed.java:80)
    at org.jclouds.http.functions.ParseFirstJsonValueNamed.apply(ParseFirstJsonValueNamed.java:44)
    at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90)
    at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73)
    at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44)
    at org.jclouds.rest.internal.DelegatesToInvocationFunction.handle(DelegatesToInvocationFunction.java:156)
    at org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(DelegatesToInvocationFunction.java:123)
    at com.sun.proxy.$Proxy55.authenticateWithTenantNameAndCredentials(Unknown Source)
    at org.jclouds.openstack.keystone.v2_0.functions.AuthenticatePasswordCredentials.authenticateWithTenantName(AuthenticatePasswordCredentials.java:43)
    at org.jclouds.openstack.keystone.v2_0.functions.AuthenticatePasswordCredentials.authenticateWithTenantName(AuthenticatePasswordCredentials.java:31)
    at org.jclouds.openstack.keystone.v2_0.functions.internal.BaseAuthenticator.apply(BaseAuthenticator.java:79)
    at org.jclouds.openstack.keystone.v2_0.functions.internal.BaseAuthenticator.apply(BaseAuthenticator.java:36)
    at com.google.common.cache.CacheLoader$FunctionToCacheLoader.load(CacheLoader.java:151)
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524)
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317)
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280)
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195)
... 33 more
Caused by: java.net.URISyntaxException: Illegal character in path at index 61: htttp://115.249.4.66:8004/v1/38bc976fd99d4ef4b6d48be6729b8576 
    at java.net.URI$Parser.fail(URI.java:2829)
    at java.net.URI$Parser.checkChars(URI.java:3002)
    at java.net.URI$Parser.parseHierarchical(URI.java:3086)
    at java.net.URI$Parser.parse(URI.java:3034)
    at java.net.URI.<init>(URI.java:595)
    at com.google.gson.internal.bind.TypeAdapters$19.read(TypeAdapters.java:467)
    ... 64 more

What can I do?, thanks in advance

1

There are 1 best solutions below

1
On

This has been added to the jclouds JIRA. You can track it there. https://issues.apache.org/jira/browse/JCLOUDS-907