在Peer节点执行下载chaincode命令时:
peer lifecycle chaincode install sacc.tar.gz
报错:
Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image build failed: docker build failed: Error returned from build: 2 "google.golang.org/protobuf/internal/flags
google.golang.org/protobuf/internal/set
google.golang.org/protobuf/internal/pragma
google.golang.org/protobuf/internal/detrand
google.golang.org/protobuf/internal/version
golang.org/x/net/internal/timeseries
google.golang.org/grpc/backoff
golang.org/x/sys/internal/unsafeheader
google.golang.org/protobuf/internal/errors
google.golang.org/grpc/internal/grpclog
golang.org/x/sys/unix
google.golang.org/protobuf/encoding/protowire
google.golang.org/grpc/grpclog
golang.org/x/net/trace
google.golang.org/protobuf/reflect/protoreflect
google.golang.org/grpc/connectivity
google.golang.org/grpc/attributes
google.golang.org/grpc/internal/credentials
google.golang.org/grpc/serviceconfig
google.golang.org/grpc/metadata
google.golang.org/grpc/internal/grpcrand
google.golang.org/grpc/codes
google.golang.org/grpc/encoding
google.golang.org/grpc/internal/backoff
google.golang.org/grpc/internal/balancerload
google.golang.org/protobuf/internal/encoding/messageset
google.golang.org/protobuf/internal/strs
google.golang.org/protobuf/internal/genid
google.golang.org/protobuf/internal/order
google.golang.org/protobuf/reflect/protoregistry
google.golang.org/protobuf/internal/encoding/text
google.golang.org/protobuf/runtime/protoiface
google.golang.org/protobuf/internal/descfmt
google.golang.org/protobuf/proto
google.golang.org/protobuf/internal/encoding/defval
google.golang.org/protobuf/internal/descopts
google.golang.org/protobuf/internal/encoding/json
google.golang.org/grpc/internal/grpcutil
google.golang.org/grpc/internal/buffer
google.golang.org/grpc/internal/grpcsync
google.golang.org/grpc/internal/envconfig
golang.org/x/text/transform
golang.org/x/text/unicode/bidi
golang.org/x/net/http2/hpack
golang.org/x/text/unicode/norm
google.golang.org/grpc/internal/syscall
google.golang.org/protobuf/encoding/prototext
google.golang.org/protobuf/internal/filedesc
golang.org/x/text/secure/bidirule
google.golang.org/grpc/keepalive
google.golang.org/grpc/stats
google.golang.org/grpc/tap
golang.org/x/net/idna
golang.org/x/net/http/httpguts
google.golang.org/protobuf/encoding/protojson
google.golang.org/protobuf/internal/encoding/tag
golang.org/x/net/http2
google.golang.org/protobuf/internal/impl
# golang.org/x/net/http2
vendor/golang.org/x/net/http2/transport.go:416:45: undefined: os.ErrDeadlineExceeded
google.golang.org/protobuf/internal/filetype
google.golang.org/protobuf/runtime/protoimpl
google.golang.org/protobuf/types/known/timestamppb
google.golang.org/protobuf/types/known/anypb
google.golang.org/protobuf/types/descriptorpb
google.golang.org/protobuf/types/known/durationpb
github.com/golang/protobuf/ptypes/duration
github.com/golang/protobuf/ptypes/timestamp
github.com/golang/protobuf/ptypes/any
google.golang.org/genproto/googleapis/rpc/status
google.golang.org/protobuf/types/known/emptypb
google.golang.org/protobuf/reflect/protodesc
github.com/golang/protobuf/proto
google.golang.org/grpc/credentials
github.com/hyperledger/fabric-protos-go/ledger/rwset
github.com/golang/protobuf/jsonpb
github.com/hyperledger/fabric-protos-go/msp
google.golang.org/grpc/internal/channelz
google.golang.org/grpc/credentials/insecure
google.golang.org/grpc/encoding/proto
github.com/hyperledger/fabric-protos-go/common
github.com/golang/protobuf/ptypes
google.golang.org/grpc/channelz
google.golang.org/grpc/internal/pretty
google.golang.org/grpc/binarylog/grpc_binarylog_v1
google.golang.org/grpc/internal/status
google.golang.org/grpc/resolver
google.golang.org/grpc/status
google.golang.org/grpc/peer
github.com/hyperledger/fabric-protos-go/ledger/queryresult
google.golang.org/grpc/internal
google.golang.org/grpc/internal/binarylog
google.golang.org/grpc/balancer
google.golang.org/grpc/internal/metadata
google.golang.org/grpc/balancer/grpclb/state
google.golang.org/grpc/internal/resolver/dns
google.golang.org/grpc/internal/resolver/passthrough
google.golang.org/grpc/balancer/base
google.golang.org/grpc/internal/serviceconfig
google.golang.org/grpc/internal/transport/networktype
google.golang.org/grpc/internal/resolver/unix
google.golang.org/grpc/internal/resolver
google.golang.org/grpc/balancer/roundrobin
google.golang.org/grpc/internal/balancer/gracefulswitch
"
原因:
sacc.tar.gz 中 vendor中文件不全
解决方法:
根据你对应的fabric版本,去下载对应的 vendor、go.sum、go.mod
,将它们放到 对应的文件夹下
-------------------------------更新
(可以一试,但俺也不知道能否解决了)
-------------------------------再更新
上面的方法好像不对,sorrysorry
我现在用的 1.14版本的Go
在运行代码前可以执行
export GO111MODULE=on
export GOPROXY=https://goproxy.cn
设置Go依赖中国区下载路径。
在打包智能合约时,先执行
export GO111MODULE=on
export GOPROXY=https://goproxy.cn
go mod vendor
设置Go依赖中国区下载路径,并将依赖包下载到vendor中。
尝试上面的方法后,我就没遇到过这样的错了。