Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy chaincode problem #4951

Open
YGmoyu opened this issue Aug 13, 2024 · 32 comments
Open

deploy chaincode problem #4951

YGmoyu opened this issue Aug 13, 2024 · 32 comments
Labels

Comments

@YGmoyu
Copy link

YGmoyu commented Aug 13, 2024

Description

Chaincode is packaged
Installing chaincode on peer0.org1...
Using organization 1

  • peer lifecycle chaincode install basic.tar.gz
  • res=1
    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: 1 "vendor/golang.org/x/net/http/httpguts/httplex.go:12:2: //go:build comment without // +build comment
    vendor/google.golang.org/grpc/internal/channelz/syscall_linux.go:24:2: //go:build comment without // +build comment
    vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode_shim.pb.go:10:2: //go:build comment without // +build comment
    vendor/google.golang.org/grpc/internal/channelz/funcs.go:28:2: //go:build comment without // +build comment
    vendor/google.golang.org/grpc/channelz/channelz.go:32:8: //go:build comment without // +build comment
    vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go:30:2: //go:build comment without // +build comment
    "
    Chaincode installation on peer0.org1 has failed
    Deploying chaincode failed

Steps to reproduce

my go verison is 1.21.0

@YGmoyu YGmoyu added the bug label Aug 13, 2024
@YGmoyu
Copy link
Author

YGmoyu commented Aug 13, 2024

llh@llh-virtual-machine:~$ docker exec -it cli1 bash
bash-5.1# go version
go version go1.21.0 linux/amd64
bash-5.1# 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: 1 "/chaincode/input/src/github.com/hyperledger/fabric-cluster/chaincode/go/vendor/golang.org/x/net/http/httpguts/httplex.go:12:2: //go:build comment without // +build comment
/chaincode/input/src/github.com/hyperledger/fabric-cluster/chaincode/go/vendor/google.golang.org/grpc/internal/channelz/syscall_linux.go:24:2: //go:build comment without // +build comment
/chaincode/input/src/github.com/hyperledger/fabric-cluster/chaincode/go/vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode_shim.pb.go:10:2: //go:build comment without // +build comment
/chaincode/input/src/github.com/hyperledger/fabric-cluster/chaincode/go/vendor/google.golang.org/grpc/internal/channelz/funcs.go:28:2: //go:build comment without // +build comment
/chaincode/input/src/github.com/hyperledger/fabric-cluster/chaincode/go/vendor/google.golang.org/grpc/channelz/channelz.go:32:8: //go:build comment without // +build comment
/chaincode/input/src/github.com/hyperledger/fabric-cluster/chaincode/go/vendor/google.golang.org/protobuf/internal/editiondefaults/defaults.go:11:12: pattern editions_defaults.binpb: no matching files found
"

@YGmoyu
Copy link
Author

YGmoyu commented Aug 13, 2024

i can‘t add go chaincode but java can add that, what wrong makes that?someone can help me?

@pfi79
Copy link
Contributor

pfi79 commented Aug 13, 2024

what fabric version

@pfi79
Copy link
Contributor

pfi79 commented Aug 13, 2024

is the docker service running?

@YGmoyu
Copy link
Author

YGmoyu commented Aug 13, 2024

is the docker service running?

fabric 2.4 and docker service running
1723548874329

@YGmoyu
Copy link
Author

YGmoyu commented Aug 13, 2024

is the docker service running?
The network is functional, but the chaincode cannot be downloaded to the node.

@pfi79
Copy link
Contributor

pfi79 commented Aug 13, 2024

https://github.com/hyperledger/fabric/blob/release-2.4/Makefile#L81

there's a mismatch between the go version you have and the fabric.

The first thing I would try is to either lower go to 1.18.10 or upgrade fabric to 2.5.9.

Also, fabric 2.4 and below is no longer supported.

@YGmoyu
Copy link
Author

YGmoyu commented Aug 13, 2024

https://github.com/hyperledger/fabric/blob/release-2.4/Makefile#L81

there's a mismatch between the go version you have and the fabric.

The first thing I would try is to either lower go to 1.18.10 or upgrade fabric to 2.5.9.

Also, fabric 2.4 and below is no longer supported.

thanks for you reply ,I will try for that

@YGmoyu
Copy link
Author

YGmoyu commented Aug 14, 2024

https://github.com/hyperledger/fabric/blob/release-2.4/Makefile#L81

there's a mismatch between the go version you have and the fabric.

The first thing I would try is to either lower go to 1.18.10 or upgrade fabric to 2.5.9.

Also, fabric 2.4 and below is no longer supported.

not work,
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: 1 "vendor/golang.org/x/net/http/httpguts/httplex.go:12:2: //go:build comment without // +build comment
vendor/google.golang.org/grpc/internal/channelz/syscall_linux.go:24:2: //go:build comment without // +build comment
vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode_shim.pb.go:10:2: //go:build comment without // +build comment
vendor/google.golang.org/grpc/internal/channelz/funcs.go:28:2: //go:build comment without // +build comment
vendor/google.golang.org/grpc/channelz/channelz.go:32:8: //go:build comment without // +build comment
vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go:30:2: //go:build comment without // +build comment
error same as before

@YGmoyu
Copy link
Author

YGmoyu commented Aug 14, 2024

Referen

go to 1.18.3 and fabric 2.5.9.

@YGmoyu
Copy link
Author

YGmoyu commented Aug 14, 2024

https://github.com/hyperledger/fabric/blob/release-2.4/Makefile#L81

there's a mismatch between the go version you have and the fabric.

The first thing I would try is to either lower go to 1.18.10 or upgrade fabric to 2.5.9.

Also, fabric 2.4 and below is no longer supported.
I think it's the chaincode that has a problem with incomplete downloads of dependency packages,but after my run go mod tidy and no any problem with go but the error are still exist

@pfi79
Copy link
Contributor

pfi79 commented Aug 14, 2024

Referen

go to 1.18.3 and fabric 2.5.9.

if fabric 2.5.9, you can leave go at 1.21.

@pfi79
Copy link
Contributor

pfi79 commented Aug 14, 2024

https://github.com/hyperledger/fabric/blob/release-2.4/Makefile#L81
there's a mismatch between the go version you have and the fabric.
The first thing I would try is to either lower go to 1.18.10 or upgrade fabric to 2.5.9.
Also, fabric 2.4 and below is no longer supported.

not work, 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: 1 "vendor/golang.org/x/net/http/httpguts/httplex.go:12:2: //go:build comment without // +build comment vendor/google.golang.org/grpc/internal/channelz/syscall_linux.go:24:2: //go:build comment without // +build comment vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode_shim.pb.go:10:2: //go:build comment without // +build comment vendor/google.golang.org/grpc/internal/channelz/funcs.go:28:2: //go:build comment without // +build comment vendor/google.golang.org/grpc/channelz/channelz.go:32:8: //go:build comment without // +build comment vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go:30:2: //go:build comment without // +build comment error same as before

you need more context, more logs.
all the steps from the beginning.

@YGmoyu
Copy link
Author

YGmoyu commented Aug 14, 2024

Referen

go to 1.18.3 and fabric 2.5.9.

if fabric 2.5.9, you can leave go at 1.21.

i try before it no work
Uploading 1723622595770.png…

@YGmoyu
Copy link
Author

YGmoyu commented Aug 14, 2024

https://github.com/hyperledger/fabric/blob/release-2.4/Makefile#L81
there's a mismatch between the go version you have and the fabric.
The first thing I would try is to either lower go to 1.18.10 or upgrade fabric to 2.5.9.
Also, fabric 2.4 and below is no longer supported.

not work, 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: 1 "vendor/golang.org/x/net/http/httpguts/httplex.go:12:2: //go:build comment without // +build comment vendor/google.golang.org/grpc/internal/channelz/syscall_linux.go:24:2: //go:build comment without // +build comment vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode_shim.pb.go:10:2: //go:build comment without // +build comment vendor/google.golang.org/grpc/internal/channelz/funcs.go:28:2: //go:build comment without // +build comment vendor/google.golang.org/grpc/channelz/channelz.go:32:8: //go:build comment without // +build comment vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go:30:2: //go:build comment without // +build comment error same as before

you need more context, more logs. all the steps from the beginning.

just running the course with fabric
when i running $ ./network.sh deployCC -c mychannel -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go
and other chaincode with go
it error :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: 1 "go: errors parsing go.mod:
/chaincode/input/src/go.mod:3: invalid go version '1.21.0': must match format 1.23
"
Chaincode installation on peer0.org1 has failed
Deploying chaincode failed
or
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: 1 "vendor/golang.org/x/net/http/httpguts/httplex.go:12:2: //go:build comment without // +build comment
vendor/google.golang.org/grpc/internal/channelz/syscall_linux.go:24:2: //go:build comment without // +build comment
vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode_shim.pb.go:10:2: //go:build comment without // +build comment
vendor/google.golang.org/grpc/internal/channelz/funcs.go:28:2: //go:build comment without // +build comment
vendor/google.golang.org/grpc/channelz/channelz.go:32:8: //go:build comment without // +build comment
vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go:30:2: //go:build comment without // +build comment
error same as before

@YGmoyu
Copy link
Author

YGmoyu commented Aug 14, 2024

https://github.com/hyperledger/fabric/blob/release-2.4/Makefile#L81
there's a mismatch between the go version you have and the fabric.
The first thing I would try is to either lower go to 1.18.10 or upgrade fabric to 2.5.9.
Also, fabric 2.4 and below is no longer supported.

not work, 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: 1 "vendor/golang.org/x/net/http/httpguts/httplex.go:12:2: //go:build comment without // +build comment vendor/google.golang.org/grpc/internal/channelz/syscall_linux.go:24:2: //go:build comment without // +build comment vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode_shim.pb.go:10:2: //go:build comment without // +build comment vendor/google.golang.org/grpc/internal/channelz/funcs.go:28:2: //go:build comment without // +build comment vendor/google.golang.org/grpc/channelz/channelz.go:32:8: //go:build comment without // +build comment vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go:30:2: //go:build comment without // +build comment error same as before

you need more context, more logs. all the steps from the beginning.

1723622823369
docker are running and i can run chaincode with java ,but chaincode-go can't work

@YGmoyu
Copy link
Author

YGmoyu commented Aug 14, 2024

https://github.com/hyperledger/fabric/blob/release-2.4/Makefile#L81
there's a mismatch between the go version you have and the fabric.
The first thing I would try is to either lower go to 1.18.10 or upgrade fabric to 2.5.9.
Also, fabric 2.4 and below is no longer supported.

not work, 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: 1 "vendor/golang.org/x/net/http/httpguts/httplex.go:12:2: //go:build comment without // +build comment vendor/google.golang.org/grpc/internal/channelz/syscall_linux.go:24:2: //go:build comment without // +build comment vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode_shim.pb.go:10:2: //go:build comment without // +build comment vendor/google.golang.org/grpc/internal/channelz/funcs.go:28:2: //go:build comment without // +build comment vendor/google.golang.org/grpc/channelz/channelz.go:32:8: //go:build comment without // +build comment vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go:30:2: //go:build comment without // +build comment error same as before

you need more context, more logs. all the steps from the beginning.

and docker images are latest 2.4.1 and ca 1.5.2

@pfi79
Copy link
Contributor

pfi79 commented Aug 14, 2024

https://github.com/hyperledger/fabric/blob/release-2.4/Makefile#L81
there's a mismatch between the go version you have and the fabric.
The first thing I would try is to either lower go to 1.18.10 or upgrade fabric to 2.5.9.
Also, fabric 2.4 and below is no longer supported.

not work, 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: 1 "vendor/golang.org/x/net/http/httpguts/httplex.go:12:2: //go:build comment without // +build comment vendor/google.golang.org/grpc/internal/channelz/syscall_linux.go:24:2: //go:build comment without // +build comment vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode_shim.pb.go:10:2: //go:build comment without // +build comment vendor/google.golang.org/grpc/internal/channelz/funcs.go:28:2: //go:build comment without // +build comment vendor/google.golang.org/grpc/channelz/channelz.go:32:8: //go:build comment without // +build comment vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go:30:2: //go:build comment without // +build comment error same as before

you need more context, more logs. all the steps from the beginning.

just running the course with fabric when i running $ ./network.sh deployCC -c mychannel -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go and other chaincode with go it error :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: 1 "go: errors parsing go.mod: /chaincode/input/src/go.mod:3: invalid go version '1.21.0': must match format 1.23 " Chaincode installation on peer0.org1 has failed Deploying chaincode failed or 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: 1 "vendor/golang.org/x/net/http/httpguts/httplex.go:12:2: //go:build comment without // +build comment vendor/google.golang.org/grpc/internal/channelz/syscall_linux.go:24:2: //go:build comment without // +build comment vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode_shim.pb.go:10:2: //go:build comment without // +build comment vendor/google.golang.org/grpc/internal/channelz/funcs.go:28:2: //go:build comment without // +build comment vendor/google.golang.org/grpc/channelz/channelz.go:32:8: //go:build comment without // +build comment vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go:30:2: //go:build comment without // +build comment error same as before

can you show me the file ../asset-transfer-basic/chaincode-go/go.mod

@pfi79
Copy link
Contributor

pfi79 commented Aug 14, 2024

I understand correctly that you are using github.com/hyperledger/fabric-samples ?

@YGmoyu
Copy link
Author

YGmoyu commented Aug 14, 2024

I understand correctly that you are using github.com/hyperledger/fabric-samples ?

yes,

and go.mod show that
module github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-go

go 1.21.0

require (
github.com/golang/protobuf v1.5.4
github.com/hyperledger/fabric-chaincode-go v0.0.0-20240425200701-0431f709af2c
github.com/hyperledger/fabric-contract-api-go v0.0.0-20240620231055-b8b28e7c4a13
github.com/hyperledger/fabric-protos-go v0.3.3
github.com/stretchr/testify v1.9.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/spec v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/gobuffalo/envy v1.10.2 // indirect
github.com/gobuffalo/packd v1.0.2 // indirect
github.com/gobuffalo/packr v1.30.1 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240415180920-8c6c420018be // indirect
google.golang.org/grpc v1.63.2 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

@YGmoyu
Copy link
Author

YGmoyu commented Aug 14, 2024

i truly hope you can help me solve this problem, it exist 2 month and i do anything i can do and search for any help in internet,but it still no work.

I understand correctly that you are using github.com/hyperledger/fabric-samples ?

i truly hope you can help me solve this problem, it exist 2 month and i try anything i can do and search for any help in internet,but it still no work.

@YGmoyu
Copy link
Author

YGmoyu commented Aug 14, 2024

I understand correctly that you are using github.com/hyperledger/fabric-samples ?

and i update go to 1.23.0
running go mod tidy
error:
go: github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-go/chaincode/mocks imports
github.com/hyperledger/fabric-protos-go/peer imports
google.golang.org/grpc/status imports
google.golang.org/genproto/googleapis/rpc/status: ambiguous import: found package google.golang.org/genproto/googleapis/rpc/status in multiple modules:
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 (/home/llh/gopath/pkg/mod/google.golang.org/[email protected]/googleapis/rpc/status)
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 (/home/llh/gopath/pkg/mod/google.golang.org/genproto/googleapis/[email protected]/status)
go: github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-go/chaincode/mocks imports
github.com/hyperledger/fabric-protos-go/peer imports
google.golang.org/grpc/codes tested by
google.golang.org/grpc/codes.test imports
google.golang.org/genproto/googleapis/rpc/code: ambiguous import: found package google.golang.org/genproto/googleapis/rpc/code in multiple modules:
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 (/home/llh/gopath/pkg/mod/google.golang.org/[email protected]/googleapis/rpc/code)
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 (/home/llh/gopath/pkg/mod/google.golang.org/genproto/googleapis/[email protected]/code)
go: github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-go/chaincode/mocks imports
github.com/hyperledger/fabric-protos-go/peer imports
google.golang.org/grpc/status tested by
google.golang.org/grpc/status.test imports
google.golang.org/genproto/googleapis/rpc/errdetails: ambiguous import: found package google.golang.org/genproto/googleapis/rpc/errdetails in multiple modules:
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 (/home/llh/gopath/pkg/mod/google.golang.org/[email protected]/googleapis/rpc/errdetails)
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 (/home/llh/gopath/pkg/mod/google.golang.org/genproto/googleapis/[email protected]/errdetails)

@pfi79
Copy link
Contributor

pfi79 commented Aug 14, 2024

  1. please try updating fabric-samples

because in the repository, the line with "go" looks like this.

  1. did you install the fabric yourself or did you do it according to the documentation? Something akin to ./install-fabric.sh -f '2.5.9' d s b

and i update go to 1.23.0

Don't. The fabric doesn't support it yet.

@YGmoyu
Copy link
Author

YGmoyu commented Aug 14, 2024

  1. please try updating fabric-samples

because in the repository, the line with "go" looks like this.

  1. did you install the fabric yourself or did you do it according to the documentation? Something akin to ./install-fabric.sh -f '2.5.9' d s b

and i update go to 1.23.0

Don't. The fabric doesn't support it yet.

i running ./boostrap.sh install fabric and docker images, step by step in documentation. i will try to updating fabric-samples again

@SamYuan1990
Copy link
Contributor

@pfi79
Copy link
Contributor

pfi79 commented Sep 19, 2024

https://github.com/Hyperledger-TWGC/tape/actions/runs/10139934701/job/28034221020?pr=410#step:5:1052

hi @pfi79 and @denyeart,

I got same issue with 3.0.0-preview, you can ref log at:
https://github.com/Hyperledger-TWGC/tape/actions/runs/10139934701/job/28034221020?pr=410#step:5:680

any suggestion?

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: 1 "go: errors parsing go.mod:
/chaincode/input/src/go.mod:5: unknown directive: toolchain

here is the error. go code, which has the toolchain directive, is compiled by a version of go, which knows nothing about this directive (most likely 1.20.3)

instead of 3.0.0-preview take 3.0.0-rc1

@SamYuan1990
Copy link
Contributor

https://github.com/Hyperledger-TWGC/tape/actions/runs/10139934701/job/28034221020?pr=410#step:5:1052
hi @pfi79 and @denyeart,
I got same issue with 3.0.0-preview, you can ref log at:
https://github.com/Hyperledger-TWGC/tape/actions/runs/10139934701/job/28034221020?pr=410#step:5:680
any suggestion?

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: 1 "go: errors parsing go.mod:
/chaincode/input/src/go.mod:5: unknown directive: toolchain

here is the error. go code, which has the toolchain directive, is compiled by a version of go, which knows nothing about this directive (most likely 1.20.3)

instead of 3.0.0-preview take 3.0.0-rc1

https://github.com/hyperledger/fabric-samples/blob/main/asset-transfer-basic/chaincode-go/go.mod#L3C1-L5
I see.

@pfi79
Copy link
Contributor

pfi79 commented Sep 19, 2024

https://github.com/Hyperledger-TWGC/tape/actions/runs/10139934701/job/28034221020?pr=410#step:5:1052
hi @pfi79 and @denyeart,
I got same issue with 3.0.0-preview, you can ref log at:
https://github.com/Hyperledger-TWGC/tape/actions/runs/10139934701/job/28034221020?pr=410#step:5:680
any suggestion?

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: 1 "go: errors parsing go.mod:
/chaincode/input/src/go.mod:5: unknown directive: toolchain

here is the error. go code, which has the toolchain directive, is compiled by a version of go, which knows nothing about this directive (most likely 1.20.3)
instead of 3.0.0-preview take 3.0.0-rc1

https://github.com/hyperledger/fabric-samples/blob/main/asset-transfer-basic/chaincode-go/go.mod#L3C1-L5 I see.

GO_VER = 1.20.7

in fabric 3.0.0-preview go version 1.20.7

the toolchains directive is only known since go version 1.21

@pfi79
Copy link
Contributor

pfi79 commented Sep 19, 2024

https://github.com/Hyperledger-TWGC/tape/actions/runs/10139934701/job/28034221020?pr=410#step:5:1052
hi @pfi79 and @denyeart,
I got same issue with 3.0.0-preview, you can ref log at:
https://github.com/Hyperledger-TWGC/tape/actions/runs/10139934701/job/28034221020?pr=410#step:5:680
any suggestion?

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: 1 "go: errors parsing go.mod:
/chaincode/input/src/go.mod:5: unknown directive: toolchain

here is the error. go code, which has the toolchain directive, is compiled by a version of go, which knows nothing about this directive (most likely 1.20.3)
instead of 3.0.0-preview take 3.0.0-rc1

https://github.com/hyperledger/fabric-samples/blob/main/asset-transfer-basic/chaincode-go/go.mod#L3C1-L5 I see.

in 3.0.0-rc1 there is no docker tools container and no cli program.
I will also point out that the version uses go version 1.23.1

@SamYuan1990
Copy link
Contributor

SamYuan1990 commented Sep 19, 2024

https://github.com/Hyperledger-TWGC/tape/actions/runs/10139934701/job/28034221020?pr=410#step:5:1052
hi @pfi79 and @denyeart,
I got same issue with 3.0.0-preview, you can ref log at:
https://github.com/Hyperledger-TWGC/tape/actions/runs/10139934701/job/28034221020?pr=410#step:5:680
any suggestion?

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: 1 "go: errors parsing go.mod:
/chaincode/input/src/go.mod:5: unknown directive: toolchain

here is the error. go code, which has the toolchain directive, is compiled by a version of go, which knows nothing about this directive (most likely 1.20.3)
instead of 3.0.0-preview take 3.0.0-rc1

https://github.com/hyperledger/fabric-samples/blob/main/asset-transfer-basic/chaincode-go/go.mod#L3C1-L5 I see.

in 3.0.0-rc1 there is no docker tools container and no cli program. I will also point out that the version uses go version 1.23.1

yes, well, as fabric sample golang chaincode need golang with 1.22 (above?) version to complete the install. So... when some one running with a lower version, the issue comes.

it's near midnight for me today, but it seems at step here with latest fabric sample code, we need golang 1.22(above)?
https://hyperledger-fabric.readthedocs.io/en/release-2.2/test_network.html#starting-a-chaincode-on-the-channel

which further match with
fabric sample's go tool chain with golang 1.22 and fabric with golang lower version.

@pfi79
Copy link
Contributor

pfi79 commented Sep 19, 2024

@SamYuan1990
You don't need to edit fabric-samples, everything works in it. Checked.

I'll tell you right now: your example is built from different versions that don't agree with each other.

You need to align all versions. I'd recommend the following: fabric v3.0.0-rc1, fabric-samples with commit 137f365ec9a5093b1224427be2b7d9e851d41167. go 1.23.1

@15623152911
Copy link

15623152911 commented Oct 8, 2024

  1. please try updating fabric-samples

because in the repository, the line with "go" looks like this.

  1. did you install the fabric yourself or did you do it according to the documentation? Something akin to ./install-fabric.sh -f '2.5.9' d s b

and i update go to 1.23.0

Don't. The fabric doesn't support it yet.

i running ./boostrap.sh install fabric and docker images, step by step in documentation. i will try to updating fabric-samples again

Have you solved this problem? I'm encountering the same issue.
I am using fabric 2.5.9 and go 1.22.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants