Невозможно импортировать библиотеку Jenkins из bitbucket с помощью тега - PullRequest
0 голосов
/ 03 марта 2020

Я пытаюсь импортировать библиотеку jenkins с частного сервера bitbucket, используя приведенный ниже код в Jenkinsfile.

lib = library (
    identifier: "paap-jenkins-lib@0.1",
    retriever: modernSCM([
        $class: "GitSCMSource",
        remote: "https://<bitbucketServer.url>/scm/<projectid>/paap-jenkins-lib.git",
        credentialsId: "<bitbucket-service-account-credentials-id>",
]))

Важные детали: я использую тег для указания версии. Когда я использую имя ветви или коммит в качестве версии, я не получаю эту ошибку. Вот журналы задания Дженкинса.

Loading library paap-jenkins-lib@0.1
Attempting to resolve 0.1 from remote references...
 > git --version # timeout=10
using GIT_ASKPASS to set credentials 220d2c70-8008-45b9-9e60-61d389203d17.source-code-management
 > git ls-remote -- https://<bitbucketServerUrl>/scm/<projectid>/paap-jenkins-lib.git # timeout=10
Found match: refs/tags/0.1 revision 1bd221aa62076e65cc64ae7ef00d810bc3498c73
Resolving tag commit... (remote references may be a lightweight tag or an annotated tag)
 > git rev-parse --is-inside-work-tree # timeout=10
Setting origin to https://<bitbucketServerUrl>/scm/<projectid>/paap-jenkins-lib.git
 > git config remote.origin.url https://<bitbucketServerUrl>/scm/<projectid>/paap-jenkins-lib.git # timeout=10
Fetching origin...
Fetching upstream changes from origin
 > git --version # timeout=10
 > git config --get remote.origin.url # timeout=10
 > git fetch --tags --progress -- origin +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Checkout failed
hudson.plugins.git.GitException: Command "git fetch --tags --progress -- origin +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: fatal: Authentication failed for 'https://<bitbucketServerUrl>/scm/<projectid>/paap-jenkins-lib.git/'

    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2372)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1985)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:80)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:563)
    at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:370)
    at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:330)
    at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:950)
    at jenkins.scm.api.SCMSource.fetch(SCMSource.java:636)
    at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.lambda$retrieve$0(SCMSourceRetriever.java:89)
    at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrySCMOperation(SCMSourceRetriever.java:104)
    at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrieve(SCMSourceRetriever.java:89)
    at org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:157)
    at org.jenkinsci.plugins.workflow.libs.LibraryStep$Execution.run(LibraryStep.java:207)
    at org.jenkinsci.plugins.workflow.libs.LibraryStep$Execution.run(LibraryStep.java:156)
    at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
    at hudson.security.ACL.impersonate(ACL.java:290)
    at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    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)
...
ERROR: Maximum checkout retry attempts reached, aborting
Finished: FAILURE

Я не думаю, что эта проблема связана с учетными данными или разрешениями bitBucket, так как использование имени ветви или фиксации работает. Существует обходной путь, но он требует использования legacySCM, чего я не хочу делать sh. У кого-нибудь еще есть эта проблема?

Среда

Atlassian Bitbucket v6.10.0 работает на aws

Jenkins v2.190.3 работает на aws

Плагин Bitbucket v1.1.11

Git Плагин v4.0.0

Git Клиентский плагин v3.0.0

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...