Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error building peer: "bzip2 data invalid" in goshim.tar.bz2

Some users experience a failure building the peer as follows:

$ make peer
Building docker ccenv-image
docker build  -t hyperledger/fabric-ccenv build/image/ccenv
Sending build context to Docker daemon 20.19 MB
Step 1 : FROM hyperledger/fabric-baseimage:x86_64-0.2.2
 ---> 4ac07a26ca7a
Step 2 : COPY payload/chaintool payload/protoc-gen-go /usr/local/bin/
 ---> Using cache
 ---> 027688f7aea9
Step 3 : ADD payload/goshim.tar.bz2 $GOPATH/src/
Error processing tar file(bzip2 data invalid: bad magic value in continuation file): 
make: *** [build/image/ccenv/.dummy-x86_64-0.7.0] Error 1
like image 942
Gregory Haskins Avatar asked Jan 04 '17 14:01

Gregory Haskins


2 Answers

This is a known issue on OSX due to incompatibilities between bsdtar (that ships with OSX) and gnutar (what docker is expecting).

It can be fixed simply by ensuring that gnutar is available on the path as "tar". In OSX, this can be accomplished with

brew install gnu-tar --with-default-names

like image 50
Gregory Haskins Avatar answered Nov 17 '22 23:11

Gregory Haskins


To add a little more explanation to the answer from @Gregory Haskins,

--with-default-names option is unavailable now.

Instead, add gnu-tar location to PATH so that gnu-tar is found and runs before bsdtar(of macOS).

This can be accomplished with

export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"

like image 8
zzinny Avatar answered Nov 17 '22 23:11

zzinny