Ruby message patterns

Here is a comprehensive list of exception message patterns the default grouping algorithm recognizes in ruby. For each pattern you will find:

  • Condition: circumstances under which we apply the pattern
  • Patterns: one or more regular expressions that we use to match against the exception message
  • Applied grouping: the fields we include when computing the fingerprint when the pattern matches

AbstractController::ActionNotFound

  • Condition:

    • framework is Rails
    • root exception class is AbstractController::ActionNotFound
  • Patterns:

    ^The action '<action>' could not be found for <controller>$
    • action: (\S+)
    • controller: (\S+)
  • Applied grouping:

    • Include controller in the fingerprint

ActionController::RoutingError

  • Condition:

    • framework is Rails
    • root exception class is ActionController::RoutingError
  • Patterns:

    ^No route matches \[<method>\] "<path>"$
    • method: ([a-zA-Z]+)
    • path: (\S+)
  • Applied grouping:

    • Do not include any variables

Rack::QueryParser::InvalidParameterError

  • Condition:

    • framework is Rails
    • root exception class is Rack::QueryParser::InvalidParameterError
  • Patterns:

    ^Invalid encoding for parameter: <parameter>$
    • parameter: (\S+)
  • Applied grouping:

    • Do not include any variables

AASM::InvalidTransition

  • Condition:

    • language is ruby
    • root exception class is AASM::InvalidTransition
  • Patterns:

    ^Event '<source_state>' cannot transition from '<target_state>'.$
    • source_state: (\S+)
    • target_state: (\S+)
  • Applied grouping:

    • Include source_state and target_state in the fingerprint

ActiveRecord::ConnectionTimeoutError

  • Condition:

    • language is ruby
    • root exception class is ActiveRecord::ConnectionTimeoutError
  • Patterns:

    ^could not obtain a connection from the pool within <timeout> seconds \(waited <wait_time> seconds\); all pooled connections were in use$
    • timeout: (\S+)
    • wait_time: (\S+)
  • Applied grouping:

    • Do not include any variables

ActionController::ParameterMissing

  • Condition:

    • language is ruby
    • root exception class is ActionController::ParameterMissing
  • Patterns:

    ^param is missing or the value is empty: <param>$
    • param: (\w+)
  • Applied grouping:

    • Include param in the fingerprint

ActiveRecord::RecordInvalid

  • Condition:

    • language is ruby
    • root exception class is ActiveRecord::RecordInvalid
  • Patterns:

    ^Validation failed: <reason>$
    • reason: (.*)
  • Applied grouping:

    • Do not include any variables

ActiveRecord::RecordNotFound - Query by friendly id

  • Condition:

    • language is ruby
    • root exception class is ActiveRecord::RecordNotFound
  • Patterns:

    ^can't find record with friendly id: "<id>"$
    • id: (\S+)
  • Applied grouping:

    • Do not include any variables

ActiveRecord::RecordNotFound - No id column specified

  • Condition:

    • language is ruby
    • root exception class is ActiveRecord::RecordNotFound
  • Patterns:

    ^Couldn't find <orm_class> without an ID$
    • orm_class: (\S+)
  • Applied grouping:

    • Include orm_class in the fingerprint

ActiveRecord::RecordNotFound - Query by id

  • Condition:

    • language is ruby
    • root exception class is ActiveRecord::RecordNotFound
  • Patterns:

    ^Couldn't find <orm_class>$
    • orm_class: (\S+)
    ^Couldn't find <orm_class> with <id_name>\s*=\s*<id>.*$
    • orm_class: (\S+)
    • id_name: (['"\w]+)
    • id: (\S+)
  • Applied grouping:

    • Include orm_class in the fingerprint

ArgumentError - Comparision

  • Condition:

    • language is ruby
    • root exception class is ArgumentError
  • Patterns:

    ^comparison of <class_name> with <compared_to> failed$
    • class_name: (\S+)
    • compared_to: (\S+)
  • Applied grouping:

    • Include class_name in the fingerprint

ArgumentError - Function call

  • Condition:

    • language is ruby
    • root exception class is ArgumentError
  • Patterns:

    ^wrong number of arguments \(given <given_arguments>, expected <expected_arguments>\)$
    • given_arguments: (\S+)
    • expected_arguments: (\S+)
  • Applied grouping:

    • Do not include any variables

Errno::ENOENT

  • Condition:

    • language is ruby
    • root exception class is Errno::ENOENT
  • Patterns:

    ^No such file or directory @ <method> \- <file>$
    • method: (\w+)
    • file: (\S+)
  • Applied grouping:

    • Do not include any variables

Errno::ENOSPC

  • Condition:

    • language is ruby
    • root exception class is Errno::ENOSPC
  • Patterns:

    ^No space left on device @ <method> \- <location>$
    • method: (\w+)
    • location: (\S+)
  • Applied grouping:

    • Do not include any variables

Faraday::ClientError

  • Condition:

    • language is ruby
    • root exception class is Faraday::ClientError, Faraday::BadRequestError, Faraday::UnauthorizedError, Faraday::ForbiddenError, Faraday::ResourceNotFound, Faraday::UnprocessableEntityError or Faraday::ServerError
  • Patterns:

    ^the server responded with status <status_code>$
    • status_code: (\d+)
  • Applied grouping:

    • Include status_code in the fingerprint

JSON::ParserError

  • Condition:

    • language is ruby
    • root exception class is JSON::ParserError
  • Patterns:

    ^<line_number>: unexpected token at <input>$
    • line_number: (\d+)
    • input: (\S*)
  • Applied grouping:

    • Do not include any variables

Kafka::BufferOverflow

  • Condition:

    • language is ruby
    • root exception class is Kafka::BufferOverflow
  • Patterns:

    ^Cannot produce to <topic> max queue size \(<max_queue_size> messages\) reached$
    • topic: (\S+)
    • max_queue_size: (\d+)
  • Applied grouping:

    • Include topic in the fingerprint

Kafka::DeliveryFailed

  • Condition:

    • language is ruby
    • root exception class is Kafka::DeliveryFailed
  • Patterns:

    ^Failed to send messages to <topic>/<partition>$
    • topic: (\S+)
    • partition: (\d+)
  • Applied grouping:

    • Include topic in the fingerprint

Mandrill::UnknownTemplateError

  • Condition:

    • language is ruby
    • root exception class is Mandrill::UnknownTemplateError
  • Patterns:

    ^No such template "<template_name>"$
    • template_name: (\S+)
  • Applied grouping:

    • Include template_name in the fingerprin

Mysql2::Error - Duplicate entry

  • Condition:

    • language is ruby
    • root exception class is Mysql2::Error
  • Patterns:

    ^Duplicate entry <value> for key <key>$
    • value: (\S+)
    • key: (\S+)
  • Applied grouping:

    • Include key in the fingerprint

Mysql2::Error - Data too long

  • Condition:

    • language is ruby
    • root exception class is Mysql2::Error
  • Patterns:

    ^Data too long for column '<column>' at row <row>$
    • column: (\S+)
    • row: (\d+)
  • Applied grouping:

    • Include column in the fingerprint

Mysql2::Error - Table doesn't exist

  • Condition:

    • language is ruby
    • root exception class is Mysql2::Error
  • Patterns:

    ^Table <table> doesn't exist$
    • table: (\S+)
  • Applied grouping:

    • Do not include any variables

Mysql2::Error - Unknown server host

  • Condition:

    • language is ruby
    • root exception class is Mysql2::Error or Mysql2::Error::ConnectionError
  • Patterns:

    ^Unknown MySQL server host '<host_name>' \(-2\)$
    • host_name: (\S+)
  • Applied grouping:

    • Include host_name in the fingerprint

Mysql2::Error - SQLProxy times out

  • Condition:

    • language is ruby
    • root exception class is Mysql2::Error
  • Patterns:

    ^Max connect timeout reached while reaching hostgroup <hostgroup_id> after <timeout>ms$
    • hostgroup_id: (\d+)
    • timeout: (\d+)
  • Applied grouping:

    • Include hostgroup_id in the fingerprint

NameError

  • Condition:

    • language is ruby
    • root exception class is NameError
  • Patterns:

    ^undefined local variable or method \`<identifier>\' for #<#<<class_name>:<class_object_id>>:<object_id>>$
    • identifier: (\S+)
    • class_name: ([\w:\.]+)
    • class_object_id: (0x[0-9a-fA-F]+)
    • object_id: (0x[0-9a-fA-F]+)
    ^undefined local variable or method \`<method_name>\' for #<<class_name>:<object_id>>$
    • method_name: (.+)
    • class_name: ([\w:\.]+)
    • object_id: (0x[0-9a-fA-F]+)
    ^undefined local variable or method \`<method_name>\' for <instance>:<class_name>$
    • method_name: (.+)
    • instance: ((?:[\S:]*)(?:\S+))
    • class_name: (\w+)
    ^undefined local variable or method \`<method_name>\ for <class_name>$
    • method_name: (.+)
    • class_name: ([\w:\.]+)
  • Applied grouping:

    • Include identifier and class_name in the fingerprint

Net::SSH::AuthenticationFailed

  • Condition:

    • language is ruby
    • root exception class is Net::SSH::AuthenticationFailed
  • Patterns:

    ^Authentication failed for user <user>@<host>$
    • user: (\S*)
    • host: (\S*)
  • Applied grouping:

    • Include user in the fingerprint

NoMethodError

  • Condition:

    • language is ruby
    • root exception class is NoMethodError
  • Patterns:

    ^undefined method \`<identifier>\' for #<#<<class_name>:<class_object_id>>:<object_id>>$
    • identifier: (\S+)
    • class_name: ([\w:\.]+)
    • class_object_id: (0x[0-9a-fA-F]+)
    • object_id: (0x[0-9a-fA-F]+)
    ^undefined method \`<method_name>\' for #<<class_name>:<object_id>>$
    • method_name: (.+)
    • class_name: ([\w:\.]+)
    • object_id: (0x[0-9a-fA-F]+)
    ^undefined method \`<method_name>\' for <instance>:<class_name>$
    • method_name: (.+)
    • instance: ((?:[\S:]*)(?:\S+))
    • class_name: (\w+)
    ^undefined method \`<method_name>\' for <class_name>$
    • method_name: (.+)
    • class_name: ([\w:\.]+)
  • Applied grouping:

    • If the extracted class_name is NilClass, we include only the class_name
    • otherwise we include both the class_name and the method_name

OpenSSL::SSL::SSLError

  • Condition:

    • language is ruby
    • root exception class is OpenSSL::SSL::SSLError
  • Patterns:

    ^hostname "<host>" does not match the server certificate$
    • host: (\S+)
  • Applied grouping:

    • Include host in the fingerprint

Rack::Timeout::RequestTimeoutException

  • Condition:

    • language is ruby
    • root exception class is Rack::Timeout::RequestTimeoutException
  • Patterns:

    ^Request waited <wait>ms, then ran for longer than <timeout>ms$
    • wait: (\d+)
    • timeout: (\d+)
  • Applied grouping:

    • Do not include any variables

Redis::CannotConnectError

  • Condition:

    • language is ruby
    • root exception class is Redis::CannotConnectError
  • Patterns:

    ^Error connecting to Redis on <host>:<port> \(<error_code>\)$
    • host: (\S+)
    • port: (\d+)
    • error_code: (\S+)
  • Applied grouping:

    • Include error_code in the fingerprint

Timeout::Error

  • Condition:

    • language is ruby
    • root exception class is Timeout::Error
  • Patterns:

    ^Waited <timeout> sec$
    • timeout: (\S+)
  • Applied grouping:

    • Do not include any variables

TypeError - Implicit conversion

  • Condition:

    • language is ruby
    • root exception class is TypeError
  • Patterns:

    ^no implicit conversion of <source_class> into <target_class>$
    • source_class: (\S+)
    • target_class: (\w+)
  • Applied grouping:

    • Include source_class and target_class in the fingerprint

TypeError - Type coercion

  • Condition:

    • language is ruby
    • root exception class is TypeError
  • Patterns:

    ^<source_class> can't be coerced into <target_class>$
    • source_class: (\w+)
    • target_class: (\w+)
  • Applied grouping:

    • Include source_class and target_class in the fingerprint

TypeError - Explicit type cast

  • Condition:

    • language is ruby
    • root exception class is TypeError
  • Patterns:

    ^can't convert <source_class> into <target_class>$
    • source_class: (\w+)
    • target_class: (\w+)
  • Applied grouping:

    • Include source_class and target_class in the fingerprint

URI::InvalidURIError

  • Condition:

    • language is ruby
    • root exception class is URI::InvalidURIError
  • Patterns:

    ^URI must be ascii only <uri>$
    • uri: (\S+)
  • Applied grouping:

    • Do not include any variables