Error archiving workspace files: exit status 2


#1

  • persist_to_workspace:
    root: /go/src/github.com/futurenda
    paths:
    - api

When debugging via ssh, the following command works fine:

tar -czf api.tar.gz /go/src/github.com/futurenda/api


#2

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


#3

Hello,

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

Thank you a lot!
Christian


#4

@zzak

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

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


#5

33861files, 419mb.


#6

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


#7

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: https://circleci.com/gh/gpbl/react-day-picker/815

Hoping for a @circleci feedback soon :pray:


#8

Same issue for us with https://circleci.com/gh/callemall/material-ui/4086 and a private repository.


#9

Hello,

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:

persist_to_workspace:
  root: .
  paths:
    - "*"
    - 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
#10

Ok thanks for the feedback! We were following your project example. Looks like your team updated it 3 days ago https://github.com/circleci/frontend/commit/ac0e6202251e63df68dc6331207d4ee868f2acbe.
We will do the same. I wish the error message was more explicit.


#11

@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.


#12

@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.


#13

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