Local Checkout fails using CLI

I have the same problem as described here: Local Checkout fails using CLI, tar terminates with signal 13

I’m running circleci local execute with a volume pointing to a current directory, which is a git repo (contains .git directory)

version:

    $ circleci version
    0.1.7645+5b80b52 (homebrew)

command:

    $ circleci local execute -v $(pwd):/root/repo --job build

logs:

$ circleci local execute -v $(pwd):/root/repo --job build
Docker image digest: sha256:de517d0d10219dd242a58b698fff69c923a68813ba7ee02961d4b7795dc6a579
====>> Spin up Environment
Build-agent version 1.0.7998-a7024deb (2019-02-22T13:37:52+0000)
Starting container hotbelgo/docker-elm
  using image hotbelgo/docker-elm@sha256:df2b3991ecb86a19f445c715d96ff7057def83b6bce384e8681d8fedceb2b573

Using build environment variables:
  BASH_ENV=/tmp/.bash_env-localbuild-1589991970
  CI=true
  CIRCLECI=true
  CIRCLE_BRANCH=circleci
  CIRCLE_BUILD_NUM=
  CIRCLE_JOB=build
  CIRCLE_NODE_INDEX=0
  CIRCLE_NODE_TOTAL=1
  CIRCLE_REPOSITORY_URL=git@github.com:fluencelabs/p2p-fileshare.git
  CIRCLE_SHA1=b05be441b965723f2257ed7f58a3867f16e3384a
  CIRCLE_SHELL_ENV=/tmp/.bash_env-localbuild-1589991970
  CIRCLE_WORKING_DIRECTORY=~/repo

====>> Checkout code
  #!/bin/bash -eo pipefail
mkdir -p /root/repo && cd /tmp/_circleci_local_build_repo && git ls-files -z | xargs -0 tar -c | tar -x -C /root/repo
tar: package-lock.json: file changed as we read it
tar: public/favicon.ico: file changed as we read it
Error: Exited with code 123
Step failed
Error: runner failed
{"Runner":true,"level":"error","msg":"runner failed","task-id":"localbuild-1589991970","time":"2020-05-20T16:26:13Z"}
Task failed
Error: task failed

config:

# run locally: 
# $ circleci local execute -v /tmp/circleci:/root/repo --job build

version: 2
jobs:
  build:
    docker:
      # A simple Elm 0.19 docker - https://github.com/simonh1000/docker-elm
      - image: hotbelgo/docker-elm

    working_directory: ~/repo

    steps:
      - checkout

      # Download and cache dependencies
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-

      - run: npm install create-elm-app
      - run: npm install

      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}

      - run: PATH="$(npm bin):$PATH" elm-app build

workflows:
  version: 2
  build_and_test:
    jobs:
      - build

Hi Folex,

I tried to reproduce this issue, but couldn’t. I am able to run without any issues. Could you please try removing “-v $(pwd):/root/repo” and see if it is working.

Below is my test result:

$ circleci local execute -v $(pwd):/root/repo --job build
Docker image digest: sha256:60c16227184216b71bed4739c3f1fca045bc5256dafdc36eb2c6bc93edb52ed0
====>> Spin Up Environment
Build-agent version  ()
Docker Engine Version: 19.03.8
Kernel Version: Linux b933e927decb 4.19.76-linuxkit #1 SMP Fri Apr 3 15:53:26 UTC 2020 x86_64 Linux
Starting container circleci/python:latest
  image is cached as circleci/python:latest, but refreshing...
latest: Pulling from circleci/python
Digest: sha256:89d19ea0ee786d05e39bee5167b2f32db070f82fdf7ebc9086db02e718aad9c5
Status: Image is up to date for circleci/python:latest
  using image circleci/python@sha256:89d19ea0ee786d05e39bee5167b2f32db070f82fdf7ebc9086db02e718aad9c5
====>> Preparing Environment Variables
Using build environment variables:
  BASH_ENV=/tmp/.bash_env-localbuild-1590008176
  CI=true
  CIRCLECI=true
  CIRCLE_BRANCH=
  CIRCLE_BUILD_NUM=
  CIRCLE_JOB=build
  CIRCLE_NODE_INDEX=0
  CIRCLE_NODE_TOTAL=1
  CIRCLE_REPOSITORY_URL=
  CIRCLE_SHA1=
  CIRCLE_SHELL_ENV=/tmp/.bash_env-localbuild-1590008176
  CIRCLE_WORKING_DIRECTORY=~/repo


The redacted variables listed above will be masked in run step output.====>> Checkout code
  #!/bin/bash -eo pipefail
mkdir -p /home/circleci/repo && cd /tmp/_circleci_local_build_repo && git ls-files | tar -T - -c | tar -x -C /home/circleci/repo && cp -a /tmp/_circleci_local_build_repo/.git /home/circleci/repo
====>> Run random commands
  #!/bin/bash -eo pipefail
echo "Hello"
uname -a
uptime

Hello
Linux b0261612299d 4.19.76-linuxkit #1 SMP Fri Apr 3 15:53:26 UTC 2020 x86_64 GNU/Linux
 20:56:20 up 23:43,  0 users,  load average: 0.00, 0.03, 0.05
Success!

CircleCI Version:

$ circleci version
0.1.7645+5b80b52 (release)

Please let me know how it goes.

Regards,
Pawan

Hi! Thanks for a quick response!

Yes, it is working without a volume. I think that’s because without a volume there are no files in the ~/repo directory. The error happens when tar is ran on files in the ~/repo. AFAIU, no volume => no files => no xargs tar => no error.

The reason why I need a volume is to cache node_modules directory.

I will try to repro it again.

Hi,

We have a new version, could you please update the CLI and then try. Also, could you please confirm this used to work earlier for you?