Uploaded image for project: 'Puppet Server'
  1. Puppet Server
  2. SERVER-2450

Error 500 parsing certain parameters on /puppet/v3/environment_classes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Environment:

      RHEL 7.6, PE 2018.1.5

    • Template:
      PUP Bug Template
    • Acceptance Criteria:
      Hide

      Code that passes puppet parser validate, and is otherwise correct should not cause PuppetServer's parser to fail.

      Show
      Code that passes puppet parser validate, and is otherwise correct should not cause PuppetServer's parser to fail.
    • Team:
      Froyo
    • Method Found:
      Needs Assessment
    • Zendesk Ticket IDs:
      40532,42498
    • Zendesk Ticket Count:
      2
    • QA Risk Assessment:
      Needs Assessment

      Description

      Puppet Version: 2018.1.5
      Puppet Server Version: pe-puppetserver-2018.1.0.88-1.el7.noarch
      OS Name/Version: RHEL 7.6

      Describe your issue in as much detail as possible…

      Puppet Code with a parameter like:

       Variant[String,[Array[String]]] $provisioning_api_certs = [],

       

      Will cause an API call to /puppet/v3/environment_classes to give a 500 error.

      Describe steps to reproduce…

      Have puppet code containing a parameter like the one above deployed, try API call.

      Desired Behavior: correct response from API

      Actual Behavior: Error 500

       

       

      HTTP ERROR 500Problem accessing /puppet/v3/environment_classes.Reason:    Server ErrorCaused by:clojure.lang.ExceptionInfo: Output of manifest-info-from-jruby->manifest-info-for-json does not match schema: {:classes [{:params [nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil {:type (not (instance? java.lang.String nil))}]}]} {:type :schema.core/error, :schema (conditional puppetlabs.services.master.master-core/fn--50248 {:path Str, :error Str} puppetlabs.services.master.master-core/fn--50250 {:path Str, :classes [{:name Str, :params [{:name Str, (optional-key :type) Str, (optional-key :default_source) Str, (optional-key :default_literal) Any}]}]}), :value {:classes ({:name "profile::puppet::master", :params ({:default_literal "https://artifactory.company.com/artifactory/api/gems/RubyGems/", :default_source "'https://artifactory.company.com/artifactory/api/gems/RubyGems/'", :name "artifactory_gem_proxy", :type "String"} {:default_literal "puppet:///modules/profile/license.key", :default_source "'puppet:///modules/profile/license.key'", :name "key_source", :type "String"} {:default_literal "DefaultPassword", :default_source "'DefaultPassword'", :name "puppet_autosign_secret", :type "String"} {:default_source "undef", :name "console_sslcert_content", :type "Optional[String]"} {:default_source "undef", :name "console_sslkey_content", :type "Optional[String]"} {:default_literal "/backup", :default_source "'/backup'", :name "backup_root", :type "Optional[String]"} {:default_literal 14, :default_source "14", :name "backup_keep_days", :type "Integer[1, 99]"} {:default_literal (8140 8142), :default_source "[8140, 8142]", :name "puppet_ports", :type "Array[Integer]"} {:default_literal ("0.0.0.0/0"), :default_source "['0.0.0.0/0']", :name "puppet_access", :type "Array[String]"} {:default_literal (80 443), :default_source "[80, 443]", :name "console_ports", :type "Array[Integer]"} {:default_literal ("0.0.0.0/0"), :default_source "['0.0.0.0/0']", :name "console_access", :type "Array[String]"} {:default_literal (4433 8081 8143 8170), :default_source "[4433, 8081, 8143, 8170]", :name "backend_ports", :type "Array[Integer]"} {:default_literal ("0.0.0.0/0"), :default_source "['0.0.0.0/0']", :name "backend_access", :type "Array[String]"} {:default_literal ("bitbucket.company.com"), :default_source "['bitbucket.company.com']", :name "git_sources", :type "Array[String]"} {:default_literal ("artifactory.company.com"), :default_source "['artifactory.company.com']", :name "forge_sources", :type "Array[String]"} {:default_source "lookup('puppet_enterprise::profile::master::metrics_graphite_host')", :name "graphite_host", :type "Optional[String]"} {:default_source "lookup('puppet_enterprise::profile::master::metrics_graphite_port', Integer, 'first', 2003)", :name "graphite_port", :type "Optional[Integer]"} {:default_literal "10.9.46.0/24", :default_source "'10.9.46.0/24'", :name "nfs_host", :type "Optional[String]"} {:default_literal (), :default_source "[]", :name "provisioning_api_certs", :type nil})}), :path "/etc/puppetlabs/code/environments/logging_dev/site/profile/manifests/puppet/master.pp"}, :error {:classes [{:params [nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil {:type (not (instance? java.lang.String nil))}]}]}}
      	at puppetlabs.services.master.master_core$eval50325$manifest_info_from_jruby__GT_manifest_info_for_json__50330.invoke(master_core.clj:250)
      	at clojure.core$map$fn__4785.invoke(core.clj:2644)
      	at clojure.lang.LazySeq.sval(LazySeq.java:40)
      	at clojure.lang.LazySeq.seq(LazySeq.java:49)
      	at clojure.lang.ChunkedCons.chunkedNext(ChunkedCons.java:59)
      	at clojure.lang.ChunkedCons.next(ChunkedCons.java:43)
      	at clojure.lang.RT.length(RT.java:1741)
      	at clojure.lang.RT.seqToArray(RT.java:1682)
      	at clojure.lang.LazySeq.toArray(LazySeq.java:130)
      	at clojure.lang.RT.toArray(RT.java:1655)
      	at clojure.core$to_array.invokeStatic(core.clj:344)
      	at clojure.core$sort.invokeStatic(core.clj:3004)
      	at clojure.core$sort_by.invokeStatic(core.clj:3010)
      	at clojure.core$sort_by.invokeStatic(core.clj:3010)
      	at clojure.core$sort_by.invoke(core.clj:3010)
      	at puppetlabs.services.master.master_core$eval50349$class_info_from_jruby__GT_class_info_for_json__50354$fn__50355.invoke(master_core.clj:276)
      	at puppetlabs.services.master.master_core$eval50349$class_info_from_jruby__GT_class_info_for_json__50354.invoke(master_core.clj:262)
      	at puppetlabs.services.master.master_core$eval50424$environment_class_response_BANG___50431$fn__50432.invoke(master_core.clj:325)
      	at puppetlabs.services.master.master_core$eval50424$environment_class_response_BANG___50431.invoke(master_core.clj:299)
      	at puppetlabs.services.master.master_core$eval50585$environment_class_info_fn__50592$fn__50593$fn__50594.invoke(master_core.clj:443)
      	at puppetlabs.puppetserver.jruby_request$wrap_with_jruby_instance$fn__50023.invoke(jruby_request.clj:48)
      	at puppetlabs.services.master.master_core$eval50826$wrap_with_etag_check__50833$fn__50834$fn__50835.invoke(master_core.clj:609)
      	at puppetlabs.puppetserver.jruby_request$wrap_with_environment_validation$fn__50063.invoke(jruby_request.clj:111)
      	at puppetlabs.puppetserver.jruby_request$wrap_with_error_handling$fn__50019.invoke(jruby_request.clj:33)
      	at puppetlabs.services.master.master_core$eval51064$v3_clojure_routes__51071$fn__51072$fn__51073.invoke(master_core.clj:774)
      	at ring.middleware.params$wrap_params$fn__24923.invoke(params.clj:64)
      	at puppetlabs.trapperkeeper.authorization.ring_middleware$eval26181$wrap_authorization_check__26190$fn__26193$fn__26194.invoke(ring_middleware.clj:284)
      	at puppetlabs.ring_middleware.core$eval24756$wrap_bad_request__24765$fn__24768$fn__24774.invoke(core.clj:170)
      	at puppetlabs.ring_middleware.core$eval24854$wrap_uncaught_errors__24863$fn__24866$fn__24871.invoke(core.clj:216)
      	at puppetlabs.ring_middleware.core$eval24481$wrap_request_logging__24486$fn__24487$fn__24489.invoke(core.clj:47)
      	at puppetlabs.i18n.core$locale_negotiator$fn__124.invoke(core.clj:357)
      	at puppetlabs.ring_middleware.core$eval24510$wrap_response_logging__24515$fn__24516$fn__24517.invoke(core.clj:53)
      	at puppetlabs.puppetserver.ringutils$wrap_with_puppet_version_header$fn__26712.invoke(ringutils.clj:83)
      	at bidi.ring$eval20017$fn__20018.invoke(ring.cljc:25)
      	at bidi.ring$eval19996$fn__19997$G__19987__20006.invoke(ring.cljc:16)
      	at puppetlabs.comidi$make_handler$fn__22127.invoke(comidi.clj:245)
      	at puppetlabs.metrics.http$eval50188$wrap_with_request_metrics__50193$fn__50197$fn__50199$fn__50200$fn__50201.invoke(http.clj:152)
      	at puppetlabs.metrics.http.proxy$java.lang.Object$Callable$7da976d4.call(Unknown Source)
      	at com.codahale.metrics.Timer.time(Timer.java:101)
      	at puppetlabs.metrics.http$eval50188$wrap_with_request_metrics__50193$fn__50197$fn__50199$fn__50200.invoke(http.clj:152)
      	at puppetlabs.metrics.http.proxy$java.lang.Object$Callable$7da976d4.call(Unknown Source)
      	at com.codahale.metrics.Timer.time(Timer.java:101)
      	at puppetlabs.metrics.http$eval50188$wrap_with_request_metrics__50193$fn__50197$fn__50199.invoke(http.clj:148)
      	at puppetlabs.comidi$eval22188$wrap_with_route_metadata__22193$fn__22194$fn__22196.invoke(comidi.clj:332)
      	at puppetlabs.trapperkeeper.services.webserver.jetty9_core$ring_handler$fn__47739.invoke(jetty9_core.clj:433)
      	at puppetlabs.trapperkeeper.services.webserver.jetty9_core.proxy$org.eclipse.jetty.server.handler.AbstractHandler$ff19274a.handle(Unknown Source)
      	at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
      	at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
      	at puppetlabs.trapperkeeper.services.webserver.normalized_uri_helpers$eval47315$normalize_uri_handler__47320$fn__47321$fn__47322.invoke(normalized_uri_helpers.clj:74)
      	at puppetlabs.trapperkeeper.services.webserver.normalized_uri_helpers.proxy$org.eclipse.jetty.server.handler.HandlerWrapper$ff19274a.handle(Unknown Source)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:205)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
      	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:219)
      	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
      	at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:724)
      	at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:56)
      	at com.puppetlabs.trapperkeeper.services.webserver.jetty9.utils.MDCRequestLogHandler.handle(MDCRequestLogHandler.java:36)
      	at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:169)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
      	at org.eclipse.jetty.server.Server.handle(Server.java:531)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
      	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
      	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
      	at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:291)
      	at org.eclipse.jetty.io.ssl.SslConnection$3.succeeded(SslConnection.java:151)
      	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
      	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
      	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680)
      	at java.lang.Thread.run(Thread.java:748) 

       

      Workaround:

      A simple workaround is to reformat the type to not have the extra set of square brackets. Such as:

       Variant[String,Array[String]] $provisioning_api_certs = [], 

       

      This may be related to PDK-1176.

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            tommy.mcneely Tommy McNeely
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support