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

On a genius mirror node, synchronization fails if branch/ref name contains non-UTF-8 character(s)

    XMLWordPrintable

    Details

      Description

      Issue Summary

      When a snapshot/incremental sync is run on a mirror node when the mirror node already has a branch containing non-UTF-8 character in it, it appears in git for-each-ref command run on the mirror. This causes the following error:

      2020-03-05 08:45:08,274 ERROR [farm-operation-4] *76AH03x523x1152641372x2266 c.a.b.i.m.m.f.t.ReplyingTopicListener Error while processing request TopicRequest{message=RefChangeChunk{farmSynchronizationRequest=FarmSynchronizationRequest{externalRepositoryId=1755, type=snapshot}, last=true, index=0, digest=681696ffb4e6b3c16adf9f302a87a546d0f7b443, payload.length=25785}, replyTopic=refChangeChunk_bacbb4e9-b69b-4285-86ec-f2ebace70f6b_reply, anticipatedResponders=2}
      java.io.UncheckedIOException: java.nio.charset.MalformedInputException: Input length = 1
              at com.atlassian.bitbucket.io.LineReader$1.hasNext(LineReader.java:259)
              at com.atlassian.bitbucket.internal.mirroring.mirror.farm.refchange.CompositeRefChangeIterator.computeNext(CompositeRefChangeIterator.java:70)
              at com.atlassian.bitbucket.internal.mirroring.mirror.farm.refchange.CompositeRefChangeIterator.computeNext(CompositeRefChangeIterator.java:25)
              at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
              at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136)
              at java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1811)
              at java.util.stream.StreamSpliterators$WrappingSpliterator.lambda$initPartialTraversalState$0(StreamSpliterators.java:294)
              at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.fillBuffer(StreamSpliterators.java:206)
              at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(StreamSpliterators.java:169)
              at java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(StreamSpliterators.java:300)
              at java.util.Spliterators$1Adapter.hasNext(Spliterators.java:681)
              at com.google.common.collect.Iterators$4.next(Iterators.java:612)
              at com.google.common.collect.Iterators$4.next(Iterators.java:599)
              at java.util.Iterator.forEachRemaining(Iterator.java:116)
              at com.atlassian.bitbucket.internal.mirroring.mirror.farm.synchronization.ObjectFetchHelper.perform(ObjectFetchHelper.java:56)
              at com.atlassian.bitbucket.internal.mirroring.mirror.farm.synchronization.RepositorySynchronizationOperation.perform(RepositorySynchronizationOperation.java:123)
              at com.atlassian.bitbucket.internal.mirroring.mirror.farm.synchronization.RepositorySynchronizationOperation.perform(RepositorySynchronizationOperation.java:39)
              at com.atlassian.bitbucket.internal.mirroring.mirror.farm.topic.operation.MetricCollectingMirrorOperation.perform(MetricCollectingMirrorOperation.java:66)
              at com.atlassian.bitbucket.internal.mirroring.mirror.farm.refchange.RefChangeChunkOperation.perform(RefChangeChunkOperation.java:100)
              at com.atlassian.bitbucket.internal.mirroring.mirror.farm.refchange.RefChangeChunkOperation.perform(RefChangeChunkOperation.java:62)
              at com.atlassian.bitbucket.internal.mirroring.mirror.farm.topic.operation.AuthenticatedMirrorOperation.lambda$perform$0(AuthenticatedMirrorOperation.java:37)
              at com.atlassian.stash.internal.user.DefaultEscalatedSecurityContext.call(DefaultEscalatedSecurityContext.java:58)
              at com.atlassian.bitbucket.internal.mirroring.mirror.DefaultUpstreamUserHelper.performAsUpstreamUser(DefaultUpstreamUserHelper.java:93)
              at com.atlassian.bitbucket.internal.mirroring.mirror.farm.topic.operation.AuthenticatedMirrorOperation.perform(AuthenticatedMirrorOperation.java:37)
              at com.atlassian.bitbucket.internal.mirroring.mirror.farm.topic.operation.MultiThreadedMirrorOperation.lambda$perform$0(MultiThreadedMirrorOperation.java:45)
              at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
              at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
              at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
              at com.atlassian.sal.core.executor.ThreadLocalDelegateRunnable.run(ThreadLocalDelegateRunnable.java:34)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.lang.Thread.run(Thread.java:748)
              ... 1 frame trimmed
      Caused by: java.nio.charset.MalformedInputException: Input length = 1
              at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
              at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339)
              at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
              at java.io.InputStreamReader.read(InputStreamReader.java:184)
              at java.io.BufferedReader.fill(BufferedReader.java:161)
              at java.io.BufferedReader.read(BufferedReader.java:182)
              at com.atlassian.bitbucket.io.ReaderLineReader.read(ReaderLineReader.java:22)
              at com.atlassian.bitbucket.io.LineReader.readNext(LineReader.java:292)
              at com.atlassian.bitbucket.io.LineReader.readLine(LineReader.java:86)
              at com.atlassian.bitbucket.io.LineReader$1.hasNext(LineReader.java:255)
              ... 31 common frames omitted
      

      The error appears to be caused by the same JAVA API that was causing https://jira.atlassian.com/browse/BSERV-9293.

      Steps to Reproduce

      1. Start a mirror farm with 1 or more mirrors.
      2. Setup some project on mirror farm.
      3. Clone one of the repositories in this project from primary.
      4. Push a new branch which has non-UTF characters
      5. git ls-remote <<Mirror Repository URL>>

      Expected Results

      Newly created branch appears in the results

      Actual Results

      Newly created branch is missing from the results

      Workaround

      If the conflicting branch/ref is renamed and the non-UTF-8 characters removed, sync succeeds. After removing branch from repository in primary server, branch needs to be removed from the mirror manually by logging into the server and cd to the repository directory in bitbucket home.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              khughes@atlassian.com Kristy
              Reporter:
              kplaha Kanwar
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Backbone Issue Sync