Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-76160

Global pipeline library over gitea SSH - checkout does not work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • gitea-plugin

      Hello
      I want to use "Global Trusted Pipeline Libraries" to manage my groovy scripts for the pipelines in one git repositiory instead of copying the scripts into each repository.
      I have tried to configure everything in Dashboard>Manage Jenkins>System>Global Trusted Pipeline Libraries - I have also added "Checkout over SSH" to the Source Code Management options, as well as SSH credentials and Gitea repository with credentials.
      But when I try to use the library in the pipeline of another repository, the checkout of the library is attempted with a https link and credentials instead of SSH and therefore fails.

      I use Jenkins with a Gitea server and only SSH checkout is allowed. The SSH checkout with the same credentials is working in the other repositiories (without global library).

      I was able to get the library SSH checkout to work with legacy SCM.

      I have already asked for help in the Jenkins community, but no one has answered:
      https://community.jenkins.io/t/global-pipeline-library-over-gitea-ssh-checkout-does-not-work/33918 
      Since everything else is working fine (legacy SCM) I assume it is a bug.

      I don't know if the bug is in the gitea-plugin or somewhere else.

      There is already an error log in the jenkins configuration after the message "Cannot validate default version. ":

       

      hudson.plugins.git.GitException: Command "git ls-remote -- https://gitea.server/Owner/JenkinsSharedLibrary.git" returned status code 128:
      stdout: 
      stderr: fatal: unable to access 'https://gitea.server/Owner/JenkinsSharedLibrary.git/': server certificate verification failed. CAfile: none CRLfile: none    at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2844)
          at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2189)
          at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2085)
          at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2076)
          at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getRemoteReferences(CliGitAPIImpl.java:3802)
          at PluginClassLoader for git//jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:885)
      ...

      And the following errors in the Console Output of a pipeline:

      // Code-PlatzhalterPush event to branch master
      Looking up repository Gitea_Organization/jenkins_test_2
      Querying the current revision of branch master...
      Current revision of branch master is 84a99ef89646c2c98119897dac60b729cc1fa4d8
      Obtained jenkins/Jenkinsfile from 84a99ef89646c2c98119897dac60b729cc1fa4d8
      Loading library JenkinsSharedLibrary@main
      Attempting to resolve main from remote references...
       > git --version # timeout=10
       > git --version # 'git version 2.43.0'
      using GIT_ASKPASS to set credentials Gitea Jenkins User
       > git ls-remote -- https://gitea.server/Owner/JenkinsSharedLibrary.git # timeout=10
      ERROR: Checkout failed
      hudson.plugins.git.GitException: Command "git ls-remote -- https://gitea.server/Owner/JenkinsSharedLibrary.git" returned status code 128:
      stdout: 
      stderr: fatal: unable to access 'https://gitea.server/Owner/JenkinsSharedLibrary.git/': server certificate verification failed. CAfile: none CRLfile: none    at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2844)
          at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2189)
          at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2085)
          at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2076)
          at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getRemoteReferences(CliGitAPIImpl.java:3802)
          at PluginClassLoader for git//jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:885)
      Caused: java.io.IOException
          at PluginClassLoader for git//jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:887)
          at PluginClassLoader for scm-api//jenkins.scm.api.SCMSource.fetch(SCMSource.java:635)
          at PluginClassLoader for pipeline-groovy-lib//org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.lambda$retrieve$0(SCMSourceRetriever.java:75)
          at PluginClassLoader for pipeline-groovy-lib//org.jenkinsci.plugins.workflow.libs.SCMBasedRetriever.retrySCMOperation(SCMBasedRetriever.java:222)
          at PluginClassLoader for pipeline-groovy-lib//org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrieve(SCMSourceRetriever.java:75)
          at PluginClassLoader for pipeline-groovy-lib//org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:297)
          at PluginClassLoader for pipeline-groovy-lib//org.jenkinsci.plugins.workflow.libs.LibraryAdder.add(LibraryAdder.java:156)
          at PluginClassLoader for pipeline-groovy-lib//org.jenkinsci.plugins.workflow.libs.LibraryDecorator$1.call(LibraryDecorator.java:125)
          at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1087)
          at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:624)
          at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:602)
          at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:579)
          at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:323)
          at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:293)
          at PluginClassLoader for script-security//org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox$Scope.parse(GroovySandbox.java:162)
          at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:188)
          at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:173)
          at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:656)
          at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:602)
          at PluginClassLoader for workflow-job//org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:341)
          at hudson.model.ResourceController.execute(ResourceController.java:101)
          at hudson.model.Executor.run(Executor.java:454)
      ERROR: Maximum checkout retry attempts reached, aborting
      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      WorkflowScript: Loading libraries failed
      ...

       

       

       

            Unassigned Unassigned
            terve16 Terve
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: