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

Repository import fails if username contains @ symbol

    XMLWordPrintable

    Details

      Description

      Issue Summary

      When importing a repository from the UI into Bitbucket, import fails if username contains @ symbol.

      Steps to Reproduce

      1. Choose/create a project in Bitbucket
      2. Go to Import Repository page
      3. Choose Git as the import source/scheme
      4. Enter clone URL
      5. Enter username with @ (say an email address)
      6. Enter password

      Expected Results

      Import is successful.

      Actual Results

      The below exception is thrown in the atlassian-bitbucket.log file:

      2020-05-12 08:06:09,012 ERROR [pool-5-thread-7]  c.a.b.i.i.repository.RefSyncTask Failed to import repository: PMO/benefit-mastercard-service[294]2020-05-12 08:06:09,012 ERROR [pool-5-thread-7]  c.a.b.i.i.repository.RefSyncTask Failed to import repository: PRJ/repo-slug[294]com.atlassian.bitbucket.scm.CommandFailedException: '/usr/local/git/bin/git -c gc.auto=0 -c credential.helper= -c credential.username=user@domain fetch --force --prune --progress https://user%40domain@source-clone-url +refs/*:refs/*' exited with code 128 saying: fatal: unable to access 'https://user%40domain@source-clone-url': The requested URL returned error: 403 at com.atlassian.bitbucket.scm.DefaultCommandExitHandler.onError(DefaultCommandExitHandler.java:47) at com.atlassian.bitbucket.scm.git.command.GitCommandExitHandler.evaluateThrowable(GitCommandExitHandler.java:111) at com.atlassian.bitbucket.scm.git.command.GitCommandExitHandler.onError(GitCommandExitHandler.java:208) at com.atlassian.bitbucket.scm.DefaultCommandExitHandler.onExit(DefaultCommandExitHandler.java:32) at com.atlassian.stash.internal.scm.git.command.fetch.FetchExitHandler.onExit(FetchExitHandler.java:39) at com.atlassian.bitbucket.scm.BaseCommand.callExitHandler(BaseCommand.java:153) at com.atlassian.bitbucket.scm.BaseCommand$CommandFuture.internalGet(BaseCommand.java:287) at com.atlassian.bitbucket.scm.BaseCommand$CommandFuture.get(BaseCommand.java:251) at com.atlassian.bitbucket.scm.BaseCommand.call(BaseCommand.java:87) at com.atlassian.stash.internal.scm.git.command.SimpleGitCommand.configureAndCall(SimpleGitCommand.java:84) at com.atlassian.stash.internal.scm.git.command.fetch.MirrorSynchronizeCommand.call(MirrorSynchronizeCommand.java:105) at com.atlassian.stash.internal.scm.git.command.fetch.MirrorSynchronizeCommand.call(MirrorSynchronizeCommand.java:32) at com.atlassian.bitbucket.internal.importer.repository.RefSyncTask.syncRefs(RefSyncTask.java:118) at com.atlassian.bitbucket.internal.importer.repository.RefSyncTask.importRepository(RefSyncTask.java:97) at com.atlassian.stash.internal.user.DefaultEscalatedSecurityContext.call(DefaultEscalatedSecurityContext.java:58) at com.atlassian.bitbucket.internal.importer.repository.RefSyncTask.call(RefSyncTask.java:62) at com.atlassian.bitbucket.internal.importer.repository.RefSyncTask.call(RefSyncTask.java:35) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.lang.Thread.run(Thread.java:748) ... 1 frame trimmed
      Caused by: com.atlassian.utils.process.ProcessException: Non-zero exit code: 128 at com.atlassian.bitbucket.scm.SummarizingProcessHandler.complete(SummarizingProcessHandler.java:47) at com.atlassian.utils.process.ExternalProcessImpl.wrapUpProcess(ExternalProcessImpl.java:667) at com.atlassian.utils.process.ExternalProcessImpl.finish(ExternalProcessImpl.java:163) at com.atlassian.bitbucket.scm.BaseCommand$CommandFuture.get(BaseCommand.java:249) 
      ... 13 common frames omitted
      

      Workaround

      The only known workaround would be to clone the external repository outside of Bitbucket and then push it.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              kplaha Kanwar
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: