-
Bug
-
Resolution: Fixed
-
Critical
-
None
-
Gitea: 1.16.7
Jenkins: 2.332.3
gitea-plugin: 1.4.2
Since an update to the latest version of the plugin, the checkout fails with 'Unauthorized' when the job is configured with GiteaAccessToken.
The Issue is related to this commit.
I was able to resolve it be reverting the mentioned commit.
Here is the (Multipipeline) Jobs output:
Started by user *** Looking up repository ORG/project Querying the current revision of branch dev... Current revision of branch dev is fd93e3dd2404608ed17019ffbf959a74435b79d5 Obtained api-gateway/Jenkinsfile from fd93e3dd2404608ed17019ffbf959a74435b79d5 [Pipeline] Start of Pipeline [Pipeline] node Running on Jenkins in /var/jenkins_home/workspace/api-gateway_dev [Pipeline] { [Pipeline] stage [Pipeline] { (Declarative: Checkout SCM) [Pipeline] checkoutThe recommended git tool is: NONE > git rev-parse --resolve-git-dir /var/jenkins_home/workspace/api-gateway_dev/.git # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url https://gitea.private.com/ORG/project.git # timeout=10 Fetching without tags Fetching upstream changes from https://gitea.private.com/ORG/project.git > git --version # timeout=10 > git --version # 'git version 2.30.2' > git fetch --no-tags --force --progress -- https://gitea.private.com/ORG/project.git +refs/heads/dev:refs/remotes/origin/dev # timeout=10 ERROR: Error fetching remote repo 'origin'hudson.plugins.git.GitException: Failed to fetch from https://gitea.private.com/ORG/project.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:993) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1234) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1294) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:97) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:84) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: hudson.plugins.git.GitException: Command "git fetch --no-tags --force --progress -- https://gitea.private.com/ORG/project.git +refs/heads/dev:refs/remotes/origin/dev" returned status code 128: stdout: stderr: remote: Unauthorized fatal: Authentication failed for 'https://gitea.private.com/ORG/project.git/' at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2671) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2096) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:618) at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:991) ... 11 more