zoukankan      html  css  js  c++  java
  • Mac上部署Jenkins,用git插件更新项目代码时报错的记录

    错误

    FATAL: Could not checkout d5892374beb5c9ca144e2b5db63eb7e7cb3115b3
    hudson.plugins.git.GitException: Command "git checkout -f d5892374beb5c9ca144e2b5db63eb7e7cb3115b3" returned status code 128:
    stdout: 
    stderr: git-lfs filter-process: git-lfs: command not found
    fatal: the remote end hung up unexpectedly
    
    	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2430)
    	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$1100(CliGitAPIImpl.java:81)
    	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2743)
    Caused: hudson.plugins.git.GitException: Could not checkout d5892374beb5c9ca144e2b5db63eb7e7cb3115b3
    	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2767)
    	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1217)
    	at hudson.scm.SCM.checkout(SCM.java:504)
    	at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
    	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
    	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
    	at hudson.model.Run.execute(Run.java:1815)
    	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    	at hudson.model.ResourceController.execute(ResourceController.java:97)
    	at hudson.model.Executor.run(Executor.java:429)
    Finished: FAILURE
    

    分析

    从错误上来看,是因为没有安装lfs导致的;
    但是,用console执行命令,lfs是已经安装了的;
    那么,lfs安装在哪里了呢
    经查询,在/usr/local/bin里面
    但是在jenkins中输出path,
    + echo /usr/bin:/bin:/usr/sbin:/sbin
    却是这样的
    说明jenkins没有读到当前用户的环境变量;
    突然想起来jenkins上是一个独立用户,不同于当前用户
    那么,现在的问题就转移到怎么给它的这个独立用户设置环境变量上来了

    解决方法

    给jenkins安装EnvInject plugin插件,强制注入环境变量
    注入环境变量
    后面输出PATH,结果正常,重新运行后,错误没了lfs顺利执行

    https://www.thinbug.com/q/10625259

  • 相关阅读:
    js对象
    _proto_和prototype区别
    手写自己的Vuex
    limitPNG压缩图片
    swiper兼容性ie浏览器出现的问题
    postcss-pxtorem
    【Other】Win10防火墙放行Docker(WSL2)端口
    docker容器内使用apt-get报错
    docker+mysql
    docker部署+验证码错误
  • 原文地址:https://www.cnblogs.com/jingxuan2583/p/14148153.html
Copyright © 2011-2022 走看看