Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-64943

Runtime error when parsing user from request context

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • 4.21.0
    • Management Console
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

          Occassionally a nil pointer dereference error is logged in the console backend. It is related to new code where we store the authenticated user in the request context. A helper function `GetUserFromRequestContext` attempts to access the user stored in the request context and cast it to  *User type all in one line, but in some cases the user obejct may not be defined, most likely when authentication has failed. We need to make this function nil safe to prevent the runtime error.

      Version-Release number of selected component (if applicable):

          

      How reproducible:

          

      Steps to Reproduce:

          1.
          2.
          3.
          

      Actual results:

          

      Expected results:

          

      Additional info:

          

              jhadvig@redhat.com Jakub Hadvig
              rh-ee-jonjacks Jon Jackson
              None
              None
              YaDan Pei YaDan Pei
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: