Fabric SDK Go与Fabric 1.4.12 Protos冲突 – “Message Already Registered”错误

huangapple go评论73阅读模式
英文:

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

问题

我在使用Hyperledger Fabric 1.4.12时遇到了问题。当我尝试运行我的Go应用程序时,出现了以下错误信息:

panic: proto: message msp.SerializedIdentity is already registered

进一步调查后,我发现此错误的根本原因是fabric-sdk-go与Fabric 1.4.12中使用的protos之间的冲突。似乎fabric-sdk-go依赖于fabric-protos-go,而这与Fabric 1.4.12源代码中已包含的protos发生冲突。

这个冲突导致了msp.SerializedIdentity消息的重复注册,从而引发了“消息已经注册”的错误。

为解决此问题,我已经采取了以下步骤:

  1. 升级了fabric-sdk-go和fabric-protos-go到它们的最新版本。
  2. 验证了我的项目中只安装了一个版本的fabric-protos-go。
  3. 尝试清理并重新构建项目。

不幸的是,这些步骤没有解决问题。因此,我认为根本原因在于fabric-sdk-go v1.0.0-beta1与Fabric 1.4.12中已存在的protos之间的不兼容性。

提前感谢您的帮助。

英文:

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

得分: 0

已解决!

我将链码目录放在主模块内部,如果它没有被导入主模块以获取一些结构类型,这本不应该是一个问题。一旦我移除了导入,问题就消失了。

英文:

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.

huangapple
  • 本文由 发表于 2023年6月27日 21:07:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/76565205.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定