jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Gaul (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (JCLOUDS-1159) Failure to parse https://api.digitalocean.com/v2/sizes when slug is Null
Date Sat, 22 Apr 2017 20:01:04 GMT

     [ https://issues.apache.org/jira/browse/JCLOUDS-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrew Gaul updated JCLOUDS-1159:
---------------------------------
    Component/s: jclouds-compute

> Failure to parse https://api.digitalocean.com/v2/sizes when slug is Null
> ------------------------------------------------------------------------
>
>                 Key: JCLOUDS-1159
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1159
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-compute
>    Affects Versions: 1.9.2
>            Reporter: Chava Jurado
>              Labels: digitalocean
>
> The following exception was received when trying to run org.jclouds.compute.internal.BaseComputeService.listNodesDetailsMatching
for Digitalocean2:
> {noformat}
> 17:50:29.374 [pool-1-thread-1] DEBUG jclouds.headers - >> GET https://api.digitalocean.com/v2/sizes
HTTP/1.1
> 17:50:29.555 [pool-1-thread-1] DEBUG o.j.h.i.JavaUrlHttpCommandExecutorService - Receiving
response 6566944: HTTP/1.1 200 OK
> 17:50:29.565 [pool-1-thread-1] DEBUG jclouds.wire - << "{"sizes":[{"slug":"512mb","memory":512,"vcpus":1,"disk":20,"transfer":1.0,"price_monthly":5.0,"price_hourly":0.00744,"regions":["ams1","ams2","ams3","blr1","fra1","lon1","nyc1","nyc2","nyc3","sfo1","sfo2","sgp1","tor1"],"available":true},{"slug":"1gb","memory":1024,"vcpus":1,"disk":30,"transfer":2.0,"price_monthly":10.0,"price_hourly":0.01488,"regions":["ams1","ams2","ams3","blr1","fra1","lon1","nyc1","nyc2","nyc3","sfo1","sfo2","sgp1","tor1"],"available":true},{"slug":"2gb","memory":2048,"vcpus":2,"disk":40,"transfer":3.0,"price_monthly":20.0,"price_hourly":0.02976,"regions":["ams1","ams2","ams3","blr1","fra1","lon1","nyc1","nyc2","nyc3","sfo1","sfo2","sgp1","tor1"],"available":true},{"slug":"4gb","memory":4096,"vcpus":2,"disk":60,"transfer":4.0,"price_monthly":40.0,"price_hourly":0.05952,"regions":["ams1","ams2","ams3","blr1","fra1","lon1","nyc1","nyc2","nyc3","sfo1","sfo2","sgp1","tor1"],"available":true},{"slug":"8gb","memory":8192,"vcpus":4,"disk":80,"transfer":5.0,"price_monthly":80.0,"price_hourly":0.11905,"regions":["ams1","ams2","ams3","blr1","fra1","lon1","nyc1","nyc2","nyc3","sfo1","sfo2","sgp1","tor1"],"available":true},{"slug":"16gb","memory":16384,"vcpus":8,"disk":160,"transfer":6.0,"price_monthly":160.0,"price_hourly":0.2381,"regions":["ams1","ams2","ams3","blr1","fra1","lon1","nyc1","nyc2","nyc3","sfo1","sfo2","sgp1","tor1"],"available":true},{"slug":null,"memory":16384,"vcpus":2,"disk":30,"transfer":6.0,"price_monthly":120.0,"price_hourly":0.17857,"regions":[],"available":true},{"slug":"32gb","memory":32768,"vcpus":12,"disk":320,"transfer":7.0,"price_monthly":320.0,"price_hourly":0.47619,"regions":["ams2","ams3","blr1","fra1","lon1","nyc1","nyc2","nyc3","sfo1","sfo2","sgp1","tor1"],"available":false},{"slug":null,"memory":32768,"vcpus":4,"disk":90,"transfer":7.0,"price_monthly":240.0,"price_hourly":0.35714,"regions":[],"available":false},{"slug":"48gb","memory":49152,"vcpus":16,"disk":480,"transfer":8.0,"price_monthly":480.0,"price_hourly":0.71429,"regions":["ams2","ams3","blr1","fra1","lon1","nyc1","nyc2","nyc3","sfo1","sfo2","sgp1","tor1"],"available":false},{"slug":null,"memory":65536,"vcpus":8,"disk":200,"transfer":8.0,"price_monthly":480.0,"price_hourly":0.71429,"regions":[],"available":false},{"slug":"64gb","memory":65536,"vcpus":20,"disk":640,"transfer":9.0,"price_monthly":640.0,"price_hourly":0.95238,"regions":["ams2","ams3","blr1","fra1","lon1","nyc1","nyc2","nyc3","sfo1","sfo2","sgp1","tor1"],"available":false},{"slug":null,"memory":131072,"vcpus":16,"disk":340,"transfer":9.0,"price_monthly":960.0,"price_hourly":0.42857,"regions":[],"available":true},{"slug":null,"memory":229376,"vcpus":32,"disk":500,"transfer":10.0,"price_monthly":1680.0,"price_hourly":2.5,"regions":[],"available":true}],"links":{},"meta":{"total":14}}"
> 17:51:26.075 [pool-1-thread-1] ERROR o.j.d.features.SizeApi$ParseSizes - Error parsing
input: Null slug
> java.lang.NullPointerException: Null slug
> 	at org.jclouds.digitalocean2.domain.AutoValue_Size.<init>(AutoValue_Size.java:31)
~[digitalocean2-1.9.2.jar:na]
> 	at org.jclouds.digitalocean2.domain.Size.create(Size.java:42) ~[digitalocean2-1.9.2.jar:na]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_80]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_80]
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.7.0_80]
> 	at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_80]
> 	at com.google.common.reflect.Invokable$MethodInvokable.invokeInternal(Invokable.java:197)
~[guava-18.0.jar:na]
> 	at com.google.common.reflect.Invokable.invoke(Invokable.java:102) ~[guava-18.0.jar:na]
> 	at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.newInstance(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:224)
~[jclouds-core-1.9.2.jar:1.9.2]
> 	at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:204)
~[jclouds-core-1.9.2.jar:1.9.2]
> 	at org.jclouds.json.internal.NullFilteringTypeAdapterFactories$IterableTypeAdapter.readAndBuild(NullFilteringTypeAdapterFactories.java:90)
~[jclouds-core-1.9.2.jar:1.9.2]
> 	at org.jclouds.json.internal.NullFilteringTypeAdapterFactories$IterableTypeAdapter.read(NullFilteringTypeAdapterFactories.java:82)
~[jclouds-core-1.9.2.jar:1.9.2]
> 	at org.jclouds.json.internal.NullFilteringTypeAdapterFactories$IterableTypeAdapter.read(NullFilteringTypeAdapterFactories.java:61)
~[jclouds-core-1.9.2.jar:1.9.2]
> 	at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$ParameterReader.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:272)
~[jclouds-core-1.9.2.jar:1.9.2]
> 	at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:184)
~[jclouds-core-1.9.2.jar:1.9.2]
> 	at com.google.gson.Gson.fromJson(Gson.java:803) ~[gson-2.2.4.jar:na]
> 	at com.google.gson.Gson.fromJson(Gson.java:768) ~[gson-2.2.4.jar:na]
> 	at com.google.gson.Gson.fromJson(Gson.java:717) ~[gson-2.2.4.jar:na]
> 	at org.jclouds.json.internal.GsonWrapper.fromJson(GsonWrapper.java:42) ~[jclouds-core-1.9.2.jar:1.9.2]
> 	at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:83) [jclouds-core-1.9.2.jar:1.9.2]
> 	at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:77) [jclouds-core-1.9.2.jar:1.9.2]
> 	at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:62) [jclouds-core-1.9.2.jar:1.9.2]
> 	at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:42) [jclouds-core-1.9.2.jar:1.9.2]
> 	at com.google.common.base.Functions$FunctionComposition.apply(Functions.java:216) [guava-18.0.jar:na]
> 	at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90) [jclouds-core-1.9.2.jar:1.9.2]
> 	at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73) [jclouds-core-1.9.2.jar:1.9.2]
> 	at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44) [jclouds-core-1.9.2.jar:1.9.2]
> 	at org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117)
[jclouds-core-1.9.2.jar:1.9.2]
> 	at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87)
[guava-18.0.jar:na]
> 	at com.sun.proxy.$Proxy67.list(Unknown Source) [na:na]
> 	at org.jclouds.digitalocean2.compute.DigitalOcean2ComputeServiceAdapter.listHardwareProfiles(DigitalOcean2ComputeServiceAdapter.java:158)
[digitalocean2-1.9.2.jar:na]
> 	at org.jclouds.compute.config.ComputeServiceAdapterContextModule$1.get(ComputeServiceAdapterContextModule.java:101)
[jclouds-compute-1.9.0.jar:1.9.0]
> 	at org.jclouds.compute.config.ComputeServiceAdapterContextModule$1.get(ComputeServiceAdapterContextModule.java:98)
[jclouds-compute-1.9.0.jar:1.9.0]
> 	at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:73)
[jclouds-core-1.9.2.jar:1.9.2]
> 	at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:57)
[jclouds-core-1.9.2.jar:1.9.2]
> 	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)
[guava-18.0.jar:na]
> 	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319) [guava-18.0.jar:na]
> 	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)
[guava-18.0.jar:na]
> 	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197) [guava-18.0.jar:na]
> 	at com.google.common.cache.LocalCache.get(LocalCache.java:3937) [guava-18.0.jar:na]
> 	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941) [guava-18.0.jar:na]
> 	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824) [guava-18.0.jar:na]
> 	at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.get(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:119)
[jclouds-core-1.9.2.jar:1.9.2]
> 	at com.google.common.base.Suppliers$SupplierComposition.get(Suppliers.java:67) [guava-18.0.jar:na]
> 	at org.jclouds.digitalocean2.compute.functions.DropletToNodeMetadata.getHardware(DropletToNodeMetadata.java:149)
[digitalocean2-1.9.2.jar:na]
> 	at org.jclouds.digitalocean2.compute.functions.DropletToNodeMetadata.apply(DropletToNodeMetadata.java:94)
[digitalocean2-1.9.2.jar:na]
> 	at org.jclouds.digitalocean2.compute.functions.DropletToNodeMetadata.apply(DropletToNodeMetadata.java:1)
[digitalocean2-1.9.2.jar:na]
> 	at com.google.common.base.Functions$FunctionComposition.apply(Functions.java:216) [guava-18.0.jar:na]
> 	at com.google.common.collect.Iterators$8.transform(Iterators.java:799) [guava-18.0.jar:na]
> 	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48) [guava-18.0.jar:na]
> 	at com.google.common.collect.Iterators$7.computeNext(Iterators.java:651) [guava-18.0.jar:na]
> 	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
[guava-18.0.jar:na]
> 	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) [guava-18.0.jar:na]
> 	at com.google.common.collect.Iterators.addAll(Iterators.java:361) [guava-18.0.jar:na]
> 	at com.google.common.collect.Iterables.addAll(Iterables.java:354) [guava-18.0.jar:na]
> 	at com.google.common.collect.Sets.newLinkedHashSet(Sets.java:328) [guava-18.0.jar:na]
> 	at org.jclouds.compute.internal.BaseComputeService.listNodesDetailsMatching(BaseComputeService.java:359)
[jclouds-compute-1.9.0.jar:1.9.0]
> {noformat}
> This is the json it threw an exception on:
> {code:javascript}
> {
>     "links": {},
>     "meta": {
>         "total": 14
>     },
>     "sizes": [
>         {
>             "available": true,
>             "disk": 20,
>             "memory": 512,
>             "price_hourly": 0.00744,
>             "price_monthly": 5.0,
>             "regions": [
>                 "ams1",
>                 "ams2",
>                 "ams3",
>                 "blr1",
>                 "fra1",
>                 "lon1",
>                 "nyc1",
>                 "nyc2",
>                 "nyc3",
>                 "sfo1",
>                 "sfo2",
>                 "sgp1",
>                 "tor1"
>             ],
>             "slug": "512mb",
>             "transfer": 1.0,
>             "vcpus": 1
>         },
>         {
>             "available": true,
>             "disk": 30,
>             "memory": 1024,
>             "price_hourly": 0.01488,
>             "price_monthly": 10.0,
>             "regions": [
>                 "ams1",
>                 "ams2",
>                 "ams3",
>                 "blr1",
>                 "fra1",
>                 "lon1",
>                 "nyc1",
>                 "nyc2",
>                 "nyc3",
>                 "sfo1",
>                 "sfo2",
>                 "sgp1",
>                 "tor1"
>             ],
>             "slug": "1gb",
>             "transfer": 2.0,
>             "vcpus": 1
>         },
>         {
>             "available": true,
>             "disk": 40,
>             "memory": 2048,
>             "price_hourly": 0.02976,
>             "price_monthly": 20.0,
>             "regions": [
>                 "ams1",
>                 "ams2",
>                 "ams3",
>                 "blr1",
>                 "fra1",
>                 "lon1",
>                 "nyc1",
>                 "nyc2",
>                 "nyc3",
>                 "sfo1",
>                 "sfo2",
>                 "sgp1",
>                 "tor1"
>             ],
>             "slug": "2gb",
>             "transfer": 3.0,
>             "vcpus": 2
>         },
>         {
>             "available": true,
>             "disk": 60,
>             "memory": 4096,
>             "price_hourly": 0.05952,
>             "price_monthly": 40.0,
>             "regions": [
>                 "ams1",
>                 "ams2",
>                 "ams3",
>                 "blr1",
>                 "fra1",
>                 "lon1",
>                 "nyc1",
>                 "nyc2",
>                 "nyc3",
>                 "sfo1",
>                 "sfo2",
>                 "sgp1",
>                 "tor1"
>             ],
>             "slug": "4gb",
>             "transfer": 4.0,
>             "vcpus": 2
>         },
>         {
>             "available": true,
>             "disk": 80,
>             "memory": 8192,
>             "price_hourly": 0.11905,
>             "price_monthly": 80.0,
>             "regions": [
>                 "ams1",
>                 "ams2",
>                 "ams3",
>                 "blr1",
>                 "fra1",
>                 "lon1",
>                 "nyc1",
>                 "nyc2",
>                 "nyc3",
>                 "sfo1",
>                 "sfo2",
>                 "sgp1",
>                 "tor1"
>             ],
>             "slug": "8gb",
>             "transfer": 5.0,
>             "vcpus": 4
>         },
>         {
>             "available": true,
>             "disk": 160,
>             "memory": 16384,
>             "price_hourly": 0.2381,
>             "price_monthly": 160.0,
>             "regions": [
>                 "ams1",
>                 "ams2",
>                 "ams3",
>                 "blr1",
>                 "fra1",
>                 "lon1",
>                 "nyc1",
>                 "nyc2",
>                 "nyc3",
>                 "sfo1",
>                 "sfo2",
>                 "sgp1",
>                 "tor1"
>             ],
>             "slug": "16gb",
>             "transfer": 6.0,
>             "vcpus": 8
>         },
>         {
>             "available": true,
>             "disk": 30,
>             "memory": 16384,
>             "price_hourly": 0.17857,
>             "price_monthly": 120.0,
>             "regions": [],
>             "slug": null,
>             "transfer": 6.0,
>             "vcpus": 2
>         },
>         {
>             "available": false,
>             "disk": 320,
>             "memory": 32768,
>             "price_hourly": 0.47619,
>             "price_monthly": 320.0,
>             "regions": [
>                 "ams2",
>                 "ams3",
>                 "blr1",
>                 "fra1",
>                 "lon1",
>                 "nyc1",
>                 "nyc2",
>                 "nyc3",
>                 "sfo1",
>                 "sfo2",
>                 "sgp1",
>                 "tor1"
>             ],
>             "slug": "32gb",
>             "transfer": 7.0,
>             "vcpus": 12
>         },
>         {
>             "available": false,
>             "disk": 90,
>             "memory": 32768,
>             "price_hourly": 0.35714,
>             "price_monthly": 240.0,
>             "regions": [],
>             "slug": null,
>             "transfer": 7.0,
>             "vcpus": 4
>         },
>         {
>             "available": false,
>             "disk": 480,
>             "memory": 49152,
>             "price_hourly": 0.71429,
>             "price_monthly": 480.0,
>             "regions": [
>                 "ams2",
>                 "ams3",
>                 "blr1",
>                 "fra1",
>                 "lon1",
>                 "nyc1",
>                 "nyc2",
>                 "nyc3",
>                 "sfo1",
>                 "sfo2",
>                 "sgp1",
>                 "tor1"
>             ],
>             "slug": "48gb",
>             "transfer": 8.0,
>             "vcpus": 16
>         },
>         {
>             "available": false,
>             "disk": 200,
>             "memory": 65536,
>             "price_hourly": 0.71429,
>             "price_monthly": 480.0,
>             "regions": [],
>             "slug": null,
>             "transfer": 8.0,
>             "vcpus": 8
>         },
>         {
>             "available": false,
>             "disk": 640,
>             "memory": 65536,
>             "price_hourly": 0.95238,
>             "price_monthly": 640.0,
>             "regions": [
>                 "ams2",
>                 "ams3",
>                 "blr1",
>                 "fra1",
>                 "lon1",
>                 "nyc1",
>                 "nyc2",
>                 "nyc3",
>                 "sfo1",
>                 "sfo2",
>                 "sgp1",
>                 "tor1"
>             ],
>             "slug": "64gb",
>             "transfer": 9.0,
>             "vcpus": 20
>         },
>         {
>             "available": true,
>             "disk": 340,
>             "memory": 131072,
>             "price_hourly": 0.42857,
>             "price_monthly": 960.0,
>             "regions": [],
>             "slug": null,
>             "transfer": 9.0,
>             "vcpus": 16
>         },
>         {
>             "available": true,
>             "disk": 500,
>             "memory": 229376,
>             "price_hourly": 2.5,
>             "price_monthly": 1680.0,
>             "regions": [],
>             "slug": null,
>             "transfer": 10.0,
>             "vcpus": 32
>         }
>     ]
> }
> {code}
> It looks like the code will need to be able to handle null slugs.  First time I've seen
it and I've been running on 1.9.2 for several months without an issue.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message