java.lang.IndexOutOfBoundsException: null

JIRA | Jeremy Barlow | 1 year ago
  1. 0

    If a rule in a trapperkeeper-authorization config includes an allow/deny backreference but no corresponding capture group is present in the rule's path, an ugly-looking error message is returned to the caller. For example, I modified the ring-example to include the following rule: {noformat} authorization: { version: 1 rules: [ { match-request: { path: "^/hello/all-allowed$" type: "regex" } allow: "$1" name: "users allowed" sort-order: 500 }, ... ] } {noformat} When making a request to the server which matches the rule, http://localhost:8080/hello/all-allowed, the following error message is returned in the HTTP response to the caller: {noformat} 2015-10-05 14:10:52,851 WARN [o.e.j.s.HttpChannel] /hello/all-allowed java.lang.IndexOutOfBoundsException: null at clojure.lang.PersistentVector.arrayFor(PersistentVector.java:107) ~[clojure-1.6.0.jar:na] at clojure.lang.PersistentVector.nth(PersistentVector.java:111) ~[clojure-1.6.0.jar:na] at clojure.lang.RT.nth(RT.java:763) ~[clojure-1.6.0.jar:na] at puppetlabs.trapperkeeper.authorization.acl$substitute_backreference$fn__9150.invoke(acl.clj:174) ~[na:na] at clojure.string$replace_by.invoke(string.clj:67) ~[clojure-1.6.0.jar:na] at clojure.string$replace.invoke(string.clj:106) ~[clojure-1.6.0.jar:na] at puppetlabs.trapperkeeper.authorization.acl$substitute_backreference.invoke(acl.clj:174) ~[na:na] at puppetlabs.trapperkeeper.authorization.acl$interpolate_backreference$fn__9154.invoke(acl.clj:180) ~[na:na] {noformat} In this case, there are no capture groups in the regex so the substitution for "$1" fails. The error message should more clearly indicate the actual problem. Ideally, it would also seem better if this could be validated as the rules are first loaded - not just lazily when rules are being evaluated - so that a user can detect the existence of a faulty rule right away.

    JIRA | 1 year ago | Jeremy Barlow
    java.lang.IndexOutOfBoundsException: null
  2. 0

    If a rule in a trapperkeeper-authorization config includes an allow/deny backreference but no corresponding capture group is present in the rule's path, an ugly-looking error message is returned to the caller. For example, I modified the ring-example to include the following rule: {noformat} authorization: { version: 1 rules: [ { match-request: { path: "^/hello/all-allowed$" type: "regex" } allow: "$1" name: "users allowed" sort-order: 500 }, ... ] } {noformat} When making a request to the server which matches the rule, http://localhost:8080/hello/all-allowed, the following error message is returned in the HTTP response to the caller: {noformat} 2015-10-05 14:10:52,851 WARN [o.e.j.s.HttpChannel] /hello/all-allowed java.lang.IndexOutOfBoundsException: null at clojure.lang.PersistentVector.arrayFor(PersistentVector.java:107) ~[clojure-1.6.0.jar:na] at clojure.lang.PersistentVector.nth(PersistentVector.java:111) ~[clojure-1.6.0.jar:na] at clojure.lang.RT.nth(RT.java:763) ~[clojure-1.6.0.jar:na] at puppetlabs.trapperkeeper.authorization.acl$substitute_backreference$fn__9150.invoke(acl.clj:174) ~[na:na] at clojure.string$replace_by.invoke(string.clj:67) ~[clojure-1.6.0.jar:na] at clojure.string$replace.invoke(string.clj:106) ~[clojure-1.6.0.jar:na] at puppetlabs.trapperkeeper.authorization.acl$substitute_backreference.invoke(acl.clj:174) ~[na:na] at puppetlabs.trapperkeeper.authorization.acl$interpolate_backreference$fn__9154.invoke(acl.clj:180) ~[na:na] {noformat} In this case, there are no capture groups in the regex so the substitution for "$1" fails. The error message should more clearly indicate the actual problem. Ideally, it would also seem better if this could be validated as the rules are first loaded - not just lazily when rules are being evaluated - so that a user can detect the existence of a faulty rule right away.

    JIRA | 1 year ago | Jeremy Barlow
    java.lang.IndexOutOfBoundsException: null
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

    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. java.lang.IndexOutOfBoundsException

      null

      at clojure.lang.PersistentVector.arrayFor()
    2. Clojure
      RT.nth
      1. clojure.lang.PersistentVector.arrayFor(PersistentVector.java:107)[clojure-1.6.0.jar:na]
      2. clojure.lang.PersistentVector.nth(PersistentVector.java:111)[clojure-1.6.0.jar:na]
      3. clojure.lang.RT.nth(RT.java:763)[clojure-1.6.0.jar:na]
      3 frames
    3. puppetlabs.trapperkeeper.authorization
      acl$substitute_backreference$fn__9150.invoke
      1. puppetlabs.trapperkeeper.authorization.acl$substitute_backreference$fn__9150.invoke(acl.clj:174)[na:na]
      1 frame
    4. Clojure
      string$replace.invoke
      1. clojure.string$replace_by.invoke(string.clj:67)[clojure-1.6.0.jar:na]
      2. clojure.string$replace.invoke(string.clj:106)[clojure-1.6.0.jar:na]
      2 frames
    5. puppetlabs.trapperkeeper.authorization
      acl$interpolate_backreference$fn__9154.invoke
      1. puppetlabs.trapperkeeper.authorization.acl$substitute_backreference.invoke(acl.clj:174)[na:na]
      2. puppetlabs.trapperkeeper.authorization.acl$interpolate_backreference$fn__9154.invoke(acl.clj:180)[na:na]
      2 frames