在启用安全和隐私的情况下开始对等时出错
Error while starting peer with security and privacy turned on
当我尝试使用
启动对等点时
peer node start
我收到以下错误
hyperledger@linux-box:/opt/gopath/src/github.com/hyperledger/fabric$ peer node start
20:42:02.999 [crypto] main -> INFO 001 Log level recognized 'info', set to INFO
20:42:03.017 [main] serve -> INFO 002 Security enabled status: true
20:42:03.017 [main] serve -> INFO 004 Privacy enabled status: true
20:42:03.017 [crypto] func1 -> INFO 005 Registering validator [vp] with name [vp]...
20:42:03.017 [eventhub_producer] start -> INFO 003 event processor started
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x10 pc=0x8ad221]
goroutine 1 [running]:
panic(0xd43fe0, 0xc82000e120)
/opt/go/src/runtime/panic.go:481 +0x3e6
github.com/hyperledger/fabric/core/crypto/utils.PEMtoPrivateKey(0x15409e0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/core/crypto/utils/keys.go:117 +0x91
github.com/hyperledger/fabric/core/crypto.(*nodeImpl).retrieveEnrollmentData(0xc820226630, 0xc8201c35c8, 0x2, 0xc8201c35f0, 0xc, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/core/crypto/node_eca.go:120 +0xe55
github.com/hyperledger/fabric/core/crypto.(*nodeImpl).registerCryptoEngine(0xc820226630, 0xc8201c35c8, 0x2, 0xc8201c35f0, 0xc, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/core/crypto/node_crypto.go:49 +0x5d6
github.com/hyperledger/fabric/core/crypto.(*nodeImpl).register(0xc820226630, 0x2, 0xc8201c35c8, 0x2, 0x0, 0x0, 0x0, 0xc8201c35c8, 0x2, 0xc8201c35f0, ...)
/opt/gopath/src/github.com/hyperledger/fabric/core/crypto/node_impl.go:114 +0x5b8
github.com/hyperledger/fabric/core/crypto.(*peerImpl).register(0xc820242840, 0x2, 0xc8201c35c8, 0x2, 0x0, 0x0, 0x0, 0xc8201c35c8, 0x2, 0xc8201c35f0, ...)
/opt/gopath/src/github.com/hyperledger/fabric/core/crypto/peer_impl.go:177 +0x20a
github.com/hyperledger/fabric/core/crypto.(*validatorImpl).register(0xc8201fd600, 0xc8201c35c8, 0x2, 0x0, 0x0, 0x0, 0xc8201c35c8, 0x2, 0xc8201c35f0, 0xc, ...)
/opt/gopath/src/github.com/hyperledger/fabric/core/crypto/validator_impl.go:147 +0x20a
github.com/hyperledger/fabric/core/crypto.RegisterValidator(0xc8201c35c8, 0x2, 0x0, 0x0, 0x0, 0xc8201c35c8, 0x2, 0xc8201c35f0, 0xc, 0x0, ...)
/opt/gopath/src/github.com/hyperledger/fabric/core/crypto/validator.go:55 +0x55d
main.getSecHelper.func1()
/opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:360 +0x200
sync.(*Once).Do(0x1540ad8, 0xc8201fd768)
/opt/go/src/sync/once.go:44 +0xe4
main.getSecHelper(0x0, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:380 +0x7d
main.serve(0x15409e0, 0x0, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:446 +0xc23
main.glob.func3(0x1503160, 0x15409e0, 0x0, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:95 +0x41
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).execute(0x1503160, 0x15409e0, 0x0, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:497 +0x62c
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).Execute(0x1502de0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:584 +0x46a
main.main()
/opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:314 +0x18d9
我的 core.yaml 包含默认内容,启用了安全和隐私。
这是一个错误吗?
好吧,我仍然认为我们恐慌的事实是一个错误,但我的猜测是您还没有构建 and/or 启动启用安全性时所需的会员服务:https://github.com/hyperledger/fabric/blob/master/docs/API/SandboxSetup.md#security-setup-optional
编辑:我最初在上面的堆栈跟踪中遗漏了一些东西。看起来您 运行 使用的是非常旧版本的结构代码。例如 github.com/hyperledger/fabric/core/crypto/utils/keys.go
不再出现在当前代码中。我检查了你的叉子,看来你还差得很远。不确定你是否正在构建你的分支,但看起来你肯定有旧代码并且需要拉下上游更改
当我尝试使用
启动对等点时peer node start
我收到以下错误
hyperledger@linux-box:/opt/gopath/src/github.com/hyperledger/fabric$ peer node start
20:42:02.999 [crypto] main -> INFO 001 Log level recognized 'info', set to INFO
20:42:03.017 [main] serve -> INFO 002 Security enabled status: true
20:42:03.017 [main] serve -> INFO 004 Privacy enabled status: true
20:42:03.017 [crypto] func1 -> INFO 005 Registering validator [vp] with name [vp]...
20:42:03.017 [eventhub_producer] start -> INFO 003 event processor started
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x10 pc=0x8ad221]
goroutine 1 [running]:
panic(0xd43fe0, 0xc82000e120)
/opt/go/src/runtime/panic.go:481 +0x3e6
github.com/hyperledger/fabric/core/crypto/utils.PEMtoPrivateKey(0x15409e0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/core/crypto/utils/keys.go:117 +0x91
github.com/hyperledger/fabric/core/crypto.(*nodeImpl).retrieveEnrollmentData(0xc820226630, 0xc8201c35c8, 0x2, 0xc8201c35f0, 0xc, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/core/crypto/node_eca.go:120 +0xe55
github.com/hyperledger/fabric/core/crypto.(*nodeImpl).registerCryptoEngine(0xc820226630, 0xc8201c35c8, 0x2, 0xc8201c35f0, 0xc, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/core/crypto/node_crypto.go:49 +0x5d6
github.com/hyperledger/fabric/core/crypto.(*nodeImpl).register(0xc820226630, 0x2, 0xc8201c35c8, 0x2, 0x0, 0x0, 0x0, 0xc8201c35c8, 0x2, 0xc8201c35f0, ...)
/opt/gopath/src/github.com/hyperledger/fabric/core/crypto/node_impl.go:114 +0x5b8
github.com/hyperledger/fabric/core/crypto.(*peerImpl).register(0xc820242840, 0x2, 0xc8201c35c8, 0x2, 0x0, 0x0, 0x0, 0xc8201c35c8, 0x2, 0xc8201c35f0, ...)
/opt/gopath/src/github.com/hyperledger/fabric/core/crypto/peer_impl.go:177 +0x20a
github.com/hyperledger/fabric/core/crypto.(*validatorImpl).register(0xc8201fd600, 0xc8201c35c8, 0x2, 0x0, 0x0, 0x0, 0xc8201c35c8, 0x2, 0xc8201c35f0, 0xc, ...)
/opt/gopath/src/github.com/hyperledger/fabric/core/crypto/validator_impl.go:147 +0x20a
github.com/hyperledger/fabric/core/crypto.RegisterValidator(0xc8201c35c8, 0x2, 0x0, 0x0, 0x0, 0xc8201c35c8, 0x2, 0xc8201c35f0, 0xc, 0x0, ...)
/opt/gopath/src/github.com/hyperledger/fabric/core/crypto/validator.go:55 +0x55d
main.getSecHelper.func1()
/opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:360 +0x200
sync.(*Once).Do(0x1540ad8, 0xc8201fd768)
/opt/go/src/sync/once.go:44 +0xe4
main.getSecHelper(0x0, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:380 +0x7d
main.serve(0x15409e0, 0x0, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:446 +0xc23
main.glob.func3(0x1503160, 0x15409e0, 0x0, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:95 +0x41
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).execute(0x1503160, 0x15409e0, 0x0, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:497 +0x62c
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).Execute(0x1502de0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:584 +0x46a
main.main()
/opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:314 +0x18d9
我的 core.yaml 包含默认内容,启用了安全和隐私。
这是一个错误吗?
好吧,我仍然认为我们恐慌的事实是一个错误,但我的猜测是您还没有构建 and/or 启动启用安全性时所需的会员服务:https://github.com/hyperledger/fabric/blob/master/docs/API/SandboxSetup.md#security-setup-optional
编辑:我最初在上面的堆栈跟踪中遗漏了一些东西。看起来您 运行 使用的是非常旧版本的结构代码。例如 github.com/hyperledger/fabric/core/crypto/utils/keys.go
不再出现在当前代码中。我检查了你的叉子,看来你还差得很远。不确定你是否正在构建你的分支,但看起来你肯定有旧代码并且需要拉下上游更改