Invalid json is returned when Git LFS requests return error messages

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Low
    • 6.2.0, 6.0.4, 6.1.3
    • Affects Version/s: 5.13.0
    • Component/s: Git LFS
    • None
    • 1
    • Severity 3 - Minor
    • 4

      Issue Summary

      In cases where Git LFS requests lead to an error, the message contains "\n" characters, which are invalid in the json response (and can cause the client not to show the message)
       

      Steps to Reproduce

      For an authentication error, as an example, the server returns the following json response:

      {"message":"Not authenticated
      
      Please authenticate and try your request again."}
      

      Note that after "Not authenticated" the message contains two "\n" characters.

       

      The git lfs command-line client is unable to parse the message, and instead shows the following:

      batch response: Authentication required: Unable to parse HTTP response for POST <URL>: invalid character '\n' in string literal
      

      Workaround

      A workaround, to see the actual error message, is to enable git debug logging (eg GIT_TRACE=1)

            Assignee:
            Frank Doherty
            Reporter:
            Frank Doherty
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: