Failed to get endorsing peers/failed constructing descriptor for chaincode


Alexander
 

I'm writing an RESTful API application to interact with a chaincode deployed on a network, using fabric-sdk-go and the gateway package.

My chaincode is successfully building and deploying to the network, and I'm able to query the network for contracts created and put on the network via the CLI.

When running my API, I'm able to successfully connect to via the gateway, and retrieve my contract object, but I'm then unable to actually call the same chaincode 'Query' function in my deployed chaincode, with the error my application returns being:

Failed to evaluate: Failed to get endorsing peers: error getting channel response for channel [mychannel]: Discovery status Code: (11) UNKNOWN. Description: error received from Discovery Server: failed constructing descriptor for chaincodes:<name:"newcc" > 
and the response to my request being 
Discovery status Code: (11) UNKNOWN. Description: error received from Discovery Server: failed constructing descriptor for chaincodes:<name:"newcc" >
I do not know what these mean. Is this somehow related to my endorsement policy set for the chaincode? How can I go about figuring out this issue?
 


Ed Kazmierczak
 

Hello

I have a very similar problem.

In my case I am writing RESTful API's to connect to Fabric using Javascript and the Javascript SDK and Gateway package. My chaincode is also written in Javascript, is built and deploys to the network. The gateway builds successfully and I can connect to the running fabric and the chaincode and retrieve my contract object. I can send data to the running chaincode via the CLI and get the correct responses from the chaincode. 

However, as with Alexander's message above I am unable to call any of the functions that I can access via the CLI but get the following message instead: 
2020-10-29T12:01:19.166Z - error: [DiscoveryService]: send[my-chaincode] - Channel:mychannel received discovery error:failed constructing descriptor for chaincodes:<name:"my-chaincode" > 

Has there been any updates to the problem of connecting via SDK's and Gateways?


David Enyeart
 

I believe you are hitting an issue that was fixed in v2.2.1 and mentioned in the release notes:
https://github.com/hyperledger/fabric/releases/tag/v2.2.1

FAB-18194: peer - Fix service discovery for legacy installed chaincodes

The service discovery endorsers query may fail with errors
"failed constructing descriptor for chaincodes" and
"required chaincodes are not installed on sufficient peers", even
when a chaincode is installed on a sufficient number of peers.
The peer initialization has been fixed so that chaincodes installed with the legacy chaincode
lifecycle are correctly recognized by service discovery.

It works for you via CLI because CLI does not use service discovery.


Dave Enyeart


ed.kazmierczak---10/29/2020 09:15:08 AM---Hello I have a very similar problem.

From: ed.kazmierczak@...
To: fabric@...
Date: 10/29/2020 09:15 AM
Subject: [EXTERNAL] Re: [Hyperledger Fabric] Failed to get endorsing peers/failed constructing descriptor for chaincode
Sent by: fabric@...





Hello

I have a very similar problem.

In my case I am writing RESTful API's to connect to Fabric using Javascript and the Javascript SDK and Gateway package. My chaincode is also written in Javascript, is built and deploys to the network. The gateway builds successfully and I can connect to the running fabric and the chaincode and retrieve my contract object. I can send data to the running chaincode via the CLI and get the correct responses from the chaincode.

However, as with Alexander's message above I am unable to call any of the functions that I can access via the CLI but get the following message instead:
2020-10-29T12:01:19.166Z - error: [DiscoveryService]: send[my-chaincode] - Channel:mychannel received discovery error:failed constructing descriptor for chaincodes:<name:"my-chaincode" >

Has there been any updates to the problem of connecting via SDK's and Gateways?