Persist to workspace fails: /bin/tar: argument list too long

nodejs
circle.yml
yarn

#1

Hi,

For our dependencies flow the last step -persist_to_workspace fails for the following error:

Error archiving workspace files: fork/exec /bin/tar: argument list too long

This is the the config.yml for the defaults step:

defaults: &defaults
  working_directory: ~/hydra
  docker:
    - image: circleci/node:6-browsers
version: 2
jobs:
  dependencies:
    <<: *defaults
    steps:
      - checkout
      - restore_cache:
          keys:
            - root-node-{{ checksum "yarn.lock" }}
#      - restore_cache:
#          keys:
#            - public-node-{{ checksum "public/yarn.lock" }}
      - run:
          name: Yarn Dependencies
          command: |
            yarn install
            cd public
            yarn install
      - save_cache:
          key: root-node-{{ checksum "yarn.lock" }}
          paths:
            - node_modules
      - save_cache:
          key: public-node-{{ checksum "public/yarn.lock" }}
          paths:
            - public/node_modules
      - persist_to_workspace:
          root: /home/circleci
          paths:
            - hydra
            - .ssh

#2

When debugging via ssh ; the following command works fine:

circleci@b5d3f31aaaaf:~$ tar -czf workspace.tar.gz hydra .ssh

Which command does persist_to_workspace execute when providing multiple paths?


#3

Could you tell us how many files are under hydra and .ssh?


#4

.ssh: two files (id_rsa and known_hosts) -> deployment configuration

hydra: contains the git repository for the mobile build; which are quite a couple of files (3x node_modules ; .git … ), about 49746 items totalling 380 mb.

Does the persist_to_workspace step pipe every file to /bin/tar ? Tarring the directories works when providing the directory name


#5

Just chiming in to note that we began experiencing this last night in the persist_to_workspace step of our build, too. We haven’t found a workaround yet.

It’s odd because I don’t think we’ve expanded the number of files in our build in any significant way.


#6

Having the same problem on our project today. Persist to workspace step stopped working this morning with the same error:

Error archiving workspace files: fork/exec /bin/tar: argument list too long

What is happening?

Thanks


#7

For what it’s worth, here’s the relevant snippet:

- persist_to_workspace:
      root: /home/circleci/back_royal
      paths:
        - .

There are 39,196 files in the directory (project directory + .git).

I’m guessing something changed in Circle CI’s infrastructure or code last night? I’ve gone back to look at when the builds started failing and our project’s file size didn’t seem to change at that time.


#8

Looks like this started failing for us last night. Did someone change the tar invocation for the persist_to_workspace command?


Error archiving workspace files: exit status 2
#9

This started failing for us last night as well.

It is concerning that it appears, based on multiple separate threads on here, that it is happening to “everyone” that status.circleci.com says nothing.


#10

Also happening for me.


#11

I’d be interested to know if there is anyone it isn’t happening to :). To know if this a problem across the platform or is there specific to what we are doing…


#12

I’ve upgraded to a paid plan to see if the behavior differs between free and paid and it does not. As such, I’ve opened a formal support request for this issue as well. In my particular case, my workspace is ~850M large with ~39K files.


#13

I’m on a paid account and opened a support request yesterday. I’ve only heard back that it was relayed to the engineering department.


#14

Please see Error archiving workspace files: exit status 2


#15

Thanks, this did work. It was surprising since workspace was working fine and then stopped :). But after switching to a list of exactly the pieces I needed it is working again for me.


#16

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.