[ https://issues.apache.org/jira/browse/JCLOUDS-377?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ignasi Barrera reassigned JCLOUDS-377: -------------------------------------- Assignee: Ignasi Barrera > Error in fetching cookbooks from chef server > -------------------------------------------- > > Key: JCLOUDS-377 > URL: https://issues.apache.org/jira/browse/JCLOUDS-377 > Project: jclouds > Issue Type: Bug > Components: jclouds-chef > Affects Versions: 1.6.0 > Reporter: Jayant Kaushal > Assignee: Ignasi Barrera > Labels: hostedchef > > I am trying to fetch cookboks from my opscode hosted chef account.some > cookbooks seems to fetch fine. for example > chef_handler,bluepill,build-essential however when i try to fetch apache2, > mysql that are there on my hosted chef server, > This is what i am trying to do. > ChefApi api = getAPI(); > Set<String> cookbooks = api.listCookbooks(); > for(String cookBook : cookbooks) { > Set<String> versionsOfCookbook = api.getVersionsOfCookbook(cookBook); > for(String s : versionsOfCookbook) { > CookbookVersion cookbook = api.getCookbook(cookBook, s); > } > But this throws exception for apache2, please take a look > SEVERE: Error parsing input > java.lang.IllegalArgumentException: duplicate key: apache2 > at > com.google.common.base.Preconditions.checkArgument(Preconditions.java:119) > at > com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:67) > at > com.google.common.collect.ImmutableMap$Builder.fromEntryList(ImmutableMap.java:249) > at > com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:235) > at > org.jclouds.json.internal.NullFilteringTypeAdapterFactories$MapTypeAdapter.read(NullFilteringTypeAdapterFactories.java:313) > at > org.jclouds.json.internal.NullFilteringTypeAdapterFactories$MapTypeAdapter.read(NullFilteringTypeAdapterFactories.java:278) > at > com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:93) > at > com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176) > at > com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:93) > at > com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176) > at com.google.gson.Gson.fromJson(Gson.java:755) > at com.google.gson.Gson.fromJson(Gson.java:721) > at com.google.gson.Gson.fromJson(Gson.java:670) > at org.jclouds.json.internal.GsonWrapper.fromJson(GsonWrapper.java:47) > at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:86) > at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:80) > at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:66) > at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:46) > at > org.jclouds.rest.internal.InvokeHttpMethod$InvokeAndTransform.call(InvokeHttpMethod.java:167) > at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) > at java.util.concurrent.FutureTask.run(FutureTask.java:138) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:662) > 20:20:03,274 ERROR [DispatcherPortlet:560] Could not complete request > java.lang.IllegalArgumentException: duplicate key: apache2 > at > com.google.common.base.Preconditions.checkArgument(Preconditions.java:119) > at > com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:67) > at > com.google.common.collect.ImmutableMap$Builder.fromEntryList(ImmutableMap.java:249) > at > com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:235) > at > org.jclouds.json.internal.NullFilteringTypeAdapterFactories$MapTypeAdapter.read(NullFilteringTypeAdapterFactories.java:313) > at > org.jclouds.json.internal.NullFilteringTypeAdapterFactories$MapTypeAdapter.read(NullFilteringTypeAdapterFactories.java:278) > at > com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:93) > at > com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176) > at > com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:93) > at > com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176) > at com.google.gson.Gson.fromJson(Gson.java:755) > at com.google.gson.Gson.fromJson(Gson.java:721) > at com.google.gson.Gson.fromJson(Gson.java:670) > at org.jclouds.json.internal.GsonWrapper.fromJson(GsonWrapper.java:47) > at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:86) > at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:80) > at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:66) > at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:46) > at > org.jclouds.rest.internal.InvokeHttpMethod$InvokeAndTransform.call(InvokeHttpMethod.java:167) > at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) > at java.util.concurrent.FutureTask.run(FutureTask.java:138) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:662) > Chef Verison is 1.6.0, > Thanks in advance > Jayant -- This message was sent by Atlassian JIRA (v6.1#6144)