美文网首页
JenkIns 报错 stderr: remote: HTTP

JenkIns 报错 stderr: remote: HTTP

作者: 夜空最亮的9星 | 来源:发表于2022-11-21 17:53 被阅读0次
    Started by user admin
    Obtained Jenkinsfile from git http://192.168.1.169:81/zhangsanfeng/wanda-cloud.git
    [Pipeline] Start of Pipeline
    [Pipeline] node
    Running on Jenkins in /var/lib/jenkins/workspace/demo001
    [Pipeline] {
    [Pipeline] stage
    [Pipeline] { (拉取代码)
    [Pipeline] checkout
    The recommended git tool is: NONE
    Cloning the remote Git repository
    Cloning repository http://192.168.1.169:81/zhangsanfeng/wanda-cloud.git
     > /usr/bin/git init /var/lib/jenkins/workspace/demo001 # timeout=10
    Fetching upstream changes from http://192.168.1.169:81/zhangsanfeng/wanda-cloud.git
     > /usr/bin/git --version # timeout=10
     > git --version # 'git version 2.34.1'
     > /usr/bin/git fetch --tags --force --progress -- http://192.168.1.169:81/zhangsanfeng/wanda-cloud.git +refs/heads/*:refs/remotes/origin/* # timeout=10
    ERROR: Error cloning remote repo 'origin'
    hudson.plugins.git.GitException: Command "/usr/bin/git fetch --tags --force --progress -- http://192.168.1.169:81/zhangsanfeng/wanda-cloud.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
    stdout: 
    stderr: remote: HTTP Basic: Access denied
    fatal: Authentication failed for 'http://192.168.1.169:81/zhangsanfeng/wanda-cloud.git/'
    
        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2736)
        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2111)
        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:87)
        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:623)
        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:852)
        at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1229)
        at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1312)
        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)
    [Pipeline] }
    [Pipeline] // stage
    [Pipeline] }
    [Pipeline] // node
    [Pipeline] End of Pipeline
    ERROR: Error cloning remote repo 'origin'
    Finished: FAILURE
    

    解决方案

    进入到 cd /var/lib/jenkins/workspace 这个目录

    user001@node-3:cd /var/lib/jenkins/workspace
    drwxr-xr-x  4 user001 user001 4096 11月 21 17:45  ./
    drwxr-xr-x 16 user001 user001 4096 11月 21 17:46  ../
    drwxr-xr-x 15 user001 user001 4096 11月 21 17:45  demo001/
    drwxr-xr-x  3 user001 user001 4096 11月 21 17:45 'demo001@tmp'/
    
    

    根据这个教程 https://www.jianshu.com/p/e7bfa16b0ff2
    指定 user001运行 jenkins即可。

    原因分析:

    因为在jenkins使用的rsa_id是user001生成的,所以,在这里要知道使用user001用户运行jenkins

    相关文章

      网友评论

          本文标题:JenkIns 报错 stderr: remote: HTTP

          本文链接:https://www.haomeiwen.com/subject/rhpwxdtx.html