Uploaded image for project: 'Bitbucket Server'
  1. Bitbucket Server
  2. BSERV-11645

Invalid json is returned when Git LFS requests return error messages

    XMLWordPrintable

    Details

      Description

      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)

        Attachments

          Activity

            People

            Assignee:
            fdoherty@atlassian.com Frank Doherty
            Reporter:
            fdoherty@atlassian.com Frank Doherty
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: