简体   繁体   English

运行 go mod 时出现错误,例如无法连接到 dev.azure.com?

[英]Getting error while running go mod tidy like unable to connect to dev.azure.com?

I am running my project in ubuntu 20.04 with wsl2.if we run go mod tidy from project repo then getting the error -go mod tidy我正在使用 wsl2 在 ubuntu 20.04 中运行我的项目。如果我们从项目 repo 运行 go mod tidy 然后得到错误 -go mod tidy

go: dev.azure.com/abc/abc/_git/common.git@v0.0.0-20210319112308-ceb4f9ce35f8: invalid version: git fetch -f git://dev.azure.com/abc/abc/_git/common refs/heads/ :refs/heads/ refs/tags/ :refs/tags/ in /home/name/go/pkg/mod/cache/vcs/6df6b6370763c12eca2ad232218f34099e8f5b956a0323787b3ae4f610e3fe8a: exit status 128: fatal: unable to connect to dev.azure.com: dev.azure.com[0: 13.107.42.20]: errno=Connection timed out go: dev.azure.com/abc/abc/_git/common.git@v0.0.0-20210319112308-ceb4f9ce35f8: invalid version: git fetch -f git://dev.azure.com/abc/abc/_git/common refs/heads/ :refs/heads/ refs/tags/ :refs/tags/ in /home/name/go/pkg/mod/cache/vcs/6df6b6370763c12eca2ad232218f34099e8f5b956a0323787b3ae4f610e3fe8a: exit status 128: fatal: unable to connect to dev.azure. com: dev.azure.com[0: 13.107.42.20]: errno=连接超时

i will share the go env and git config result我将分享 go 环境和 git 配置结果

GO111MODULE="on"


GOARCH="amd64"
GOBIN=""


GOCACHE="/home/name/.cache/go-build"

GOENV="/home/name/.config/go/env"

GOEXE=""

GOFLAGS=""

GOHOSTARCH="amd64"

GOHOSTOS="linux"

GONOPROXY="dev.azure.com/abc/*"

GONOSUMDB="dev.azure.com/abc/*"

GOOS="linux"

GOPATH="/home/name/go"

GOPRIVATE="dev.azure.com/abc/*"

GOPROXY="https://proxy.golang.org,direct"

GOROOT="/usr/lib/go-1.13"

GOSUMDB="sum.golang.org"

GOTMPDIR=""

GOTOOLDIR="/usr/lib/go-1.13/pkg/tool/linux_amd64"

GCCGO="gccgo"

AR="ar"

CC="gcc"

CXX="g++"

CGO_ENABLED="1"

GOMOD="/home/name/go/src/abc/go.mod"

CGO_CFLAGS="-g -O2"

CGO_CPPFLAGS=""

CGO_CXXFLAGS="-g -O2"

CGO_FFLAGS="-g -O2"

CGO_LDFLAGS="-g -O2"

PKG_CONFIG="pkg-config"

GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build067756412=/tmp/go-build -gno-record-gcc-switches"


cat ~/.gitconfig
[user]
        name = name
        email = name@abc.com
        username = name
[url "https://abc:token@dev.azure.com"]
        insteadOf = https://dev.azure.com/


If anyone have idea then please help me on this?

It seems that the cache is unreachable or corrupted.似乎缓存无法访问或损坏。 To clear the module cache go clean -modcache can help.清除模块缓存go clean -modcache可以提供帮助。 See documentation查看文档

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 fatal: unable to access 'https://dev.azure.com/xxx': OpenSSL SSL_connect: Connection was reset in connection to dev.azure.com:443 - fatal: unable to access 'https://dev.azure.com/xxx': OpenSSL SSL_connect: Connection was reset in connection to dev.azure.com:443 Git 身份验证错误 dev.azure.com - 但适用于 visualstudio.com - Git Auth Error dev.azure.com - But Works on visualstudio.com 无法确定此“dev.azure.com”远程 url 的组织名称 - Cannot determine the organization name for this 'dev.azure.com' remote url git 克隆(使用 ssh)来自 dev.azure.com 突然要求输入密码 - git clone (using ssh) from dev.azure.com suddenly asks for password Fastlane 设置 - 致命:无法读取“https://”的密码<org> @dev.azure.com':终端提示已禁用</org> - Fastlane setup - fatal: could not read Password for 'https://<org>@dev.azure.com': terminal prompts disabled GitHub / 私有存储库 / SSH:go get/go mod tidy fail,而 ZBA9F11ECC3497D999Z5 克隆正在工作 - GitHub / private repository / SSH: go get/go mod tidy fail, while git clone is working `ssh:连接到主机 ssh.dev.azure.com 端口 22:连接超时`错误 - `ssh: connect to host ssh.dev.azure.com port 22: Connection timed out` error 为什么 GO mod tidy 不适用于 bitbucket - Why does GO mod tidy not work with bitbucket 运行命令npm run dev时出错 - Error while running the command npm run dev 致命:无法连接到 github.com: github.com[0: 140.82.121.4]: errno=未知错误 - fatal: unable to connect to github.com: github.com[0: 140.82.121.4]: errno=Unknown error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM