Fabric SDK Go Conflict with Fabric 1.4.12 Protos - "Message Already Registered" Error

97 Views Asked by At

I'm encountering an issue while working with Hyperledger Fabric 1.4.12. The problem arises when I try to run my Go application, and it throws a panic with the following error message:

panic: proto: message msp.SerializedIdentity is already registered

Upon investigating further, I have identified that the root cause of this error is a conflict between the fabric-sdk-go and the protos used in Fabric 1.4.12. It appears that fabric-sdk-go has a dependency on fabric-protos-go, which clashes with the protos already included in Fabric 1.4.12 source code.

This conflict results in the duplication of the msp.SerializedIdentity message registration, leading to the "message already registered" error.

Here are the steps I have taken so far to address the issue:

  1. Upgraded fabric-sdk-go and fabric-protos-go to their latest versions.
  2. Verified that there is only one version of fabric-protos-go installed in my project.
  3. Attempted to clean and rebuild the project.

Unfortunately, these steps did not resolve the issue. Therefore, I believe that the root cause lies in the incompatibility between fabric-sdk-go v1.0.0-beta1 and the protos already present in Fabric 1.4.12.

Thank you in advance

1

There are 1 best solutions below

0
On BEST ANSWER

Solved!

I have the chaincode directory inside the main module, which shouldn't be a problem if it was not imported in the main module to get some struct types. Once I removed the imports the issue was gone.