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

Errors when running fabric-cli #2

Open
dklesev opened this issue Aug 3, 2017 · 5 comments
Open

Errors when running fabric-cli #2

dklesev opened this issue Aug 3, 2017 · 5 comments

Comments

@dklesev
Copy link

dklesev commented Aug 3, 2017

I'm receiving this here:

# command-line-arguments
./fabric-cli.go:32: cannot use flags (type *"github.com/spf13/pflag".FlagSet) as type *"github.com/securekey/fabric-examples/fabric-cli/vendor/github.com/spf13/pflag".FlagSet in argument to "github.com/securekey/fabric-examples/fabric-cli/cmd/fabric-cli/common".Config().InitLoggingLevel
./fabric-cli.go:33: cannot use flags (type *"github.com/spf13/pflag".FlagSet) as type *"github.com/securekey/fabric-examples/fabric-cli/vendor/github.com/spf13/pflag".FlagSet in argument to "github.com/securekey/fabric-examples/fabric-cli/cmd/fabric-cli/common".Config().InitUserName
./fabric-cli.go:34: cannot use flags (type *"github.com/spf13/pflag".FlagSet) as type *"github.com/securekey/fabric-examples/fabric-cli/vendor/github.com/spf13/pflag".FlagSet in argument to "github.com/securekey/fabric-examples/fabric-cli/cmd/fabric-cli/common".Config().InitUserPassword
./fabric-cli.go:35: cannot use flags (type *"github.com/spf13/pflag".FlagSet) as type *"github.com/securekey/fabric-examples/fabric-cli/vendor/github.com/spf13/pflag".FlagSet in argument to "github.com/securekey/fabric-examples/fabric-cli/cmd/fabric-cli/common".Config().InitConfigFile
./fabric-cli.go:36: cannot use flags (type *"github.com/spf13/pflag".FlagSet) as type *"github.com/securekey/fabric-examples/fabric-cli/vendor/github.com/spf13/pflag".FlagSet in argument to "github.com/securekey/fabric-examples/fabric-cli/cmd/fabric-cli/common".Config().InitOrdererTLSCertificate
./fabric-cli.go:37: cannot use flags (type *"github.com/spf13/pflag".FlagSet) as type *"github.com/securekey/fabric-examples/fabric-cli/vendor/github.com/spf13/pflag".FlagSet in argument to "github.com/securekey/fabric-examples/fabric-cli/cmd/fabric-cli/common".Config().InitPrintFormat
./fabric-cli.go:38: cannot use flags (type *"github.com/spf13/pflag".FlagSet) as type *"github.com/securekey/fabric-examples/fabric-cli/vendor/github.com/spf13/pflag".FlagSet in argument to "github.com/securekey/fabric-examples/fabric-cli/cmd/fabric-cli/common".Config().InitWriter
./fabric-cli.go:39: cannot use flags (type *"github.com/spf13/pflag".FlagSet) as type *"github.com/securekey/fabric-examples/fabric-cli/vendor/github.com/spf13/pflag".FlagSet in argument to "github.com/securekey/fabric-examples/fabric-cli/cmd/fabric-cli/common".Config().InitOrgIDs
./fabric-cli.go:41: cannot use chaincode.Cmd() (type *"github.com/securekey/fabric-examples/fabric-cli/vendor/github.com/spf13/cobra".Command) as type *"github.com/spf13/cobra".Command in argument to mainCmd.AddCommand
./fabric-cli.go:42: cannot use query.Cmd() (type *"github.com/securekey/fabric-examples/fabric-cli/vendor/github.com/spf13/cobra".Command) as type *"github.com/spf13/cobra".Command in argument to mainCmd.AddCommand
./fabric-cli.go:42: too many errors
@bstasyszyn
Copy link
Contributor

This usually indicates a vendoring issue. Funny that I'm not seeing these errors. Can you try re-vendoring, i.e. delete vendor/ and run:
$ govendor init && govendor add +external

@dockeryounger
Copy link

[lab@localhost fabric-cli]$ go run fabric-cli.go query info --cid mychannel
[fabriccli] 2018/01/10 06:06:46 UTC - query.glob..func4 -> ERRO Error while running queryInfoAction: Error getting admin channel client: NewUser returned error: Enroll failed: enrollmentSecret required

How to address this error? Thanks for you help!

@bstasyszyn
Copy link
Contributor

This error means that a password is required for the user (you can provide the password with --pw). If you don't specify a user (with --user) then the CLI assumes "User1", which is a pre-enrolled user in the sample fixtures (./fixtures). If you're not starting fabric using the sample fixtures then you'll need to provide a user/password that's valid for your fabric instance.

If you're running fabric from ./fixtures then the following sequence of commands should work:

(1) Start fabric:
$ cd ./fixtures
$ docker-compose up --force-recreate
(2) Create channel (mychannel):
$ go run fabric-cli.go channel create
(3) Join peers to channel:
$ go run fabric-cli.go channel join --user admin
(4) go run fabric-cli.go query info

@dockeryounger
Copy link

[lab@localhost fabric-cli]$ go run fabric-cli.go query info --cid judes-supply-chain --peer grpc://peer0.judes.com:7051,grpc://peer1.judes.com:7051
[fabriccli] 2018/01/24 08:06:59 UTC - query.glob..func4 -> ERRO Error while initializing queryInfoAction: NewPeer return error: open /home/lab/go_projects/src/github.com/securekey/fabric-examples/fabric-cli/cmd/fabric-cli/fixtures/channel/crypto-config/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem: no such file or directory

@dockeryounger
Copy link

[lab@localhost fabric-cli]$ go run fabric-cli.go query channels --peer grpc://peer0.dauto.com:7051 --user username --pw password --orgid DetroitAuto
[fabriccli] 2018/01/24 09:29:20 UTC - query.glob..func2 -> ERRO Error while initializing queryChannelsAction: Error getting MSP ID for org [DetroitAuto]: MSP ID is empty for org: DetroitAuto

It can not find the corresponding MSP ID when I specified --orgid parameter.

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

No branches or pull requests

3 participants