hyperledger / fabric-samples

Samples for Hyperledger Fabric
https://wiki.hyperledger.org/display/fabric
Apache License 2.0
2.79k stars 3.39k forks source link

error="expected MSP ID Org1MSP, received Org2MSP" #910

Closed michaelcourcy closed 1 year ago

michaelcourcy commented 1 year ago

Following the test-network-k8s tutorial when executing

 ./network channel create

I get this error

Creating channel "mychannel":
✅ - Registering org Admin users ...
✅ - Enrolling org Admin users ...
✅ - Creating channel MSP ...
✅ - Creating channel genesis block ...
✅ - Joining orderers to channel mychannel ...
⚠️  - Joining org1 peers to channel mychannel ...
2023-01-18 22:13:21.805 CET 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized
Error: proposal failed (err: rpc error: code = Unknown desc = error validating proposal: access denied: channel [] creator org unknown, creator is malformed)

Checking the logs in org1-peer1 I get this error at the end error="expected MSP ID Org1MSP, received Org2MSP" which I suppose is the real cause.

The end of the stack puzzle me

identity="
(mspid=Org2MSP 
subject=CN=org1admin,OU=admin,O=Hyperledger,ST=North Carolina,C=US issuer=CN=fabric-ca-server,OU=Fabric,O=Hyperledger,ST=North Carolina,C=US 
serialnumber=451758339561705437497588607699569798162671790761)

How is that possible to have mspid=Org2MSP with subject=CN=org1admin.... as I'm new to this technology I don't know where I should check this mapping.

The complete logs from org1-peer1 pod

k logs org1-peer1-6589b478fc-c5lwk
Defaulted container "main" out of: main, couchdb
2023-01-18 16:21:28.183 UTC 0001 DEBU [bccsp] GetDefault -> Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2023-01-18 16:21:28.190 UTC 0002 DEBU [bccsp] GetDefault -> Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2023-01-18 16:21:28.195 UTC 0003 DEBU [bccsp] GetDefault -> Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2023-01-18 16:21:28.200 UTC 0004 DEBU [bccsp_sw] openKeyStore -> KeyStore opened at [/var/hyperledger/fabric/organizations/peerOrganizations/org1.example.com/peers/org1-peer1.org1.example.com/msp/keystore]...done
2023-01-18 16:21:28.202 UTC 0005 DEBU [bccsp_sw] loadPrivateKey -> Loading private key [eebd730efe877dd0109469e12ae7ff93514c808d8746f9ed79baf8b67dd48440] at [/var/hyperledger/fabric/organizations/peerOrganizations/org1.example.com/peers/org1-peer1.org1.example.com/msp/keystore/eebd730efe877dd0109469e12ae7ff93514c808d8746f9ed79baf8b67dd48440_sk]...
2023-01-18 16:21:28.202 UTC 0006 INFO [nodeCmd] serve -> Starting peer:
 Version: 2.4.7
 Commit SHA: df9c661
 Go version: go1.18.7
 OS/Arch: linux/amd64
 Chaincode:
  Base Docker Label: org.hyperledger.fabric
  Docker Namespace: hyperledger
2023-01-18 16:21:28.203 UTC 0007 INFO [peer] getLocalAddress -> Auto-detected peer address: 10.244.0.20:7051
2023-01-18 16:21:28.203 UTC 0008 INFO [peer] getLocalAddress -> Returning org1-peer1:7051
2023-01-18 16:21:28.205 UTC 0009 INFO [nodeCmd] initGrpcSemaphores -> concurrency limit for endorser service is 2500
2023-01-18 16:21:28.205 UTC 000a INFO [nodeCmd] initGrpcSemaphores -> concurrency limit for deliver service is 2500
2023-01-18 16:21:28.205 UTC 000b INFO [nodeCmd] serve -> Starting peer with TLS enabled
2023-01-18 16:21:28.238 UTC 000c DEBU [transientstore] newStoreProvider -> opening provider providerPath=/var/hyperledger/fabric/data/org1-peer1.org1.example.com/transientstore
2023-01-18 16:21:28.261 UTC 000d INFO [deliveryClient] loadDeliverServiceConfig -> peer.deliveryclient.blockGossipEnabled is not set, defaulting to true.
2023-01-18 16:21:28.261 UTC 000e INFO [certmonitor] trackCertExpiration -> The enrollment certificate will expire on 2024-01-18 16:21:00 +0000 UTC
2023-01-18 16:21:28.261 UTC 000f INFO [certmonitor] trackCertExpiration -> The server TLS certificate will expire on 2023-04-18 16:21:21 +0000 UTC
2023-01-18 16:21:28.262 UTC 0010 DEBU [ccprovider] ListInstalledChaincodes -> Returning []
2023-01-18 16:21:28.262 UTC 0011 INFO [ledgermgmt] NewLedgerMgr -> Initializing LedgerMgr
2023-01-18 16:21:28.305 UTC 0012 INFO [leveldbhelper] openDBAndCheckFormat -> DB is empty Setting db format as 2.0
2023-01-18 16:21:28.307 UTC 0013 INFO [blkstorage] NewProvider -> Creating new file ledger directory at /var/hyperledger/fabric/data/org1-peer1.org1.example.com/ledgersData/chains/chains
2023-01-18 16:21:28.323 UTC 0014 DEBU [history] NewDBProvider -> constructing HistoryDBProvider dbPath=/var/hyperledger/fabric/data/org1-peer1.org1.example.com/ledgersData/historyLeveldb
2023-01-18 16:21:28.335 UTC 0015 INFO [leveldbhelper] openDBAndCheckFormat -> DB is empty Setting db format as 2.0
2023-01-18 16:21:28.339 UTC 0016 DEBU [confighistory] newDBProvider -> Opening db for config history: db path = /var/hyperledger/fabric/data/org1-peer1.org1.example.com/ledgersData/configHistory
2023-01-18 16:21:28.365 UTC 0017 DEBU [statecouchdb] NewVersionedDBProvider -> constructing CouchDB VersionedDBProvider
2023-01-18 16:21:28.366 UTC 0018 DEBU [couchdb] verifyCouchConfig -> Entering VerifyCouchConfig()
2023-01-18 16:21:28.366 UTC 0019 DEBU [couchdb] handleRequest -> Entering handleRequest()  method=GET  url=http://localhost:5984/  dbName=
2023-01-18 16:21:28.366 UTC 001a DEBU [couchdb] handleRequest -> Request URL: http://localhost:5984/
2023-01-18 16:21:28.367 UTC 001b WARN [couchdb] handleRequest -> Attempt 1 of 21 returned error: Get "http://localhost:5984/": dial tcp [::1]:5984: connect: connection refused. Retrying couchdb request in 125ms
2023-01-18 16:21:28.495 UTC 001c WARN [couchdb] handleRequest -> Attempt 2 of 21 returned error: Get "http://localhost:5984/": dial tcp [::1]:5984: connect: connection refused. Retrying couchdb request in 250ms
2023-01-18 16:21:28.747 UTC 001d WARN [couchdb] handleRequest -> Attempt 3 of 21 returned error: Get "http://localhost:5984/": dial tcp [::1]:5984: connect: connection refused. Retrying couchdb request in 500ms
2023-01-18 16:21:29.250 UTC 001e WARN [couchdb] handleRequest -> Attempt 4 of 21 returned error: Get "http://localhost:5984/": dial tcp [::1]:5984: connect: connection refused. Retrying couchdb request in 1s
2023-01-18 16:21:30.253 UTC 001f WARN [couchdb] handleRequest -> Attempt 5 of 21 returned error: Get "http://localhost:5984/": dial tcp [::1]:5984: connect: connection refused. Retrying couchdb request in 2s
2023-01-18 16:21:32.254 UTC 0020 WARN [couchdb] handleRequest -> Attempt 6 of 21 returned error: Get "http://localhost:5984/": dial tcp [::1]:5984: connect: connection refused. Retrying couchdb request in 4s
2023-01-18 16:21:36.256 UTC 0021 WARN [couchdb] handleRequest -> Attempt 7 of 21 returned error: Get "http://localhost:5984/": dial tcp [::1]:5984: connect: connection refused. Retrying couchdb request in 8s
2023-01-18 16:21:44.326 UTC 0022 DEBU [couchdb] handleRequest -> Exiting handleRequest()
2023-01-18 16:21:44.326 UTC 0023 DEBU [couchdb] verifyCouchConfig -> VerifyConnection() dbResponseJSON="{Welcome 3.2.1 {The Apache Software Foundation}}"
2023-01-18 16:21:44.326 UTC 0024 DEBU [couchdb] createDatabaseIfNotExist -> [_users] Entering CreateDatabaseIfNotExist()
2023-01-18 16:21:44.326 UTC 0025 DEBU [couchdb] handleRequest -> Entering handleRequest()  method=GET  url=http://localhost:5984  dbName=_users
2023-01-18 16:21:44.327 UTC 0026 DEBU [couchdb] handleRequest -> Request URL: http://localhost:5984/_users
2023-01-18 16:21:44.332 UTC 0027 DEBU [couchdb] handleRequest -> Error handling CouchDB request. Error:not_found,  Status Code:404,  Reason:Database does not exist.
2023-01-18 16:21:44.332 UTC 0028 DEBU [couchdb] createDatabaseIfNotExist -> [_users] Database does not exist.
2023-01-18 16:21:44.332 UTC 0029 DEBU [couchdb] handleRequest -> Entering handleRequest()  method=PUT  url=http://localhost:5984  dbName=_users
2023-01-18 16:21:44.332 UTC 002a DEBU [couchdb] handleRequest -> Request URL: http://localhost:5984/_users
2023-01-18 16:21:44.391 UTC 002b DEBU [couchdb] handleRequest -> Exiting handleRequest()
2023-01-18 16:21:44.391 UTC 002c INFO [couchdb] createDatabaseIfNotExist -> Created state database _users
2023-01-18 16:21:44.391 UTC 002d DEBU [couchdb] createDatabaseIfNotExist -> [_users] Exiting CreateDatabaseIfNotExist()
2023-01-18 16:21:44.391 UTC 002e DEBU [couchdb] createDatabaseIfNotExist -> [_replicator] Entering CreateDatabaseIfNotExist()
2023-01-18 16:21:44.391 UTC 002f DEBU [couchdb] handleRequest -> Entering handleRequest()  method=GET  url=http://localhost:5984  dbName=_replicator
2023-01-18 16:21:44.391 UTC 0030 DEBU [couchdb] handleRequest -> Request URL: http://localhost:5984/_replicator
2023-01-18 16:21:44.402 UTC 0031 DEBU [couchdb] handleRequest -> Error handling CouchDB request. Error:not_found,  Status Code:404,  Reason:Database does not exist.
2023-01-18 16:21:44.402 UTC 0032 DEBU [couchdb] createDatabaseIfNotExist -> [_replicator] Database does not exist.
2023-01-18 16:21:44.403 UTC 0033 DEBU [couchdb] handleRequest -> Entering handleRequest()  method=PUT  url=http://localhost:5984  dbName=_replicator
2023-01-18 16:21:44.403 UTC 0034 DEBU [couchdb] handleRequest -> Request URL: http://localhost:5984/_replicator
2023-01-18 16:21:44.440 UTC 0035 DEBU [couchdb] handleRequest -> Exiting handleRequest()
2023-01-18 16:21:44.440 UTC 0036 INFO [couchdb] createDatabaseIfNotExist -> Created state database _replicator
2023-01-18 16:21:44.441 UTC 0037 DEBU [couchdb] applyDatabaseSecurity -> [_replicator] Entering ApplyDatabaseSecurity()
2023-01-18 16:21:44.441 UTC 0038 DEBU [couchdb] applyDatabaseSecurity -> [_replicator] Applying security to database: {"admins":{"names":["admin"],"roles":[]},"members":{"names":["admin"],"roles":[]}}
2023-01-18 16:21:44.441 UTC 0039 DEBU [couchdb] handleRequest -> Entering handleRequest()  method=PUT  url=http://localhost:5984  dbName=_replicator
2023-01-18 16:21:44.441 UTC 003a DEBU [couchdb] handleRequest -> Request URL: http://localhost:5984/_replicator/_security
2023-01-18 16:21:44.470 UTC 003b DEBU [couchdb] handleRequest -> Exiting handleRequest()
2023-01-18 16:21:44.470 UTC 003c DEBU [couchdb] applyDatabaseSecurity -> [_replicator] Exiting ApplyDatabaseSecurity()
2023-01-18 16:21:44.471 UTC 003d DEBU [couchdb] createDatabaseIfNotExist -> [_replicator] Exiting CreateDatabaseIfNotExist()
2023-01-18 16:21:44.471 UTC 003e DEBU [couchdb] verifyCouchConfig -> Exiting VerifyCouchConfig()
2023-01-18 16:21:44.471 UTC 003f DEBU [couchdb] handleRequest -> Entering handleRequest()  method=GET  url=http://localhost:5984/_all_dbs  dbName=
2023-01-18 16:21:44.471 UTC 0040 DEBU [couchdb] handleRequest -> Request URL: http://localhost:5984/_all_dbs
2023-01-18 16:21:44.505 UTC 0041 DEBU [couchdb] handleRequest -> Exiting handleRequest()
2023-01-18 16:21:44.505 UTC 0042 DEBU [couchdb] retrieveApplicationDBNames -> dbNames = [_replicator _users]
2023-01-18 16:21:44.506 UTC 0043 DEBU [statecouchdb] checkExpectedDataformatVersion -> couch instance is empty. Setting dataformat version to 2.0
2023-01-18 16:21:44.506 UTC 0044 DEBU [couchdb] createDatabaseIfNotExist -> [fabric__internal] Entering CreateDatabaseIfNotExist()
2023-01-18 16:21:44.506 UTC 0045 DEBU [couchdb] handleRequest -> Entering handleRequest()  method=GET  url=http://localhost:5984  dbName=fabric__internal
2023-01-18 16:21:44.506 UTC 0046 DEBU [couchdb] handleRequest -> Request URL: http://localhost:5984/fabric__internal
2023-01-18 16:21:44.509 UTC 0047 DEBU [couchdb] handleRequest -> Error handling CouchDB request. Error:not_found,  Status Code:404,  Reason:Database does not exist.
2023-01-18 16:21:44.509 UTC 0048 DEBU [couchdb] createDatabaseIfNotExist -> [fabric__internal] Database does not exist.
2023-01-18 16:21:44.509 UTC 0049 DEBU [couchdb] handleRequest -> Entering handleRequest()  method=PUT  url=http://localhost:5984  dbName=fabric__internal
2023-01-18 16:21:44.509 UTC 004a DEBU [couchdb] handleRequest -> Request URL: http://localhost:5984/fabric__internal
2023-01-18 16:21:44.530 UTC 004b DEBU [couchdb] handleRequest -> Exiting handleRequest()
2023-01-18 16:21:44.530 UTC 004c INFO [couchdb] createDatabaseIfNotExist -> Created state database fabric__internal
2023-01-18 16:21:44.530 UTC 004d DEBU [couchdb] applyDatabaseSecurity -> [fabric__internal] Entering ApplyDatabaseSecurity()
2023-01-18 16:21:44.530 UTC 004e DEBU [couchdb] applyDatabaseSecurity -> [fabric__internal] Applying security to database: {"admins":{"names":["admin"],"roles":[]},"members":{"names":["admin"],"roles":[]}}
2023-01-18 16:21:44.530 UTC 004f DEBU [couchdb] handleRequest -> Entering handleRequest()  method=PUT  url=http://localhost:5984  dbName=fabric__internal
2023-01-18 16:21:44.530 UTC 0050 DEBU [couchdb] handleRequest -> Request URL: http://localhost:5984/fabric__internal/_security
2023-01-18 16:21:44.540 UTC 0051 DEBU [couchdb] handleRequest -> Exiting handleRequest()
2023-01-18 16:21:44.543 UTC 0052 DEBU [couchdb] applyDatabaseSecurity -> [fabric__internal] Exiting ApplyDatabaseSecurity()
2023-01-18 16:21:44.543 UTC 0053 DEBU [couchdb] createDatabaseIfNotExist -> [fabric__internal] Exiting CreateDatabaseIfNotExist()
2023-01-18 16:21:44.544 UTC 0054 DEBU [couchdb] saveDoc -> [fabric__internal] Entering SaveDoc() id=[dataformatVersion]
2023-01-18 16:21:44.544 UTC 0055 DEBU [couchdb] readDoc -> [fabric__internal] Entering ReadDoc()  id=[dataformatVersion]
2023-01-18 16:21:44.544 UTC 0056 DEBU [couchdb] handleRequest -> Entering handleRequest()  method=GET  url=http://localhost:5984  dbName=fabric__internal
2023-01-18 16:21:44.544 UTC 0057 DEBU [couchdb] handleRequest -> Request URL: http://localhost:5984/fabric__internal/dataformatVersion?attachments=true
2023-01-18 16:21:44.546 UTC 0058 DEBU [couchdb] handleRequest -> Error handling CouchDB request. Error:not_found,  Status Code:404,  Reason:missing
2023-01-18 16:21:44.546 UTC 0059 DEBU [couchdb] readDoc -> [fabric__internal] Document not found (404), returning nil value instead of 404 error
2023-01-18 16:21:44.547 UTC 005a DEBU [couchdb] readDoc -> [fabric__internal] Exiting ReadDoc()
2023-01-18 16:21:44.547 UTC 005b DEBU [couchdb] handleRequest -> Entering handleRequest()  method=PUT  url=http://localhost:5984  dbName=fabric__internal
2023-01-18 16:21:44.547 UTC 005c DEBU [couchdb] handleRequest -> Request URL: http://localhost:5984/fabric__internal/dataformatVersion
2023-01-18 16:21:44.578 UTC 005d DEBU [couchdb] handleRequest -> Exiting handleRequest()
2023-01-18 16:21:44.586 UTC 005e DEBU [couchdb] saveDoc -> [fabric__internal] Exiting SaveDoc()
2023-01-18 16:21:44.603 UTC 005f DEBU [kvledger] deletePartialLedgers -> Removing ledgers in state UNDER_CONSTRUCTION or UNDER_DELETION
2023-01-18 16:21:44.606 UTC 0060 INFO [ledgermgmt] NewLedgerMgr -> Initialized LedgerMgr
2023-01-18 16:21:44.607 UTC 0061 INFO [gossip.service] New -> Initialize gossip with endpoint org1-peer1:7051
2023-01-18 16:21:44.609 UTC 0062 INFO [gossip.gossip] New -> Creating gossip service with self membership of Endpoint: org1-peer1.test-network.svc.cluster.local:7051, InternalEndpoint: org1-peer1:7051, PKI-ID: cca8fa41d6c3c495e68b9a792b4f5c527f8281def76025a6fffac904e1522c5d, Metadata: 
2023-01-18 16:21:44.610 UTC 0063 INFO [gossip.gossip] start -> Gossip instance org1-peer1:7051 started
2023-01-18 16:21:44.610 UTC 0064 INFO [lifecycle] InitializeLocalChaincodes -> Initialized lifecycle cache with 0 already installed chaincodes
2023-01-18 16:21:44.611 UTC 0065 INFO [nodeCmd] computeChaincodeEndpoint -> Entering computeChaincodeEndpoint with peerHostname: org1-peer1
2023-01-18 16:21:44.611 UTC 0066 INFO [nodeCmd] computeChaincodeEndpoint -> Exit with ccEndpoint: org1-peer1:7052
2023-01-18 16:21:44.613 UTC 0067 DEBU [nodeCmd] serve -> Running peer
2023-01-18 16:21:44.613 UTC 0068 INFO [sccapi] DeploySysCC -> deploying system chaincode 'lscc'
2023-01-18 16:21:44.614 UTC 0069 DEBU [sccapi] func2 -> chaincode started for lscc.syscc
2023-01-18 16:21:44.614 UTC 006a DEBU [sccapi] func1 -> starting chaincode-support stream for  lscc.syscc
2023-01-18 16:21:44.614 UTC 006b DEBU [chaincode] handleMessage -> [] Fabric side handling ChaincodeMessage of type: REGISTER in state created
2023-01-18 16:21:44.614 UTC 006c DEBU [chaincode] HandleRegister -> Received REGISTER in state created
2023-01-18 16:21:44.614 UTC 006d DEBU [chaincode] Register -> registered handler complete for chaincode lscc.syscc
2023-01-18 16:21:44.614 UTC 006e DEBU [chaincode] HandleRegister -> Got REGISTER for chaincodeID = lscc.syscc, sending back REGISTERED
2023-01-18 16:21:44.614 UTC 006f DEBU [chaincode] HandleRegister -> Changed state to established for lscc.syscc
2023-01-18 16:21:44.614 UTC 0070 DEBU [chaincode] sendReady -> sending READY for chaincode lscc.syscc
2023-01-18 16:21:44.614 UTC 0071 DEBU [chaincode] sendReady -> Changed to state ready for chaincode lscc.syscc
2023-01-18 16:21:44.614 UTC 0072 INFO [sccapi] DeploySysCC -> deploying system chaincode 'cscc'
2023-01-18 16:21:44.614 UTC 0073 DEBU [sccapi] func2 -> chaincode started for cscc.syscc
2023-01-18 16:21:44.614 UTC 0074 DEBU [sccapi] func1 -> starting chaincode-support stream for  cscc.syscc
2023-01-18 16:21:44.614 UTC 0075 DEBU [chaincode] handleMessage -> [] Fabric side handling ChaincodeMessage of type: REGISTER in state created
2023-01-18 16:21:44.614 UTC 0076 DEBU [chaincode] HandleRegister -> Received REGISTER in state created
2023-01-18 16:21:44.614 UTC 0077 DEBU [chaincode] Register -> registered handler complete for chaincode cscc.syscc
2023-01-18 16:21:44.615 UTC 0078 DEBU [chaincode] HandleRegister -> Got REGISTER for chaincodeID = cscc.syscc, sending back REGISTERED
2023-01-18 16:21:44.615 UTC 0079 DEBU [chaincode] HandleRegister -> Changed state to established for cscc.syscc
2023-01-18 16:21:44.615 UTC 007a DEBU [chaincode] sendReady -> sending READY for chaincode cscc.syscc
2023-01-18 16:21:44.615 UTC 007b DEBU [chaincode] sendReady -> Changed to state ready for chaincode cscc.syscc
2023-01-18 16:21:44.615 UTC 007c INFO [sccapi] DeploySysCC -> deploying system chaincode 'qscc'
2023-01-18 16:21:44.615 UTC 007d DEBU [sccapi] func2 -> chaincode started for qscc.syscc
2023-01-18 16:21:44.615 UTC 007e DEBU [sccapi] func1 -> starting chaincode-support stream for  qscc.syscc
2023-01-18 16:21:44.615 UTC 007f DEBU [chaincode] handleMessage -> [] Fabric side handling ChaincodeMessage of type: REGISTER in state created
2023-01-18 16:21:44.615 UTC 0080 DEBU [chaincode] HandleRegister -> Received REGISTER in state created
2023-01-18 16:21:44.615 UTC 0081 DEBU [chaincode] Register -> registered handler complete for chaincode qscc.syscc
2023-01-18 16:21:44.615 UTC 0082 DEBU [chaincode] HandleRegister -> Got REGISTER for chaincodeID = qscc.syscc, sending back REGISTERED
2023-01-18 16:21:44.615 UTC 0083 DEBU [chaincode] HandleRegister -> Changed state to established for qscc.syscc
2023-01-18 16:21:44.615 UTC 0084 DEBU [chaincode] sendReady -> sending READY for chaincode qscc.syscc
2023-01-18 16:21:44.615 UTC 0085 DEBU [chaincode] sendReady -> Changed to state ready for chaincode qscc.syscc
2023-01-18 16:21:44.615 UTC 0086 INFO [sccapi] DeploySysCC -> deploying system chaincode '_lifecycle'
2023-01-18 16:21:44.615 UTC 0087 DEBU [sccapi] func2 -> chaincode started for _lifecycle.syscc
2023-01-18 16:21:44.615 UTC 0088 DEBU [sccapi] func1 -> starting chaincode-support stream for  _lifecycle.syscc
2023-01-18 16:21:44.615 UTC 0089 DEBU [chaincode] handleMessage -> [] Fabric side handling ChaincodeMessage of type: REGISTER in state created
2023-01-18 16:21:44.615 UTC 008a DEBU [chaincode] HandleRegister -> Received REGISTER in state created
2023-01-18 16:21:44.615 UTC 008b DEBU [chaincode] Register -> registered handler complete for chaincode _lifecycle.syscc
2023-01-18 16:21:44.615 UTC 008c DEBU [chaincode] HandleRegister -> Got REGISTER for chaincodeID = _lifecycle.syscc, sending back REGISTERED
2023-01-18 16:21:44.615 UTC 008d DEBU [chaincode] HandleRegister -> Changed state to established for _lifecycle.syscc
2023-01-18 16:21:44.615 UTC 008e DEBU [chaincode] sendReady -> sending READY for chaincode _lifecycle.syscc
2023-01-18 16:21:44.615 UTC 008f DEBU [chaincode] sendReady -> Changed to state ready for chaincode _lifecycle.syscc
2023-01-18 16:21:44.615 UTC 0090 INFO [nodeCmd] serve -> Deployed system chaincodes
2023-01-18 16:21:44.616 UTC 0091 INFO [discovery] NewService -> Created with config TLS: true, authCacheMaxSize: 1000, authCachePurgeRatio: 0.750000
2023-01-18 16:21:44.616 UTC 0092 INFO [nodeCmd] serve -> Discovery service activated
2023-01-18 16:21:44.616 UTC 0093 INFO [nodeCmd] serve -> Starting peer with Gateway enabled
2023-01-18 16:21:44.616 UTC 0094 INFO [nodeCmd] serve -> Starting peer with ID=[org1-peer1.org1.example.com], network ID=[dev], address=[org1-peer1:7051]
2023-01-18 16:21:44.616 UTC 0095 INFO [nodeCmd] serve -> Started peer with ID=[org1-peer1.org1.example.com], network ID=[dev], address=[org1-peer1:7051]
2023-01-18 16:21:44.617 UTC 0096 INFO [kvledger] LoadPreResetHeight -> Loading prereset height from path [/var/hyperledger/fabric/data/org1-peer1.org1.example.com/ledgersData/chains]
2023-01-18 16:21:44.617 UTC 0097 DEBU [blkstorage] LoadPreResetHeight -> Loading Pre-reset heights
2023-01-18 16:21:44.617 UTC 0098 INFO [blkstorage] preResetHtFiles -> No active channels passed
2023-01-18 16:21:44.779 UTC 0099 DEBU [core.comm] ServerHandshake -> Server TLS handshake completed in 2.552292ms server=PeerServer remoteaddress=10.244.0.23:35502
2023-01-18 16:21:44.781 UTC 009a INFO [comm.grpc.server] 1 -> unary call completed grpc.service=gossip.Gossip grpc.method=Ping grpc.request_deadline=2023-01-18T16:21:46.781Z grpc.peer_address=10.244.0.23:35502 grpc.peer_subject= grpc.code=OK grpc.call_duration=78.319µs
2023-01-18 16:21:44.786 UTC 009b INFO [gossip.comm] GossipStream -> Peer c43040cd8f816422388511c21d6db5e5a0677605a2628f0a6b91f5cab8e9c9cf (10.244.0.23:35502) probed us
2023-01-18 16:21:44.786 UTC 009c INFO [comm.grpc.server] 1 -> streaming call completed grpc.service=gossip.Gossip grpc.method=GossipStream grpc.request_deadline=2023-01-18T16:21:54.783Z grpc.peer_address=10.244.0.23:35502 grpc.peer_subject= grpc.code=OK grpc.call_duration=2.383975ms
2023-01-18 16:21:44.791 UTC 009d DEBU [core.comm] ServerHandshake -> Server TLS handshake completed in 2.73857ms server=PeerServer remoteaddress=10.244.0.23:35512
2023-01-18 16:21:44.792 UTC 009e INFO [comm.grpc.server] 1 -> unary call completed grpc.service=gossip.Gossip grpc.method=Ping grpc.request_deadline=2023-01-18T16:21:46.792Z grpc.peer_address=10.244.0.23:35512 grpc.peer_subject= grpc.code=OK grpc.call_duration=62.972µs
2023-01-18 21:13:21.801 UTC 009f DEBU [core.comm] ServerHandshake -> Server TLS handshake completed in 7.115183ms server=PeerServer remoteaddress=10.244.0.10:38352
2023-01-18 21:13:21.816 UTC 00a0 DEBU [endorser] ProcessProposal -> request from 10.244.0.10:38352
2023-01-18 21:13:21.816 UTC 00a1 WARN [endorser] Validate -> access denied channel= txID=5097d26a error="expected MSP ID Org1MSP, received Org2MSP" errorVerbose="expected MSP ID Org1MSP, received Org2MSP\ngithub.com/hyperledger/fabric/msp.(*bccspmsp).DeserializeIdentity\n\t/go/src/github.com/hyperledger/fabric/msp/mspimpl.go:390\ngithub.com/hyperledger/fabric/msp/cache.(*cachedMSP).DeserializeIdentity\n\t/go/src/github.com/hyperledger/fabric/msp/cache/cache.go:74\ngithub.com/hyperledger/fabric/core/endorser.(*UnpackedProposal).Validate\n\t/go/src/github.com/hyperledger/fabric/core/endorser/msgvalidation.go:170\ngithub.com/hyperledger/fabric/core/endorser.(*Endorser).preProcess\n\t/go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:258\ngithub.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal\n\t/go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:335\ngithub.com/hyperledger/fabric/core/handlers/auth/filter.(*expirationCheckFilter).ProcessProposal\n\t/go/src/github.com/hyperledger/fabric/core/handlers/auth/filter/expiration.go:61\ngithub.com/hyperledger/fabric/core/handlers/auth/filter.(*filter).ProcessProposal\n\t/go/src/github.com/hyperledger/fabric/core/handlers/auth/filter/filter.go:32\ngithub.com/hyperledger/fabric-protos-go/peer._Endorser_ProcessProposal_Handler.func1\n\t/go/src/github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go:107\ngithub.com/hyperledger/fabric/internal/peer/node.unaryGrpcLimiter.func1\n\t/go/src/github.com/hyperledger/fabric/internal/peer/node/grpc_limiters.go:56\ngithub.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1\n\t/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25\ngithub.com/hyperledger/fabric/common/grpclogging.UnaryServerInterceptor.func1\n\t/go/src/github.com/hyperledger/fabric/common/grpclogging/server.go:92\ngithub.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1\n\t/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25\ngithub.com/hyperledger/fabric/common/grpcmetrics.UnaryServerInterceptor.func1\n\t/go/src/github.com/hyperledger/fabric/common/grpcmetrics/interceptor.go:31\ngithub.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1\n\t/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25\ngithub.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1\n\t/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34\ngithub.com/hyperledger/fabric-protos-go/peer._Endorser_ProcessProposal_Handler\n\t/go/src/github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go:109\ngoogle.golang.org/grpc.(*Server).processUnaryRPC\n\t/go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1180\ngoogle.golang.org/grpc.(*Server).handleStream\n\t/go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1503\ngoogle.golang.org/grpc.(*Server).serveStreams.func1.2\n\t/go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:843\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1571" identity="(mspid=Org2MSP subject=CN=org1admin,OU=admin,O=Hyperledger,ST=North Carolina,C=US issuer=CN=fabric-ca-server,OU=Fabric,O=Hyperledger,ST=North Carolina,C=US serialnumber=451758339561705437497588607699569798162671790761)"
2023-01-18 21:13:21.817 UTC 00a2 WARN [endorser] ProcessProposal -> Failed to preProcess proposal error="error validating proposal: access denied: channel [] creator org unknown, creator is malformed"
2023-01-18 21:13:21.817 UTC 00a3 INFO [comm.grpc.server] 1 -> unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=10.244.0.10:38352 error="error validating proposal: access denied: channel [] creator org unknown, creator is malformed" grpc.code=Unknown grpc.call_duration=1.553727ms

I also check the env variable in the peer but I'm still new to this technology and I can't say if something s wrong

/ # env
ORG2_CA_SERVICE_PORT_HTTPS=443
ORG2_CA_PORT_443_TCP=tcp://10.96.70.66:443
ORG1_PEER1_PORT_9443_TCP=tcp://10.96.59.165:9443
ORG1_PEER1_SERVICE_PORT_OPERATIONS=9443
ORG0_CA_SERVICE_HOST=10.96.178.217
ORG1_CA_SERVICE_HOST=10.96.199.221
ORG2_PEER1_PORT_9443_TCP=tcp://10.96.1.136:9443
ORG1_PEER_GATEWAY_SVC_SERVICE_PORT=7051
ORG1_PEER2_PORT_9443_TCP=tcp://10.96.49.27:9443
ORG1_PEER2_SERVICE_PORT_OPERATIONS=9443
ORG1_PEER_GATEWAY_SVC_PORT=tcp://10.96.157.180:7051
ORG2_PEER1_SERVICE_PORT_OPERATIONS=9443
KUBERNETES_SERVICE_PORT=443
KUBERNETES_PORT=tcp://10.96.0.1:443
ORG2_CA_SERVICE_HOST=10.96.70.66
ORG2_PEER_GATEWAY_SVC_SERVICE_PORT=7051
ORG2_PEER2_PORT_9443_TCP=tcp://10.96.206.41:9443
ORG2_PEER_GATEWAY_SVC_PORT=tcp://10.96.180.157:7051
ORG2_PEER2_SERVICE_PORT_OPERATIONS=9443
ORG1_PEER_GATEWAY_SVC_PORT_7051_TCP=tcp://10.96.157.180:7051
HOSTNAME=org1-peer1-6589b478fc-c5lwk
CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=adminpw
ORG2_PEER_GATEWAY_SVC_PORT_7051_TCP=tcp://10.96.180.157:7051
CORE_PEER_GOSSIP_BOOTSTRAP=org1-peer2:7051
CORE_PEER_TLS_KEY_FILE=/var/hyperledger/fabric/config/tls/tls.key
SHLVL=1
ORG1_PEER_GATEWAY_SVC_SERVICE_PORT_GRPC=7051
HOME=/root
CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:7052
ORG0_CA_SERVICE_PORT=443
ORG0_ORDERER1_SERVICE_PORT_GENERAL=6050
ORG0_CA_PORT=tcp://10.96.178.217:443
ORG2_PEER_GATEWAY_SVC_SERVICE_PORT_GRPC=7051
CORE_PEER_FILESYSTEMPATH=/var/hyperledger/fabric/data/org1-peer1.org1.example.com
CORE_PEER_TLS_ROOTCERT_FILE=/var/hyperledger/fabric/config/tls/ca.crt
ORG1_CA_SERVICE_PORT=443
ORG0_ORDERER2_SERVICE_PORT_GENERAL=6050
ORG1_CA_PORT=tcp://10.96.199.221:443
CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=localhost:5984
ORG2_CA_SERVICE_PORT=443
ORG0_ORDERER3_SERVICE_PORT_GENERAL=6050
ORG2_CA_PORT=tcp://10.96.70.66:443
CORE_PEER_ID=org1-peer1.org1.example.com
CORE_LEDGER_STATE_COUCHDBCONFIG_MAXRETRIESONSTARTUP=20
CORE_PEER_CHAINCODEADDRESS=org1-peer1:7052
ORG0_ORDERER1_SERVICE_PORT_ADMIN=9443
ORG0_ORDERER1_PORT_6050_TCP_ADDR=10.96.132.113
ORG0_ORDERER2_PORT_6050_TCP_ADDR=10.96.56.120
ORG0_ORDERER2_SERVICE_PORT_ADMIN=9443
CORE_PEER_GOSSIP_EXTERNALENDPOINT=org1-peer1.test-network.svc.cluster.local:7051
FABRIC_LOGGING_SPEC=debug:cauthdsl,policies,msp,grpc,peer.gossip.mcs,gossip,leveldbhelper=info
ORG0_ORDERER3_PORT_6050_TCP_ADDR=10.96.75.139
ORG0_ORDERER3_SERVICE_PORT_ADMIN=9443
ORG0_ORDERER1_PORT_6050_TCP_PORT=6050
ORG0_ORDERER1_PORT_6050_TCP_PROTO=tcp
ORG0_ORDERER2_PORT_6050_TCP_PORT=6050
TERM=xterm
FABRIC_CFG_PATH=/var/hyperledger/fabric/config
KUBERNETES_PORT_443_TCP_ADDR=10.96.0.1
ORG0_ORDERER2_PORT_6050_TCP_PROTO=tcp
ORG0_ORDERER3_PORT_6050_TCP_PORT=6050
ORG0_ORDERER1_SERVICE_HOST=10.96.132.113
ORG0_ORDERER3_PORT_6050_TCP_PROTO=tcp
ORG0_ORDERER2_SERVICE_HOST=10.96.56.120
ORG1_PEER1_PORT_7051_TCP_ADDR=10.96.59.165
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ORG1_PEER1_PORT_7052_TCP_ADDR=10.96.59.165
ORG1_PEER2_PORT_7051_TCP_ADDR=10.96.49.27
ORG0_ORDERER3_SERVICE_HOST=10.96.75.139
ORG2_PEER1_PORT_7051_TCP_ADDR=10.96.1.136
ORG2_PEER2_PORT_7051_TCP_ADDR=10.96.206.41
KUBERNETES_PORT_443_TCP_PORT=443
ORG2_PEER1_PORT_7052_TCP_ADDR=10.96.1.136
ORG1_PEER1_SERVICE_PORT_CHAINCODE=7052
ORG1_PEER2_PORT_7052_TCP_ADDR=10.96.49.27
ORG0_ORDERER1_PORT_8443_TCP_ADDR=10.96.132.113
CHAINCODE_AS_A_SERVICE_BUILDER_CONFIG={"peername":"org1peer1"}
KUBERNETES_PORT_443_TCP_PROTO=tcp
ORG2_PEER1_SERVICE_PORT_CHAINCODE=7052
ORG0_ORDERER1_PORT_9443_TCP_ADDR=10.96.132.113
ORG1_PEER1_PORT_7051_TCP_PORT=7051
ORG0_ORDERER2_PORT_8443_TCP_ADDR=10.96.56.120
ORG1_PEER1_SERVICE_HOST=10.96.59.165
ORG1_PEER2_SERVICE_PORT_CHAINCODE=7052
ORG2_PEER2_PORT_7052_TCP_ADDR=10.96.206.41
CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=admin
ORG1_PEER1_PORT_7052_TCP_PORT=7052
ORG1_PEER1_PORT_7051_TCP_PROTO=tcp
ORG2_PEER1_PORT_7051_TCP_PORT=7051
ORG1_PEER2_SERVICE_HOST=10.96.49.27
ORG0_ORDERER2_PORT_9443_TCP_ADDR=10.96.56.120
ORG2_PEER2_SERVICE_PORT_CHAINCODE=7052
ORG1_PEER2_PORT_7051_TCP_PORT=7051
ORG2_PEER1_SERVICE_HOST=10.96.1.136
ORG0_ORDERER3_PORT_8443_TCP_ADDR=10.96.75.139
ORG2_PEER1_PORT_7051_TCP_PROTO=tcp
ORG2_PEER1_PORT_7052_TCP_PORT=7052
ORG1_PEER2_PORT_7051_TCP_PROTO=tcp
ORG1_PEER1_PORT_7052_TCP_PROTO=tcp
ORG2_PEER2_SERVICE_HOST=10.96.206.41
ORG2_PEER2_PORT_7051_TCP_PORT=7051
ORG0_ORDERER1_PORT_8443_TCP_PORT=8443
ORG1_PEER2_PORT_7052_TCP_PORT=7052
ORG0_CA_PORT_443_TCP_ADDR=10.96.178.217
ORG0_ORDERER3_PORT_9443_TCP_ADDR=10.96.75.139
ORG1_PEER2_PORT_7052_TCP_PROTO=tcp
ORG2_PEER2_PORT_7051_TCP_PROTO=tcp
ORG0_ORDERER2_PORT_8443_TCP_PORT=8443
ORG0_ORDERER1_PORT_8443_TCP_PROTO=tcp
ORG0_ORDERER1_PORT_9443_TCP_PORT=9443
ORG2_PEER2_PORT_7052_TCP_PORT=7052
ORG2_PEER1_PORT_7052_TCP_PROTO=tcp
ORG0_ORDERER1_SERVICE_PORT=6050
ORG0_ORDERER1_PORT=tcp://10.96.132.113:6050
ORG1_CA_PORT_443_TCP_ADDR=10.96.199.221
ORG0_ORDERER1_PORT_6050_TCP=tcp://10.96.132.113:6050
ORG2_CA_PORT_443_TCP_ADDR=10.96.70.66
ORG0_ORDERER3_PORT_8443_TCP_PORT=8443
ORG0_ORDERER2_SERVICE_PORT=6050
ORG1_PEER1_PORT_9443_TCP_ADDR=10.96.59.165
ORG0_ORDERER2_PORT=tcp://10.96.56.120:6050
ORG2_PEER2_PORT_7052_TCP_PROTO=tcp
ORG0_ORDERER2_PORT_6050_TCP=tcp://10.96.56.120:6050
ORG0_ORDERER2_PORT_8443_TCP_PROTO=tcp
ORG0_ORDERER1_PORT_9443_TCP_PROTO=tcp
ORG0_ORDERER2_PORT_9443_TCP_PORT=9443
CORE_LEDGER_SNAPSHOTS_ROOTDIR=/var/hyperledger/fabric/data/org1-peer1.org1.example.com/snapshots
ORG2_PEER1_PORT_9443_TCP_ADDR=10.96.1.136
ORG0_ORDERER3_PORT=tcp://10.96.75.139:6050
ORG0_ORDERER3_PORT_8443_TCP_PROTO=tcp
ORG0_ORDERER2_PORT_9443_TCP_PROTO=tcp
ORG1_PEER2_PORT_9443_TCP_ADDR=10.96.49.27
ORG0_ORDERER3_SERVICE_PORT=6050
ORG0_ORDERER3_PORT_9443_TCP_PORT=9443
ORG0_CA_PORT_443_TCP_PORT=443
ORG0_ORDERER3_PORT_6050_TCP=tcp://10.96.75.139:6050
CORE_PEER_LOCALMSPID=Org1MSP
ORG2_PEER2_PORT_9443_TCP_ADDR=10.96.206.41
ORG1_CA_PORT_443_TCP_PORT=443
ORG0_ORDERER3_PORT_9443_TCP_PROTO=tcp
ORG0_CA_PORT_443_TCP_PROTO=tcp
CORE_PEER_MSPCONFIGPATH=/var/hyperledger/fabric/organizations/peerOrganizations/org1.example.com/peers/org1-peer1.org1.example.com/msp
ORG1_PEER_GATEWAY_SVC_PORT_7051_TCP_ADDR=10.96.157.180
ORG1_PEER1_PORT_9443_TCP_PORT=9443
ORG2_CA_PORT_443_TCP_PORT=443
ORG1_CA_PORT_443_TCP_PROTO=tcp
ORG1_PEER1_SERVICE_PORT=7051
ORG1_PEER1_PORT=tcp://10.96.59.165:7051
CORE_LEDGER_STATE_STATEDATABASE=CouchDB
KUBERNETES_SERVICE_PORT_HTTPS=443
ORG2_PEER_GATEWAY_SVC_PORT_7051_TCP_ADDR=10.96.180.157
ORG2_PEER1_PORT_9443_TCP_PORT=9443
ORG2_PEER1_PORT=tcp://10.96.1.136:7051
KUBERNETES_PORT_443_TCP=tcp://10.96.0.1:443
ORG1_PEER1_PORT_9443_TCP_PROTO=tcp
ORG1_PEER2_PORT_9443_TCP_PORT=9443
ORG1_PEER2_PORT=tcp://10.96.49.27:7051
ORG2_CA_PORT_443_TCP_PROTO=tcp
ORG1_PEER2_SERVICE_PORT=7051
ORG2_PEER1_SERVICE_PORT=7051
CORE_PEER_LISTENADDRESS=0.0.0.0:7051
ORG1_PEER1_PORT_7051_TCP=tcp://10.96.59.165:7051
ORG2_PEER2_PORT=tcp://10.96.206.41:7051
ORG1_PEER2_PORT_9443_TCP_PROTO=tcp
ORG2_PEER2_PORT_9443_TCP_PORT=9443
ORG2_PEER1_PORT_9443_TCP_PROTO=tcp
ORG2_PEER2_SERVICE_PORT=7051
ORG1_PEER1_PORT_7052_TCP=tcp://10.96.59.165:7052
KUBERNETES_SERVICE_HOST=10.96.0.1
ORG1_PEER_GATEWAY_SVC_SERVICE_HOST=10.96.157.180
ORG2_PEER1_PORT_7051_TCP=tcp://10.96.1.136:7051
ORG2_PEER2_PORT_9443_TCP_PROTO=tcp
ORG1_PEER2_PORT_7051_TCP=tcp://10.96.49.27:7051
ORG1_PEER_GATEWAY_SVC_PORT_7051_TCP_PORT=7051
PWD=/
ORG2_PEER_GATEWAY_SVC_PORT_7051_TCP_PORT=7051
ORG1_PEER2_PORT_7052_TCP=tcp://10.96.49.27:7052
ORG2_PEER_GATEWAY_SVC_SERVICE_HOST=10.96.180.157
ORG1_PEER_GATEWAY_SVC_PORT_7051_TCP_PROTO=tcp
ORG2_PEER1_PORT_7052_TCP=tcp://10.96.1.136:7052
ORG2_PEER2_PORT_7051_TCP=tcp://10.96.206.41:7051
ORG0_ORDERER1_PORT_8443_TCP=tcp://10.96.132.113:8443
CORE_PEER_TLS_CERT_FILE=/var/hyperledger/fabric/config/tls/tls.crt
ORG2_PEER2_PORT_7052_TCP=tcp://10.96.206.41:7052
ORG0_ORDERER1_SERVICE_PORT_OPERATIONS=8443
ORG0_ORDERER1_PORT_9443_TCP=tcp://10.96.132.113:9443
ORG0_ORDERER2_PORT_8443_TCP=tcp://10.96.56.120:8443
ORG2_PEER_GATEWAY_SVC_PORT_7051_TCP_PROTO=tcp
ORG1_PEER1_SERVICE_PORT_GRPC=7051
CORE_PEER_TLS_ENABLED=true
CORE_OPERATIONS_LISTENADDRESS=0.0.0.0:9443
ORG1_PEER2_SERVICE_PORT_GRPC=7051
ORG0_ORDERER2_SERVICE_PORT_OPERATIONS=8443
ORG0_ORDERER3_PORT_8443_TCP=tcp://10.96.75.139:8443
ORG2_PEER1_SERVICE_PORT_GRPC=7051
ORG0_ORDERER2_PORT_9443_TCP=tcp://10.96.56.120:9443
CORE_PEER_ADDRESS=org1-peer1:7051
ORG0_CA_SERVICE_PORT_HTTPS=443
ORG0_ORDERER3_SERVICE_PORT_OPERATIONS=8443
ORG0_CA_PORT_443_TCP=tcp://10.96.178.217:443
ORG0_ORDERER3_PORT_9443_TCP=tcp://10.96.75.139:9443
ORG2_PEER2_SERVICE_PORT_GRPC=7051
ORG1_CA_SERVICE_PORT_HTTPS=443
ORG1_CA_PORT_443_TCP=tcp://10.96.199.221:443
michaelcourcy commented 1 year ago

After few attempts I found out this happens when executing the function `join_channel_peer org1 peer1 in the channel.sh script.

  local org=org1
  local peer=peer1

  export_peer_context $org $peer

  peer channel join \
    --blockpath   ${TEMP_DIR}/genesis_block.pb \
    --orderer     org0-orderer1.${DOMAIN} \
    --connTimeout ${ORDERER_TIMEOUT} \
    --tls         \
    --cafile      ${TEMP_DIR}/channel-msp/ordererOrganizations/org0/orderers/org0-orderer1/tls/signcerts/tls-cert.pem

There is a discrepancy between the certificate sent org1-ca-localho-st-443.pem and the msp included in the payload mspid=Org2MSP

identity="(mspid=Org2MSP subject=CN=org1admin,OU=admin,O=Hyperledger,ST=North Carolina,C=US issuer=CN=fabric-ca-server,OU=Fabric,O=Hyperledger,ST=North Carolina,C=US serialnumber=522072795834743694220586894795889237968758182696)"

The certificate included in the payload that has this serial number :

x509 build/enrollments/org1/users/org1admin/msp/cacerts/org1-ca-localho-st-443.pem
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            16:d3:e8:00:d3:5c:3a:c7:b6:cf:3d:d7:6b:de:ad:c4:82:0b:5d:95
    Signature Algorithm: ecdsa-with-SHA256
        Issuer: C=US, ST=North Carolina, O=Hyperledger, OU=Fabric, CN=fabric-ca-server
        Validity
            Not Before: Jan 19 16:09:00 2023 GMT
            Not After : Jan 15 16:09:00 2038 GMT
        Subject: C=US, ST=North Carolina, O=Hyperledger, OU=Fabric, CN=fabric-ca-server
        Subject Public Key Info:
            Public Key Algorithm: id-ecPublicKey
                Public-Key: (256 bit)
                pub: 
                    04:bc:3e:cc:7b:f6:4f:5a:7d:1a:d4:66:cf:17:6e:
                    f9:10:c8:6c:fa:cc:18:16:ff:df:68:e8:5b:e5:7c:
                    f1:c8:03:a4:e0:92:68:d0:34:df:72:5c:4e:03:fe:
                    85:dd:f4:e5:a7:13:13:f5:d3:84:8d:d7:51:c5:55:
                    6b:38:a7:1a:7f
                ASN1 OID: prime256v1
                NIST CURVE: P-256
        X509v3 extensions:
            X509v3 Key Usage: critical
                Certificate Sign, CRL Sign
            X509v3 Basic Constraints: critical
                CA:TRUE, pathlen:1
            X509v3 Subject Key Identifier: 
                4A:73:26:1E:A9:00:71:F9:09:7A:DC:4F:40:43:12:E7:6F:A7:0F:EB
            X509v3 Subject Alternative Name: 
                IP Address:127.0.0.1
    Signature Algorithm: ecdsa-with-SHA256
         30:45:02:21:00:fa:42:52:7c:62:1c:18:41:fd:40:42:8b:ec:
         59:b8:cf:aa:c8:2d:a5:b4:94:74:9a:cd:31:ed:ef:5c:2f:cf:
         f0:02:20:76:39:19:70:52:04:a0:c9:ad:1f:c8:41:1f:e5:82:
         e9:1b:0e:c1:9b:07:31:fc:25:70:fd:44:e7:a2:77:8e:c5

The code that is sending this error compare the mspid in the payload with the mspid expected and throw an error if they don't match https://github.com/hyperledger/fabric/blob/52b9f467531c442ce21d855b97f4fc2ac3fa50f3/msp/mspimpl.go#L389

On the first place I was thinking that the mspid sent in payload was coming from the certificate and that either the wrong certificate was sent or the certificate was wrong. But for me the certificate look correct (it's the right certificate which is sent and the content of the certificate looks good).

No mspid information seems to be included in the certificate so I'm still trying to understand how peer channel join command pick up the mspid to include it in the payload. I would appreciate any hint.

michaelcourcy commented 1 year ago

Ok finally figure out my issue, I had the env var CORE_PEER_LOCALMSPID=Org2MSP set up (probably from some previous tutorials) and that create this error. Restarting in a clean env solve the issue.