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

Git fetch generates two workspaces, resulting in pipeline deployment failure

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • git-plugin
    • None
    •  jenkinsci/blueocean:latest
      Git client plugin version 3.11.2
      Git plugin version 4.11.5

      Triggered git fetch twice and generated two folders Personal_Blog_FE and Personal_Blog_FE@2, cause the pipeline to fail;

      This is log:

      Started by user 
      [admin|http://106.52.138.63:8081/user/admin]
      Obtained Jenkinsfile from git 
      [https://gitee.com/wZ57982593/personal_blog_fe.git]
      [Pipeline] Start of Pipeline[Pipeline] nodeRunning on [Jenkins|http://106.52.138.63:8081/computer/(built-in)/] in /var/jenkins_home/workspace/Personal-Blog-FE[Pipeline] {[Pipeline] stage[Pipeline]
      
      { (Declarative: Checkout SCM)[Pipeline] checkoutSelected Git installation does not exist. Using Default The recommended git tool is: NONE using credential 7102c1c7-f39a-491b-99da-102ee44f1154 > git rev-parse --resolve-git-dir /var/jenkins_home/workspace/Personal-Blog-FE/.git # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url [https://gitee.com/wZ57982593/personal_blog_fe.git] # timeout=10 Fetching upstream changes from [https://gitee.com/wZ57982593/personal_blog_fe.git] > git --version # timeout=10 > git --version # 'git version 2.36.1' using GIT_ASKPASS to set credentials > git fetch --tags --force --progress – [https://gitee.com/wZ57982593/personal_blog_fe.git] +refs/heads/{*}:refs/remotes/origin/{*} # timeout=10 > git rev-parse refs/remotes/origin/master^
      
      {commit}
      
      # timeout=10
      Checking out Revision d15a451c4d6134a89a48766ab7888d1170a4b250 (refs/remotes/origin/master)
      > git config core.sparsecheckout # timeout=10
      > git checkout -f d15a451c4d6134a89a48766ab7888d1170a4b250 # timeout=10
      Commit message: "测试打包问题"
      > git rev-list --no-walk d15a451c4d6134a89a48766ab7888d1170a4b250 # timeout=10[Pipeline] }[Pipeline] // stage[Pipeline] withEnv[Pipeline] {[Pipeline] withEnv[Pipeline] {[Pipeline] stage[Pipeline]
      { (删除上次容器镜像)[Pipeline] sh+ docker --version Docker version 20.10.16, build aa7e414fdcb23a66e8fabbef0a560ef1769eace5[Pipeline] }
      
      [Pipeline] // stage[Pipeline] stage[Pipeline] { (Build)[Pipeline] nodeRunning on [Jenkins|http://106.52.138.63:8081/computer/(built-in)/] in /var/jenkins_home/workspace/Personal-Blog-FE@2[Pipeline]
      
      {[Pipeline] checkoutSelected Git installation does not exist. Using Default The recommended git tool is: NONE using credential 7102c1c7-f39a-491b-99da-102ee44f1154 > git rev-parse --resolve-git-dir /var/jenkins_home/workspace/Personal-Blog-FE@2/.git # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url [https://gitee.com/wZ57982593/personal_blog_fe.git] # timeout=10 Fetching upstream changes from [https://gitee.com/wZ57982593/personal_blog_fe.git] > git --version # timeout=10 > git --version # 'git version 2.36.1' using GIT_ASKPASS to set credentials > git fetch --tags --force --progress – [https://gitee.com/wZ57982593/personal_blog_fe.git] +refs/heads/{*}:refs/remotes/origin/{*} # timeout=10 > git rev-parse refs/remotes/origin/master^
      {commit}
       # timeout=10
      Checking out Revision d15a451c4d6134a89a48766ab7888d1170a4b250 (refs/remotes/origin/master)
      > git config core.sparsecheckout # timeout=10
      > git checkout -f d15a451c4d6134a89a48766ab7888d1170a4b250 # timeout=10
      Commit message: "测试打包问题"[Pipeline] withEnv[Pipeline] {[Pipeline] isUnix[Pipeline] withEnv[Pipeline]
      
      {[Pipeline] sh+ docker inspect -f . node:14.18.2 .[Pipeline] }
      
      [Pipeline] // withEnv[Pipeline] withDockerContainerJenkins seems to be running inside container 2197740acccb4d35b5c6b9453bc6db759a5a2b148b4b5623bb4d069bd2722c29
      $ docker run -t -d -u 0:0 -w /var/jenkins_home/workspace/Personal-Blog-FE@2 --volumes-from 2197740acccb4d35b5c6b9453bc6db759a5a2b148b4b5623bb4d069bd2722c29 -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** node:14.18.2 cat
      $ docker top 184d48d17f08e9458ac835d7ab6ae254441db957deea7f5aa36b7370371ca95e -eo pid,comm[Pipeline]
      
      {[Pipeline] sh+ node -v v14.18.2[Pipeline] sh+ yarn install yarn install v1.22.15 [1/4] Resolving packages... success Already up-to-date. $ husky install husky - Git hooks installed Done in 0.81s.[Pipeline] echo安装依赖完成[Pipeline] sh+ CI=false yarn build yarn run v1.22.15 $ craco build Creating an optimized production build... Browserslist: caniuse-lite is outdated. Please run the following command: `npx browserslist --update-db` Compiled successfully. File sizes after gzip: 121.18 KB build/static/js/2.06e4dc97.chunk.js 65.94 KB build/static/css/2.af9f5a7c.chunk.css 2.82 KB build/static/js/main.294f8976.chunk.js 777 B build/static/js/runtime-main.f1449e93.js 272 B build/static/css/main.db61507e.chunk.css The project was built assuming it is hosted at /. You can control this with the homepage field in your package.json. The build folder is ready to be deployed. You may serve it with a static server: yarn global add serve serve -s build Find out more about deployment here: [https://cra.link/deployment]Done in 32.21s.[Pipeline] sh+ pwd /var/jenkins_home/workspace/Personal-Blog-FE@2[Pipeline] sh+ ls Dockerfile Jenkinsfile README.md build cmd.txt craco.config.js html nginx node_modules package.json public scripts src tsconfig.json yarn.lock[Pipeline] echo打包完成[Pipeline] }
      
      $ docker stop --time=1 184d48d17f08e9458ac835d7ab6ae254441db957deea7f5aa36b7370371ca95e
      $ docker rm -f 184d48d17f08e9458ac835d7ab6ae254441db957deea7f5aa36b7370371ca95e[Pipeline] // withDockerContainer[Pipeline] }[Pipeline] // withEnv[Pipeline] }[Pipeline] // node[Pipeline] }[Pipeline] // stage[Pipeline] stage[Pipeline]
      
      { (Build Image)[Pipeline] echo开始构建[Pipeline] sh+ pwd /var/jenkins_home/workspace/Personal-Blog-FE[Pipeline] sh+ ls Dockerfile Jenkinsfile README.md cmd.txt craco.config.js html nginx package.json public scripts src tsconfig.json yarn.lock[Pipeline] sh+ docker build . -t personal_blog_fe Sending build context to Docker daemon 7.034MB Step 1/4 : FROM nginx:latest ---> f6987c8d6ed5 Step 2/4 : RUN sed -ri 's/(deb|security)\.debian\.org/mirrors\.aliyun\.com/g' /etc/apt/sources.list && apt-get update && apt-get install -y iputils-ping vim telnet procps net-tools curl --no-install-recommends && rm -rf /var/lib/apt/lists/* ---> Using cache ---> a8f3c25ac87e Step 3/4 : COPY build/ usr/share/nginx/html/ lstat build/: no such file or directory[Pipeline] }
      
      [Pipeline] // stage[Pipeline] }[Pipeline] // withEnv[Pipeline] }[Pipeline] // withEnv[Pipeline] }[Pipeline] // node[Pipeline] End of PipelineERROR: script returned exit code 1
      Finished: FAILURE
      
      

        1. Dockerfile
          0.6 kB
        2. Jenkinsfile
          1 kB
        3. screenshot-1.png
          screenshot-1.png
          257 kB

            markewaite Mark Waite
            wangzhen wang zhen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: