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

Non-UTF8 characters in tags cause pull request to display HTTP 500 error

    XMLWordPrintable

    Details

      Description

      If a git tag is created and there is a non-UFT8 character in the name, the user will receive an HTTP 500 error along with a similar error message in the logs:

      java.lang.RuntimeException: Error opening/reading [$BITBUCKET_HOME/shared/data/repositories/32/packed-refs]
              at com.atlassian.stash.internal.scm.git.RawGitAgent.execute(RawGitAgent.java:385) ~[na:na]
              at com.atlassian.stash.internal.scm.git.RawGitAgent.execute(RawGitAgent.java:371) ~[na:na]
              at com.atlassian.stash.internal.scm.git.RawGitAgent.streamPackedRefs(RawGitAgent.java:675) ~[na:na]
              at com.atlassian.stash.internal.scm.git.RawGitAgent.shallowResolveRefs(RawGitAgent.java:299) ~[na:na]
              at com.atlassian.stash.internal.scm.git.command.ResolveRefsCommand.doResolve(ResolveRefsCommand.java:83) ~[na:na]
              at com.atlassian.stash.internal.scm.git.command.ResolveRefsCommand.call(ResolveRefsCommand.java:66) ~[na:na]
              at com.atlassian.stash.internal.scm.git.command.ResolveRefsCommand.call(ResolveRefsCommand.java:33) ~[na:na]
              at com.atlassian.stash.internal.scm.git.command.TransformedGitCommand.call(TransformedGitCommand.java:45) ~[na:na]
              at com.atlassian.stash.internal.repository.DefaultRefService.resolveRef(DefaultRefService.java:242) ~[bitbucket-service-impl-4.8.3.jar:na]
              ... 316 frames trimmed
      Caused by: java.nio.charset.MalformedInputException: Input length = 1
              at java.nio.charset.CoderResult.throwException(CoderResult.java:281) ~[na:1.8.0_74]
              at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339) ~[na:1.8.0_74]
              at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178) ~[na:1.8.0_74]
              at java.io.InputStreamReader.read(InputStreamReader.java:184) ~[na:1.8.0_74]
              at java.io.BufferedReader.fill(BufferedReader.java:161) ~[na:1.8.0_74]
              at java.io.BufferedReader.readLine(BufferedReader.java:324) ~[na:1.8.0_74]
              at java.io.BufferedReader.readLine(BufferedReader.java:389) ~[na:1.8.0_74]
              at com.atlassian.stash.internal.scm.git.RawGitAgent.lambda$streamPackedRefs$9(RawGitAgent.java:676) ~[na:na]
              at com.atlassian.stash.internal.scm.git.RawGitAgent.execute(RawGitAgent.java:376) ~[na:na]
              ... 37 common frames omitted 
      

      You can view the output of the packed-ref with the following:

      cd $BITBUCKET_HOME/shared/data/repositories/32 && cat packed-refs  
      

      With the output you can find the non-UTF8 character.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bturner Bryan Turner
              Reporter:
              mwilliams@atlassian.com Mark Askew
              Votes:
              3 Vote for this issue
              Watchers:
              13 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: