• Jenkins部署报错问题解决----git低版本引发的问题


    git版本略低,引发的血案

    原本部署在阿里云上的项目,准备放到内网jenkins上发布,配置完成后发版,jenkins变红了,详细错误信息如下

    ERROR: Error cloning remote repo 'origin'
    hudson.plugins.git.GitException: Command "git fetch --tags --progress https://gitlab.kingtool.top/admin-public/cshopfront.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
    stdout: 
    stderr: error: The requested URL returned error: 401 Unauthorized while accessing https://gitlab.kingtool.top/admin-public/cshopfront.git/info/refs
    
    fatal: HTTP request failed
    
    	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2172)
    	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1864)
    	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:78)
    	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:545)
    	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:758)
    	at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1152)
    	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1192)
    	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:124)
    	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
    	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
    	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
    	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:1142)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    	at java.lang.Thread.run(Thread.java:745)
    

    经查git版本为1.7过低了
    所以卸载git,重装,yum用不了,yum升级

    yum升级

    1.-- 下载yum安装文件
    
    sudo wget https://mirrors.edge.kernel.org/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
    sudo wget https://mirrors.edge.kernel.org/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm
    sudo wget https://mirrors.edge.kernel.org/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
    sudo wget https://mirrors.edge.kernel.org/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm 
    sudo wget https://mirrors.edge.kernel.org/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm 
    sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
    
    2.-- 查看yum 
    rpm -qa |grep yum 
    rpm -qa |grep python-urlgrabber
    
    PackageKit-yum-plugin-0.5.8-21.el6.x86_64
    PackageKit-yum-0.5.8-21.el6.x86_64
    yum-metadata-parser-1.1.2-16.el6.x86_64
    yum-plugin-security-1.1.30-14.el6.noarch
    yum-utils-1.1.30-14.el6.noarch
    yum-rhn-plugin-0.9.1-48.el6.noarch
    
    3.--卸载yum 
    sudo rpm -aq |grep yum|xargs sudo rpm -e --nodeps 
    sudo rpm -qa |grep python-urlgrabber|xargs sudo rpm -e --nodeps
    
    3.--安装yum
    sudo rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm 
    sudo rpm -ivh yum-*
    
    4.清除原有缓存
    sudo yum clean all
    5.重建缓存,以提高搜索安装软件的速度
    sudo yum makecache
    6.更新系统
    sudo yum update
    

    [Errno 14] Could not open/read file:///sysbak/Redhat6.5/repodata/repomd.xml

    RHEL更换yum源的 PYCURL ERROR 22错误解决方法

    [weblogic@V7APPtest1 ~]$ sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
    Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
    This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
    file:///sysbak/Redhat6.5/repodata/repomd.xml: [Errno 14] Could not open/read file:///sysbak/Redhat6.5/repodata/repomd.xml
    Trying other mirror.
    Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
    

    redhat 6.5 下载新的CentOS-Base.repo
    https://jingyan.baidu.com/album/fedf073766733935ac897732.html?picindex=16

    编译安装git

    git --version

    1.卸载旧版本git:
    yum remove git
    
    2. 执行命令:
    yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
    
    3. 下载git,解压:
    wget https://github.com/git/git/archive/v2.24.0.tar.gz
    tar -zxf git-2.24.0.tar.gz
    
    4. 进入解压后的git安装目录,编译,安装:
    cd git-2.24.0
    make prefix=/usr/local/git all
    make prefix=/usr/local/git install
    
    5. 编辑环境变量配置(给到所有用户):
    vim /etc/profile
    export PATH=$PATH:/usr/local/git/bin
    source /etc/profile
    
  • 相关阅读:
    (参考)爬虫5-爬取中国大学排名情况
    005_软件安装之_常用办公软件
    004_软件安装之_Altium Designer
    001_基础硬件电路_二极管
    添加QQ群
    024_STM32程序移植之_ESP8266_TCP
    020_C语言常用函数
    004——转载C#禁止改变窗体大小
    003转载----C#打开网页
    002_Python基础学习网站
  • 原文地址:https://www.cnblogs.com/liuyitan/p/12658005.html
Copyright © 2020-2023  润新知