当前位置: 首页 > news >正文

执行“go mod tidy”遇到“misbehavior”错误

执行“go mod tidy”报错下错误,执行“go clean -modcache”和删除“go env GOMODCACHE”指定目录均无效:

SECURITY ERROR
go.sum database server misbehavior detected!old database:go.sum database tree3397826xyyhzdyAOat5li/EXx/MK1gONQf3LAGqArhBLzQVQt8=— sum.mooon.com ZD16BsDeu0l8HWHTrM3Axa9jy5Ctbbmj9FZ1AowqytSa22OZ7Se98hXT+88+mjuCAIY5KSAG/nV26LayhI5OyaA3cAb=new database:go.sum database tree3398774MgvgQR/7OUAeth2F6s7qHqgBX7QNBIKhXfeN7iFPBes=— sum.mooon.com ZD16BtxccgOLtLlxqG5rx6vhz8vPBkqUTpW+loMoojYBqWcEeVWnxkKAMFtH2ynJrlXsOLLBfABqBJTxhyswvyh1mAe=proof of misbehavior:duuII5nfe1EhWYdzwvAkuwY/teHJYPtw8Ip1Z/ebbOt=    internal error: generated inconsistent proof

删除项目的 go.sum 也不一定能解决,打新的 tag 可能也无用。可尝试删除文件 rm $(go env GOMODCACHE)/…/sumdb/sum.mooon.com/latest 后重试,测试解决了此问题。

报这个错误的源代码文件 https://github.com/golang/mod/blob/master/sumdb/client.go :

// checkTrees checks that older (from olderNote) is contained in newer (from newerNote).
// If an error occurs, such as malformed data or a network problem, checkTrees returns that error.
// If on the other hand checkTrees finds evidence of misbehavior, it prepares a detailed
// message and calls log.Fatal.
func (c *Client) checkTrees(older tlog.Tree, olderNote []byte, newer tlog.Tree, newerNote []byte) error {thr := tlog.TileHashReader(newer, &c.tileReader)h, err := tlog.TreeHash(older.N, thr)if err != nil {if older.N == newer.N {return fmt.Errorf("checking tree#%d: %v", older.N, err)}return fmt.Errorf("checking tree#%d against tree#%d: %v", older.N, newer.N, err)}if h == older.Hash {return nil}// Detected a fork in the tree timeline.// Start by reporting the inconsistent signed tree notes.var buf bytes.Bufferfmt.Fprintf(&buf, "SECURITY ERROR\n")fmt.Fprintf(&buf, "go.sum database server misbehavior detected!\n\n")indent := func(b []byte) []byte {return bytes.Replace(b, []byte("\n"), []byte("\n\t"), -1)}fmt.Fprintf(&buf, "old database:\n\t%s\n", indent(olderNote))fmt.Fprintf(&buf, "new database:\n\t%s\n", indent(newerNote))// The notes alone are not enough to prove the inconsistency.// We also need to show that the newer note's tree hash for older.N// does not match older.Hash. The consumer of this report could// of course consult the server to try to verify the inconsistency,// but we are holding all the bits we need to prove it right now,// so we might as well print them and make the report not depend// on the continued availability of the misbehaving server.// Preparing this data only reuses the tiled hashes needed for// tlog.TreeHash(older.N, thr) above, so assuming thr is caching tiles,// there are no new access to the server here, and these operations cannot fail.fmt.Fprintf(&buf, "proof of misbehavior:\n\t%v", h)if p, err := tlog.ProveTree(newer.N, older.N, thr); err != nil {fmt.Fprintf(&buf, "\tinternal error: %v\n", err)} else if err := tlog.CheckTree(p, newer.N, newer.Hash, older.N, h); err != nil {fmt.Fprintf(&buf, "\tinternal error: generated inconsistent proof\n")} else {for _, h := range p {fmt.Fprintf(&buf, "\n\t%v", h)}}c.ops.SecurityError(buf.String())return ErrSecurity
}
http://www.lryc.cn/news/500479.html

相关文章:

  • 深入详解人工智能机器学习:强化学习
  • 力扣打卡11:合并区间(比较器内联,引用传参的优化)
  • 《 bilibili-起步级 用户模块接口文档 经验分享 ~》
  • AES 与 SM4 加密算法:深度解析与对比
  • 启保停电路如何接到PLC
  • HTTP multipart/form-data 请求
  • 配置服务器的免密登录
  • 普通遥控电动遮阳雨棚怎么接入米家并用苹果手机Siri控制
  • 两种不同简缩极化的六个方程
  • 环形缓冲区(Ring Buffer):概念、功能、使用场景与实现
  • 大连理工大学数据结构2003年硕士入学试题
  • Master EDI 项目需求分析
  • 图海寻径——图相关算法的奇幻探索之旅
  • 亚马逊云科技re:Invent:生成式AI与全球布局
  • Android 因为混淆文件配置,打release包提示running R8问题处理
  • 20241209给Ubuntu20.04系统的的交换分区增加为20GB的步骤
  • Centos7环境下nifi单机部署
  • 如何通过轻易云实现金蝶云星空与旺店通数据集成
  • OSG开发笔记(三十七):OSG基于windows平台msvc2017x64编译器官方稳定版本OSG3.4.1搭建环境并移植Demo
  • 2024最新小猫咪PHP加密系统源码V1.4_本地API接口_带后台
  • K8S OOM killer机制
  • 什么是绩效文化?
  • 【人工智能-CV领域】对抗生成网络(GAN)与扩散模型全面解析与深度融合:实现AI生成能力的新突破
  • IT系统运维监控指标体系-持续完善中
  • RPC设计--TcpAcceptor
  • 《Python数据分析:活用pandas库》学习笔记Day1:Panda DataFrame基础知识
  • 【Go 基础】并发相关
  • 数据质量规则(Data Quality Rules)
  • stm32延时
  • 工作随笔2024,12.9