Teamcity to bitbucket-cloud List remote refs failed not authorized jgit
Suddenly my build is beginning to fail, yes it is a mystery.
Have read all earlier threads with a similar problem without finding a solution.
Running the Build Task result with following error message.
Failed to collect changes, error: List remote refs failed: org.eclipse.jgit.errors.TransportException: https://bitbucket.org/xxxxx/yyyyyyyyy.git: not authorized
Editing the VCS root and clicking on the Test Connection gives the same error message.
If I open a new browser tab and log-in to the bitbucket with user-id, which is added to the 'Authentication Settings' in the 'VCS root' it is suddenly is possible to connect to the server when I click on the button 'Test Connection'.
but still, an issue when I run the build Task.
I have restarted the server, deleted the cache for git without any success to solve the issue.
Any hint on what to look for.
My Team City version is Enterprise 2017.2.3 (build 51047)
Please sign in to leave a comment.
A not authorized message indicates under most circumstances that the user is not allowed to pull from the repo. If nothing changed on teamcity's side, typically something has been changed on bitbucket. It's not impossible that they changed their auth api, but this most commonly comes to changes in the users. The instability of the error (as you mention, it works if you log first from the UI) might indicate a more rare event where they have actually changed something in how clients authenticate.
Of course it's also possible that intermediate network infrastructure such as firewalls or proxies might be handling some headers incorrectly leading to the same results.
The fact that this started suddenly without changes to teamcity means that the issue should not be on teamcity itself. There are multiple components starting the different connections so that probably hints as to why you observe different behavior: The UI performs a connection via a java library directly from the server, while trying to collect changes during the build will run it as an external process via git.
I'd review if modifying the credentials to another user makes it work, but otherwise it might be bitbucket altering somehow the auth api. I'm afraid I haven't seen any other similar request and your version is outdated (and out of support), so I'd definitely recommend upgrading.
What does it require to upgrade to the latest version?.
Can we jump directly to 2020.2.1 (build 85633).
Will my existing builds still work after an upgrade or will it require some changes.
Is it as simple to download and execute a file to upgrade?.
What about my existing license, is it compatible with the new version
or we have to pay more.