Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-17691

fatal NoMethodError and TypeError when hitting the API during startup

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • 6.15.0
    • 6.14.0
    • Infrastructure
    • 0
    • False
    • Hide

      None

      Show
      None
    • False
    • CLOSED
    • 400
    • Platform
    • Moderate
    • None

      Description of problem:
      When the app is "starting up" (e.g. after a "systemctl restart foreman") and one hits it with many requests (like GET /api/status), one often sees errors like the following in the logs:

      2023-05-10T07:53:33 [F|app|65251c92]
      65251c92 | NoMethodError (undefined method `chr' for nil:NilClass):
      65251c92 |
      65251c92 | lib/foreman/middleware/logging_context_session.rb:22:in `call'
      65251c92 | lib/foreman/middleware/logging_context_request.rb:11:in `call'
      65251c92 | katello (4.9.0.pre.master) lib/katello/prevent_json_parsing.rb:12:in `call'

      2023-05-10T07:53:34 [F|app|ed179145]
      ed179145 | TypeError (nil can't be coerced into Integer):
      ed179145 |
      ed179145 | lib/foreman/middleware/logging_context_session.rb:22:in `call'
      ed179145 | lib/foreman/middleware/logging_context_request.rb:11:in `call'
      ed179145 | katello (4.9.0.pre.master) lib/katello/prevent_json_parsing.rb:12:in `call'

      Version-Release number of selected component (if applicable):
      Reporting this for 6.14, but I have seen this on older releases too (just never bothered to report)

      How reproducible:
      often, but not always

      Steps to Reproduce:
      1. systemctl restart foreman
      2. echo 'GET https://admin:changeme@satellite.example.com/api/status' | vegeta attack -duration=10s -insecure | vegeta report
      (or any other http load tester, really doesn't matter, as long as it produces many parallel requests)

      Actual results:
      some requests end up with errors

      Expected results:
      no errors?

      Additional info:
      I think this has something to do with the app still starting up, as those runs also often have way lower "request/second" numbers than later runs that do not expose the same errors (15 vs 50 in my test env).
      Also, I am almost certain the stack trace in the log is a red herring, but that's all I have to offer, sorry.

            aruzicka@redhat.com Adam Ruzicka
            jira-bugzilla-migration RH Bugzilla Integration
            RH Bugzilla Integration RH Bugzilla Integration
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: