Minifab Keystore Error when Joining Channel


Brett Tiller
 

In the Hyperledger fabric-samples I wrote a working shell script to join an organization to a channel.  I’m trying to use this script with minifab to do the same, but am getting a keystore error below.  I’ve provided a more detailed debug listing at the bottom.

 

Cannot run peer because error when setting up MSP of type bccsp from directory /home/btiller/mywork/primii/minifab-work/vars/keyfiles/peerOrganizations/wing11.aoc1.af.mil/users/Admin@.../msp: KeyMaterial not found in SigningIdentityInfo

Failed: Peer: squadron111.wing11.aoc1.af.mil was not joined to channel: wing11channel

 

The source code snippet is below.  I know that the key environment variable to access the msp folder that contains the certs and keystore is CORE_PEER_MSPCONFIGPATH.

export PATH="$PWD/../bin":$PATH

export FABRIC_CFG_PATH="$PWD/vars/"

export CORE_PEER_TLS_ENABLED=true

export CORE_PEER_LOCALMSPID="$orgMSPName"

export CORE_PEER_ADDRESS="localhost:$port"

export CORE_PEER_TLS_ROOTCERT_FILE="$PWD/vars/keyfiles/peerOrganizations/$fullOrgName/peers/$peerName/tls/ca.crt"

export CORE_PEER_MSPCONFIGPATH="$PWD/vars/keyfiles/peerOrganizations/$fullOrgName/users/Admin@$fullOrgName/msp"

 

if ! eval peer channel join -b ./channel-artifacts/"$channelName".block ; then

        echo "Failed: Peer: $peerName was not joined to channel: $channelName"

fi

 

The environment variable values are below:

FABRIC_CFG_PATH is: /home/btiller/mywork/primii/minifab-work/vars/

CORE_PEER_TLS_ENABLED is: true

CORE_PEER_LOCALMSPID is: Wing11MSP

CORE_PEER_ADDRESS is: localhost:7402

CORE_PEER_TLS_ROOTCERT_FILE is: /home/btiller/mywork/primii/minifab-work/vars/keyfiles/peerOrganizations/wing11.aoc1.af.mil/peers/squadron111.wing11.aoc1.af.mil/tls/ca.crt

CORE_PEER_MSPCONFIGPATH is: /home/btiller/mywork/primii/minifab-work/vars/keyfiles/peerOrganizations/wing11.aoc1.af.mil/users/Admin@.../msp

 

The running containers and their versions are below:

 

 

Here’s a Snippet of the cert directories under vars that are accessed due to environment variable CORE_PEER_MSPCONFIGPATH

 

Here’s the DEBUG Listing Snippet:

2022-08-24 12:52:48.686 EDT 0013 DEBU [msp] getMspConfig -> Loading NodeOUs

2022-08-24 12:52:48.686 EDT 0014 DEBU [msp] newBccspMsp -> Creating BCCSP-based MSP instance

2022-08-24 12:52:48.686 EDT 0015 DEBU [msp] New -> Creating Cache-MSP instance

2022-08-24 12:52:48.686 EDT 0016 DEBU [msp] loadLocalMSP -> Created new local MSP

2022-08-24 12:52:48.686 EDT 0017 DEBU [msp] Setup -> Setting up MSP instance Wing11MSP

2022-08-24 12:52:48.686 EDT 0018 DEBU [msp.identity] newIdentity -> Creating identity instance for cert -----BEGIN CERTIFICATE-----

MIICwDCCAmagAwIBAgIUSo0l94vFViNEhZMY1u1SHeicbpgwCgYIKoZIzj0EAwIw

dTELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRAwDgYDVQQH

DAdSYWxlaWdoMRswGQYDVQQKDBJ3aW5nMTEuYW9jMS5hZi5taWwxHjAcBgNVBAMM

FWNhLndpbmcxMS5hb2MxLmFmLm1pbDAeFw0yMjA4MjQxNTU3NDJaFw0zMjA4MjEx

NTU3NDJaMHUxCzAJBgNVBAYTAlVTMRcwFQYDVQQIDA5Ob3J0aCBDYXJvbGluYTEQ

MA4GA1UEBwwHUmFsZWlnaDEbMBkGA1UECgwSd2luZzExLmFvYzEuYWYubWlsMR4w

HAYDVQQDDBVjYS53aW5nMTEuYW9jMS5hZi5taWwwWTATBgcqhkjOPQIBBggqhkjO

PQMBBwNCAASBqQOeN13m3yojC3ZRjXFh5I3S3t+XVoPvTyuf+FfsLhPzGeVlXE3b

1aB+M0dCsurFKU2wiSAaP1OWiyfTQQxEo4HTMIHQMB0GA1UdDgQWBBQnFWwodU2R

0uIkGSBGikyBr5fN7jAfBgNVHSMEGDAWgBQnFWwodU2R0uIkGSBGikyBr5fN7jAP

BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBpjAdBgNVHSUEFjAUBggrBgEF

BQcDAQYIKwYBBQUHAwIwTgYDVR0RBEcwRYcErBwnXYIVY2Eud2luZzExLmFvYzEu

YWYubWlsghVjYS13aW5nMTEtYW9jMS1hZi1taWyCCWxvY2FsaG9zdIcEfwAAATAK

BggqhkjOPQQDAgNIADBFAiBHxhcPN+2U/tL8tvaR8zoK7o77ZA5g9fXQ7MrsjZFp

9gIhAKS243+77xjBl5pS1P8q3tphBzbOWobr3a2UFjq8srsf

-----END CERTIFICATE-----

2022-08-24 12:52:48.687 EDT 0019 DEBU [msp.identity] newIdentity -> Creating identity instance for cert -----BEGIN CERTIFICATE-----

MIICejCCAiGgAwIBAgIUfjo7U/qDSMsfC4JRKM7DBr/uc8kwCgYIKoZIzj0EAwIw

dTELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRAwDgYDVQQH

DAdSYWxlaWdoMRswGQYDVQQKDBJ3aW5nMTEuYW9jMS5hZi5taWwxHjAcBgNVBAMM

FWNhLndpbmcxMS5hb2MxLmFmLm1pbDAeFw0yMjA4MjQxNTU3NDdaFw0zMjA1MjMx

NTU3NDdaMGsxCzAJBgNVBAYTAlVTMRcwFQYDVQQIDA5Ob3J0aCBDYXJvbGluYTEQ

MA4GA1UEBwwHUmFsZWlnaDEOMAwGA1UECwwFYWRtaW4xITAfBgNVBAMMGEFkbWlu

QHdpbmcxMS5hb2MxLmFmLm1pbDBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABAXK

Oh501Jwd0UaoL9uWxooJfJmHTGV8iWhBclCnelwNL3Pg5jbWC4sPjxWlu+5HLt1n

XRwxQ7F42vSuo3zo266jgZgwgZUwDgYDVR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQC

MAAwVAYDVR0RBE0wS4cErBwnXYIYQWRtaW5Ad2luZzExLmFvYzEuYWYubWlsghhB

ZG1pbkB3aW5nMTEtYW9jMS1hZi1taWyCCWxvY2FsaG9zdIcEfwAAATAfBgNVHSME

GDAWgBQnFWwodU2R0uIkGSBGikyBr5fN7jAKBggqhkjOPQQDAgNHADBEAiAbh8yY

o6t94nGHJM72mDvD5dYIgVqUILphDwAo0fp84gIgSOr/g0VWMDJXc/QHuGm1dh8S

FVNqT2vs7wwqGA938OM=

-----END CERTIFICATE-----

2022-08-24 12:52:48.687 EDT 001a DEBU [msp] getSigningIdentityFromConf -> Could not find SKI [d629396cf59eb7316680031db884cf88987eae10fa7a08f9a53a01eae9ac1956], trying KeyMaterial field: key with SKI d629396cf59eb7316680031db884cf88987eae10fa7a08f9a53a01eae9ac1956 not found in /home/btiller/mywork/primii/minifab-work/vars/keyfiles/peerOrganizations/wing11.aoc1.af.mil/users/Admin@.../msp/keystore

Failed getting key for SKI [[214 41 57 108 245 158 183 49 102 128 3 29 184 132 207 136 152 126 174 16 250 122 8 249 165 58 1 234 233 172 25 86]]

github.com/hyperledger/fabric/bccsp/sw.(*CSP).GetKey

        /__w/1/go/src/github.com/hyperledger/fabric/bccsp/sw/impl.go:170

github.com/hyperledger/fabric/msp.(*bccspmsp).getSigningIdentityFromConf

        /__w/1/go/src/github.com/hyperledger/fabric/msp/mspimpl.go:220

github.com/hyperledger/fabric/msp.(*bccspmsp).setupSigningIdentity

        /__w/1/go/src/github.com/hyperledger/fabric/msp/mspimplsetup.go:400

github.com/hyperledger/fabric/msp.(*bccspmsp).preSetupV142

        /__w/1/go/src/github.com/hyperledger/fabric/msp/mspimplsetup.go:585

github.com/hyperledger/fabric/msp.(*bccspmsp).setupV142

        /__w/1/go/src/github.com/hyperledger/fabric/msp/mspimplsetup.go:646

github.com/hyperledger/fabric/msp.(*bccspmsp).Setup

        /__w/1/go/src/github.com/hyperledger/fabric/msp/mspimpl.go:267

github.com/hyperledger/fabric/msp/cache.(*cachedMSP).Setup

        /__w/1/go/src/github.com/hyperledger/fabric/msp/cache/cache.go:87

github.com/hyperledger/fabric/internal/peer/common.InitCrypto

        /__w/1/go/src/github.com/hyperledger/fabric/internal/peer/common/common.go:173

github.com/hyperledger/fabric/internal/peer/common.InitCmd

        /__w/1/go/src/github.com/hyperledger/fabric/internal/peer/common/common.go:362

github.com/hyperledger/fabric/internal/peer/channel.glob..func1

        /__w/1/go/src/github.com/hyperledger/fabric/internal/peer/channel/channel.go:108

github.com/spf13/cobra.(*Command).execute

        /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:746

github.com/spf13/cobra.(*Command).ExecuteC

        /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:852

github.com/spf13/cobra.(*Command).Execute

        /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:800

main.main

        /__w/1/go/src/github.com/hyperledger/fabric/cmd/peer/main.go:56

runtime.main

        /usr/local/go/src/runtime/proc.go:255

runtime.goexit

        /usr/local/go/src/runtime/asm_amd64.s:1581

2022-08-24 12:52:48.687 EDT 001b ERRO [main] InitCmd -> Cannot run peer because error when setting up MSP of type bccsp from directory /home/btiller/mywork/primii/minifab-work/vars/keyfiles/peerOrganizations/wing11.aoc1.af.mil/users/Admin@.../msp: KeyMaterial not found in SigningIdentityInfo

Failed: Peer: squadron111.wing11.aoc1.af.mil was not joined to channel: wing11channel

 

Brett Tiller

Sr. Software Engineer

984-349-4239 (mobile)

btiller@...

 

https://www.linkedin.com/company/securboration