Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-377

Error in fetching cookbooks from chef server

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.6.0
    • 1.7.0
    • jclouds-chef

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              nacx Ignasi Barrera
              jayant_kaushal Jayant Kaushal
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: