clojure.lang.ExceptionInfo: Input to munge-result-row does not match schema: [(named {:avg disallowed-key} row)]

JIRA | Dylan Ratcliffe | 5 months ago
  1. 0

    When using any of the PQL functions it is very easy to get PuppetDB to throw a {{Input to munge-result-row does not match schema}} error. When this is thrown PuppetDB never responds to the query, causing it to timeout. All queries below are calling the root endpoint i.e. {{http://(master):8080/pdb/query/v4?query=(query)}} e.g. The following query: {code} fact_contents[value] { path ~> ["memory",".*","available_bytes"] } {code} Returns the following data as expected: {code} [ { "value": 693243904 }, { "value": 693268480 }, { "value": 3061817344 } ] {code} However if I try to average these numbers: {code} fact_contents[avg(value)] { path ~> ["memory",".*","available_bytes"] } {code} I get the following exception in the PuppetDB logs: {code} clojure.lang.ExceptionInfo: Input to munge-result-row does not match schema: [(named {:avg disallowed-key} row)] at puppetlabs.puppetdb.query.fact_contents$eval26634$munge_result_row__26639.invoke(fact_contents.clj:22) ~[na:na] at clojure.core$map$fn__4785.invoke(core.clj:2646) ~[puppetdb.jar:na] at clojure.lang.LazySeq.sval(LazySeq.java:40) ~[puppetdb.jar:na] at clojure.lang.LazySeq.seq(LazySeq.java:49) ~[puppetdb.jar:na] at clojure.lang.LazySeq.first(LazySeq.java:71) ~[puppetdb.jar:na] at clojure.lang.RT.first(RT.java:667) ~[puppetdb.jar:na] at clojure.core$first__4339.invokeStatic(core.clj:55) ~[puppetdb.jar:na] at clojure.core$first__4339.invoke(core.clj:55) ~[puppetdb.jar:na] at puppetlabs.puppetdb.query_eng$eval26835$produce_streaming_body__26840$fn__26841$fn__26845$fn__26847$fn__26848$fn__26851.invoke(query_eng.clj:182) ~[na:na] at clojure.core$comp$fn__4727.invoke(core.clj:2460) ~[puppetdb.jar:na] at clojure.core$comp$fn__4727.invoke(core.clj:2460) ~[puppetdb.jar:na] at puppetlabs.puppetdb.jdbc$with_query_results_cursor$fn__21251.invoke(jdbc.clj:344) ~[na:na] at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:620) ~[na:na] at clojure.java.jdbc$db_transaction_STAR_.doInvoke(jdbc.clj:568) ~[na:na] at clojure.lang.RestFn.invoke(RestFn.java:425) ~[puppetdb.jar:na] at puppetlabs.puppetdb.jdbc$with_query_results_cursor.invokeStatic(jdbc.clj:337) ~[na:na] at puppetlabs.puppetdb.jdbc$with_query_results_cursor.invoke(jdbc.clj:326) ~[na:na] at puppetlabs.puppetdb.query_eng$eval26835$produce_streaming_body__26840$fn__26841$fn__26845$fn__26847$fn__26848.invoke(query_eng.clj:179) ~[na:na] at puppetlabs.puppetdb.jdbc$with_transacted_connection_fn$fn__21230$fn__21231.invoke(jdbc.clj:306) ~[na:na] {code} However if I try seemingly the exact same thing using a different entity: {code} facts[value] { certname ~ "agent" and name = "uptime_seconds"} {code} Returns: {code} [ { "value": 20844 }, { "value": 20757 } ] {code} And If I try to average it: {code} facts[avg(value)] { certname ~ "agent" and name = "uptime_seconds"} {code} It works: {code} [ { "avg": 20800.5 } ] {code} This seems weird given that the input data for each function seems to be in the exact same format. This not only applicable to the avg() function. In situations where it fails, it will fail regardless of the function that is used.

    JIRA | 5 months ago | Dylan Ratcliffe
    clojure.lang.ExceptionInfo: Input to munge-result-row does not match schema: [(named {:avg disallowed-key} row)]
  2. 0
  3. 0
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0
  6. 0

    When I comment out some random configuration directive in rbac-ui configs. For example in: conf.d/rbac-ui.conf comment out: rbac-api-path and you will get: {code} 1 vagrant@classifier:/vagrant/src/pe-classifier-ui⟫ lein dev Listening for transport dt_socket at address: 4000 2014-08-22 04:38:38,061 INFO [p.t.s.w.jetty9-core] Removing buggy security provider SunPKCS11-NSS version 1.7 2014-08-22 04:38:39,441 INFO [p.t.s.w.jetty9-service] Initializing web server(s). 2014-08-22 04:38:40,135 INFO [m.core] Starting migrations 2014-08-22 04:38:40,373 INFO [m.core] Ending migrations 2014-08-22 04:38:40,592 INFO [p.r.service] Initializing rbac ui webservice at http://:/rbac 2014-08-22 04:38:40,594 INFO [p.c.service] Initializing classifier ui webservice at http://0.0.0.0:9876 2014-08-22 04:38:40,612 ERROR [p.t.internal] Error during service init!!! clojure.lang.ExceptionInfo: Input to register-endpoint! does not match schema: [nil (named (not (some (check % a-clojure.lang.PersistentArrayMap) schemas)) endpoint)] at puppetlabs.trapperkeeper.services.webserver.jetty9_core$eval19128$register_endpoint_BANG___19129.invoke(jetty9_core.clj:334) ~[na:na] at puppetlabs.trapperkeeper.services.webserver.jetty9_core$eval19552$add_ring_handler_BANG___19553$fn__19554.invoke(jetty9_core.clj:704) ~[na:na] at puppetlabs.trapperkeeper.services.webserver.jetty9_core$eval19552$add_ring_handler_BANG___19553.invoke(jetty9_core.clj:697) ~[na:na] at puppetlabs.trapperkeeper.services.webserver.jetty9_service$reify__19860$f_positional__19865$fnk19874_positional__19875$fn__19876.invoke(jetty9_service.clj:23) ~[na:na] at puppetlabs.classifier_ui.service$reify__9417$f_positional__9424$fnk9433_positional__9434$fn__9435.invoke(service.clj:20) ~[na:na] {code} I think we definetelly should give some clearer message what happened and what the user should do. The message to the user is confusing.

    JIRA | 2 years ago | Michal Bryxí
    clojure.lang.ExceptionInfo: Input to register-endpoint! does not match schema: [nil (named (not (some (check % a-clojure.lang.PersistentArrayMap) schemas)) endpoint)]

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. clojure.lang.ExceptionInfo

      Input to munge-result-row does not match schema: [(named {:avg disallowed-key} row)]

      at puppetlabs.puppetdb.query.fact_contents$eval26634$munge_result_row__26639.invoke()
    2. puppetlabs.puppetdb.query
      fact_contents$eval26634$munge_result_row__26639.invoke
      1. puppetlabs.puppetdb.query.fact_contents$eval26634$munge_result_row__26639.invoke(fact_contents.clj:22)[na:na]
      1 frame
    3. Clojure
      core$first__4339.invoke
      1. clojure.core$map$fn__4785.invoke(core.clj:2646)[puppetdb.jar:na]
      2. clojure.lang.LazySeq.sval(LazySeq.java:40)[puppetdb.jar:na]
      3. clojure.lang.LazySeq.seq(LazySeq.java:49)[puppetdb.jar:na]
      4. clojure.lang.LazySeq.first(LazySeq.java:71)[puppetdb.jar:na]
      5. clojure.lang.RT.first(RT.java:667)[puppetdb.jar:na]
      6. clojure.core$first__4339.invokeStatic(core.clj:55)[puppetdb.jar:na]
      7. clojure.core$first__4339.invoke(core.clj:55)[puppetdb.jar:na]
      7 frames
    4. puppetlabs.puppetdb
      query_eng$eval26835$produce_streaming_body__26840$fn__26841$fn__26845$fn__26847$fn__26848$fn__26851.invoke
      1. puppetlabs.puppetdb.query_eng$eval26835$produce_streaming_body__26840$fn__26841$fn__26845$fn__26847$fn__26848$fn__26851.invoke(query_eng.clj:182)[na:na]
      1 frame
    5. Clojure
      core$comp$fn__4727.invoke
      1. clojure.core$comp$fn__4727.invoke(core.clj:2460)[puppetdb.jar:na]
      2. clojure.core$comp$fn__4727.invoke(core.clj:2460)[puppetdb.jar:na]
      2 frames
    6. puppetlabs.puppetdb
      jdbc$with_query_results_cursor$fn__21251.invoke
      1. puppetlabs.puppetdb.jdbc$with_query_results_cursor$fn__21251.invoke(jdbc.clj:344)[na:na]
      1 frame
    7. Clojure
      RestFn.invoke
      1. clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:620)[na:na]
      2. clojure.java.jdbc$db_transaction_STAR_.doInvoke(jdbc.clj:568)[na:na]
      3. clojure.lang.RestFn.invoke(RestFn.java:425)[puppetdb.jar:na]
      3 frames
    8. puppetlabs.puppetdb
      jdbc$with_transacted_connection_fn$fn__21230$fn__21231.invoke
      1. puppetlabs.puppetdb.jdbc$with_query_results_cursor.invokeStatic(jdbc.clj:337)[na:na]
      2. puppetlabs.puppetdb.jdbc$with_query_results_cursor.invoke(jdbc.clj:326)[na:na]
      3. puppetlabs.puppetdb.query_eng$eval26835$produce_streaming_body__26840$fn__26841$fn__26845$fn__26847$fn__26848.invoke(query_eng.clj:179)[na:na]
      4. puppetlabs.puppetdb.jdbc$with_transacted_connection_fn$fn__21230$fn__21231.invoke(jdbc.clj:306)[na:na]
      4 frames