Error archiving workspace files: exit status 2


  • persist_to_workspace:
    root: /go/src/
    - api

When debugging via ssh, the following command works fine:

tar -czf api.tar.gz /go/src/


Could you tell us how many files are under api directory?



we are getting the same error. Our workspace is 43.2mb with 1446 files. This only started to happen today.

Thank you a lot!



There are 4963 files under api directory.
And as Christian said, This issue only started to happen today.

builder@613739ddb53e:/go/src/$ find api -type f | wc -l
builder@613739ddb53e:/go/src/$ du -sh api
158M api


33861files, 419mb.


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


Having the same issue. We are in the process to move from another CI service and now this is really a blocker to start buying containers :slight_smile:

Also my public repo is failing for the same reason:

Hoping for a @circleci feedback soon :pray:


Same issue for us with and a private repository.



Artifact forwarding through the workspace isn’t designed to handle this many files, we weren’t intending to forward the entire working directory. Although, I too made this mistake when this feature was first available.

Using checkout combined with cache is more than enough, you won’t need to forward the entire project. In some cases, this will actually be slower than using git because of the way artifacts are stored and restored in a workflow.

In any case, we are working to improve artifact forwarding support for many files, however we recommend to be as specific as possible when choosing what to forward.

For example, here is some config for persisting the checkout of a Rails application:

  root: .
    - "*"
    - app
    - bin
    - config
    - db
    - lib
    - log
    - public
    - test
    - tmp

"*" matches all of the files, then application directories are listed separately.

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

Ok thanks for the feedback! We were following your project example. Looks like your team updated it 3 days ago
We will do the same. I wish the error message was more explicit.


@zzak - our checkout currently takes 40s but our attach_workspace takes 6s (when this was working).

tar can also handle arbitrarily long lists of files using a file list parameter:

tar -cv -T file_list.txt -f tarball.tar

Seems like this could be something easily worked around without requiring clients to refactor their build configs while increasing their build times.


@brent_pedago That flag shouldn’t be necessary, as we have done similarly in this commit, workspace isn’t designed for this.

Cache is what you want.


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