Uploaded image for project: 'Razor'
  1. Razor
  2. RAZOR-144

Confusing error message creating a rule

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: RAZOR 0.14.1
    • Fix Version/s: RAZOR 0.15.0
    • Component/s: QA, Server
    • Labels:
      None
    • Template:
    • Epic Link:
    • Story Points:
      2
    • Sprint:
      April 23

      Description

      When I do this

      razor create-tag --name small --rule '[">=", ["fact", "processorcount"], 1]'
      

      I get the error message

      Error from doing POST http://razor:8080/api/commands/create-tag
      400 Bad Request
      matcher attempts to return values of type String from fact, but only [Numeric] are allowed, matcher attempts to return values of type TrueClass from fact, but only [Numeric] are allowed, matcher attempts to return values of type FalseClass from fact, but only [Numeric] are allowed, matcher attempts to return values of type NilClass from fact, but only [Numeric] are allowed
      

      which doesn't tell me at all what is wrong with that rule. The stacktrace in the server's log isn't terribly helpful, either, as it ends with something like

      /home/lutter/.rbenv/versions/jruby-1.7.8/lib/ruby/gems/shared/gems/seque
      l-4.3.0/lib/sequel/model/base.rb:1301:in `save'
      /home/lutter/.rbenv/versions/jruby-1.7.8/lib/ruby/gems/shared/gems/seque
      l-4.3.0/lib/sequel/model/base.rb:148:in `create'
      /home/lutter/code/razor-server/lib/razor/data/tag.rb:93:in `find_or_crea
      te_with_rule'
      /home/lutter/code/razor-server/app.rb:748:in `App'
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              phong Phong Ly
              Reporter:
              lutter David Lutterkort
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support