当前位置:   article > 正文

go.sum are different when using go mod vendor/download(go.sum checksum mismatch)_security error this download does not match an ear

security error this download does not match an earlier download recorded in

本地Golang配置
在这里插入图片描述

今天本地编译一个项目,遇到以下错误

PS D:\Code\Golang\jiankunking\k8s-ext> go mod tidy
go: downloading github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible
verifying github.com/gin-gonic/gin@v1.7.3: checksum mismatch
        downloaded: h1:3U500Wp728rATEiFJtk1L7dhAbWobNDQC0Cbd4yhhdc=
        go.sum:     h1:aMBzLJ/GMEYmv1UWs2FFTcPISLrQH2mRgL9Glz8xows=

SECURITY ERROR
This download does NOT match an earlier download recorded in go.sum.
The bits may have been replaced on the origin server, or an attacker may
have intercepted the download attempt.

For more information, see 'go help module-auth'.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

尝试过以下方案

go clean -modcache
rm go.sum
go mod tidy
  • 1
  • 2
  • 3

无效

最终解决方案:

PS D:\Code\Golang\jiankunking\k8s-ext> $env:GOPROXY = "https://goproxy.cn"
PS D:\Code\Golang\jiankunking\k8s-ext> go mod tidy
go: downloading github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible
go: downloading github.com/gin-gonic/gin v1.7.3
go: downloading github.com/olivere/elastic v6.2.28+incompatible
go: downloading github.com/kedacore/keda/v2 v2.5.0
go: downloading k8s.io/kubectl v0.21.2
go: downloading github.com/mattn/go-sqlite3 v1.14.6
go: downloading github.com/gin-contrib/sse v0.1.0
go: downloading github.com/mattn/go-isatty v0.0.16
go: downloading github.com/onsi/ginkgo/v2 v2.6.0
go: downloading github.com/onsi/gomega v1.24.1
go: downloading github.com/fortytw2/leaktest v1.3.0
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading github.com/go-playground/validator/v10 v10.11.1
go: downloading github.com/ugorji/go/codec v1.2.7
go: downloading github.com/kr/pretty v0.3.0
go: downloading github.com/satori/go.uuid v1.2.0
go: downloading knative.dev/pkg v0.0.0-20211123135150-787aec59e70a
go: downloading github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5
go: downloading github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153
go: downloading github.com/go-logr/zapr v1.2.3
go: downloading go.uber.org/zap v1.24.0
go: downloading github.com/kr/text v0.2.0
go: downloading github.com/rogpeppe/go-internal v1.8.0
go: downloading github.com/go-playground/universal-translator v0.18.0
go: downloading github.com/leodido/go-urn v1.2.1
go: downloading golang.org/x/crypto v0.1.0
go: downloading github.com/go-playground/assert/v2 v2.0.1
go: downloading github.com/onsi/ginkgo v1.16.5
go: downloading github.com/go-playground/locales v0.14.0
go: downloading go.uber.org/atomic v1.9.0
go: downloading go.uber.org/multierr v1.6.0
go: downloading github.com/fsnotify/fsnotify v1.6.0
go: downloading golang.org/x/mod v0.6.0
go: downloading github.com/evanphx/json-patch v4.12.0+incompatible
go: downloading k8s.io/klog v1.0.0
go: downloading github.com/ugorji/go v1.2.7
go: downloading github.com/blang/semver v3.5.1+incompatible
go: downloading github.com/emicklei/go-restful v2.15.0+incompatible
go: downloading github.com/cespare/xxhash v1.1.0
PS D:\Code\Golang\jiankunking\k8s-ext>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42

这个问题应该就是proxy缓存的原因导致:https://jfrog.atlassian.net//si/jira.issueviews:issue-html/RTFACT-24958/RTFACT-24958.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/211749
推荐阅读
相关标签
  

闽ICP备14008679号