replication to bitbucket.org https URLs fails with "not authorized"

1,063 views
Skip to first unread message

philipp...@gmail.com

unread,
Apr 17, 2019, 11:38:46 PM4/17/19
to Repo and Gerrit Discussion

Hello,

I am trying to replicate to bitbucket.org from repositories in a Gerrit 2.16.7 installation over https.
I've set up bitbucket.org access keys, and am able to push and pull with git on the command line to the same URLs. When Gerrit attempts to replicate, it fails with "org.eclipse.jgit.errors.TransportException: https://US...@bitbucket.org/ORGANIZATION/Test.git: not authorized".

Does anyone have ideas why it fails? I also tried creating a ~/.netrc file with username/password.

Thanks!
Philippe McLean


My configuration looks like:

replication.config:

[remote "bitbucket"]
    push = +refs/tags/*:refs/tags/*
    push = +refs/heads/*:refs/heads/*
    mirror = true
    projects = Test
    replicateOnStartup = true
    replicatePermissions = false

secure.config:

[remote "bitbucket"]
   password = PASSWORD

I restart replication with:

ssh -p 29418 GERRITSERVER gerrit plugin reload replication
ssh -p 29418 GERRITSERVER replication start --wait --all

The replication.log reports:

[2019-04-17 20:15:33,132] [99077ed2] Replication to https://US...@bitbucket.org/ORGANIZATION/Test.git started...
[2019-04-17 20:15:33,552] [99077ed2] Cannot replicate to https://US...@bitbucket.org/ORGANIZATION/Test.git
org.eclipse.jgit.errors.TransportException: https://US...@bitbucket.org/ORGANIZATION/Test.git: not authorized
        at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:544)
        at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:362)
        at com.googlesource.gerrit.plugins.replication.PushOne.listRemote(PushOne.java:557)
        at com.googlesource.gerrit.plugins.replication.PushOne.doPushAll(PushOne.java:496)
        at com.googlesource.gerrit.plugins.replication.PushOne.generateUpdates(PushOne.java:489)
        at com.googlesource.gerrit.plugins.replication.PushOne.pushVia(PushOne.java:441)
        at com.googlesource.gerrit.plugins.replication.PushOne.runImpl(PushOne.java:431)
        at com.googlesource.gerrit.plugins.replication.PushOne.runPushOperation(PushOne.java:316)
        at com.googlesource.gerrit.plugins.replication.PushOne.access$000(PushOne.java:82)
        at com.googlesource.gerrit.plugins.replication.PushOne$1.call(PushOne.java:281)
        at com.googlesource.gerrit.plugins.replication.PushOne$1.call(PushOne.java:278)
        at com.google.gerrit.server.util.RequestScopePropagator.lambda$cleanup$1(RequestScopePropagator.java:212)
        at com.google.gerrit.server.util.RequestScopePropagator.lambda$context$0(RequestScopePropagator.java:191)
        at com.google.gerrit.server.git.PerThreadRequestScope$Propagator.lambda$scope$0(PerThreadRequestScope.java:73)
        at com.googlesource.gerrit.plugins.replication.PushOne.run(PushOne.java:285)
        at com.google.gerrit.server.logging.LoggingContextAwareRunnable.run(LoggingContextAwareRunnable.java:72)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:646)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

Luca Milanesio

unread,
Apr 18, 2019, 5:00:39 PM4/18/19
to philipp...@gmail.com, Luca Milanesio, Repo and Gerrit Discussion

On 18 Apr 2019, at 05:38, philipp...@gmail.com wrote:


Hello,

I am trying to replicate to bitbucket.org from repositories in a Gerrit 2.16.7 installation over https.
I've set up bitbucket.org access keys, and am able to push and pull with git on the command line to the same URLs. When Gerrit attempts to replicate, it fails with "org.eclipse.jgit.errors.TransportException: https://US...@bitbucket.org/ORGANIZATION/Test.git: not authorized".

Does anyone have ideas why it fails? I also tried creating a ~/.netrc file with username/password.

Thanks!
Philippe McLean


My configuration looks like:

replication.config:

[remote "bitbucket"]

The USER should be removed from the URL and go into the username in the secure.config.

    push = +refs/tags/*:refs/tags/*
    push = +refs/heads/*:refs/heads/*
    mirror = true
    projects = Test
    replicateOnStartup = true
    replicatePermissions = false

secure.config:

[remote "bitbucket"]
           username = USER
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Philippe McLean

unread,
Apr 19, 2019, 12:07:46 AM4/19/19
to Luca Milanesio, Repo and Gerrit Discussion
Works, thank you !

Shiva Kumar

unread,
Jun 7, 2020, 3:28:42 AM6/7/20
to Repo and Gerrit Discussion
Myself too facing authorization issue. Can anyone guide how to do replication successfully

Thanks in advance


On Friday, 19 April 2019 09:37:46 UTC+5:30, Philippe McLean wrote:
Works, thank you !

You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-d...@googlegroups.com.

sonicw...@gmail.com

unread,
Jan 12, 2022, 5:22:07 AM1/12/22
to Repo and Gerrit Discussion
On Thursday, April 18, 2019 at 11:00:39 PM UTC+2 lucamilanesio wrote:

The USER should be removed from the URL and go into the username in the secure.config.

    push = +refs/tags/*:refs/tags/*
    push = +refs/heads/*:refs/heads/*
    mirror = true
    projects = Test
    replicateOnStartup = true
    replicatePermissions = false

secure.config:

[remote "bitbucket"]
           username = USER
   password = PASSWORD
Had the same issue after upgrading from 2.16.17 to 3.5.0.1 - this works, and replication runs again. Thanks! 
Reply all
Reply to author
Forward
0 new messages