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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • High
    • 6.2.0, 5.16.4, 6.0.4, 6.1.3
    • 4.8.3, 5.14.0
    • None

    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

              bturner Bryan Turner (Inactive)
              mwilliams@atlassian.com Mark A.
              Votes:
              3 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: