首页 > 其他分享 >golang导入私有仓库报错:“server response: not found:xxx: invalid version: git ls-remote -q origin in xxx“

golang导入私有仓库报错:“server response: not found:xxx: invalid version: git ls-remote -q origin in xxx“

时间:2023-06-08 10:11:09浏览次数:53  
标签:origin xxx gitlab devops git 报错 go com

1.问题:go get导入私有仓库报错

➜   go get "devops.gitlab.xxx.com/test/kafka-utils"
go: devops.gitlab.xxx.com/test/[email protected]: verifying go.mod: devops.gitlab.xxx.com/testo/[email protected]/go.mod: reading https://goproxy.cn/sumdb/sum.golang.org/lookup/devops.gitlab.xxx.com/test/[email protected]: 404 Not Found
        server response:
        not found: devops.gitlab.xxx.com/test/[email protected]: invalid version: git ls-remote -q origin in /tmp/gopath/pkg/mod/cache/vcs/4eca6870c5eba21f85d126a33da76e0445c3741603369eb6c7037cbbb88e9a16: exit status 128:
                fatal: could not read Username for 'https://devops.gitlab.xxx.com': terminal prompts disabled
        Confirm the import path was entered correctly.
        If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.

2.尝试过但不生效的方法

首先,已经确认在gitlab上设置过ssh自己设备的public key。

未生效的方法:(这个方法网上给出的最多,但是对我不适用)

git config --global url."ssh://[email protected]".insteadof "https://devops.gitlab.xxx.com"

3.生效的方法

将GOPRIVATE改为私有仓库的域名

go env -w GOPRIVATE="devops.gitlab.xxx.com"

 

标签:origin,xxx,gitlab,devops,git,报错,go,com
From: https://www.cnblogs.com/dabanya/p/17465384.html

相关文章

  • Three.js系列-报错export ‘Geometry‘ (imported as ‘THREE‘) was not found in ‘
    今天遇到报错export'Geometry'(importedas'THREE')wasnotfoundin'three'port'Geometry'(importedas'THREE')wasnotfoundin'three'(possibleexports:ACESFilmicToneMapping,AddEquation,AddOpe......
  • kanzi的安卓工程报错解决办法:Error: Could not find or access Kanzi's Gradle plugin
    这是因为安卓里配置的环境变量不对。需要检查下述文件的路径是否真实存在,以及和使用的版本是否匹配  ......
  • QA|重写了元素定位后报错xx object has no attribute 'find_element'|网页计算器自动
    代码如下:1#basepage.py23fromseleniumimportwebdriver456classBasePage():7"""8基类用作初始化封装常用操作9"""1011def__init__(self):12"""13初始化driver14......
  • 报错 ImportError: urllib3 v2.0 only
     麻烦您到服务器命令行执行下面命令修复下btpipinstall-Irequests==2.27bt1  您好,该问题是requests模块库与OpenSSL模块问题导致的,您那边可到服务器命令行下使用下面命令尝试解决。修复requests模块命令:btpipinstallrequests-U  解决问题帖子......
  • rancher 卸载后重装报错
    报错信息kubectlcreatenamespacecattle-systemErrorfromserver(InternalError):Internalerroroccurred:failedcallingwebhook"rancher.cattle.io.namespaces.create-non-kubesystem":failedtocallwebhook:Post"https://rancher-webhook.cattl......
  • 记录一次POI导出文件超时报错的问题
    后端日志错误信息![在这里插入图片描述](https://img-blog.csdnimg.cn/20200622165735646.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxODM3OTkzNzAy,size_16,color_FFFFFF,t_70)解决办法在nginx的location中......
  • Nginx出现403 forbidden (13: Permission denied)报错的解决办法
    一、由于启动用户和nginx工作用户不一致所致1、将nginx.config的user改为和启动用户一致,命令:viconf/nginx.conf二、缺少index.html或者index.php文件,就是配置文件中indexindex.htmlindex.htm这行中的指定的文件。server{listen80;server_namelocalhost;indexindex.p......
  • mysql 超大文件导入 超时报错
    亲测:只要导入出错就把如下语句执行就可以了。至今屡试不爽。setglobalmax_allowed_packet=10000000000; setglobalnet_buffer_length=1000000; SETGLOBAL interactive_timeout=288000000;SETGLOBAL wait_timeout=28800000;以上语句的解释:–max_allowed_packet=X......
  • python打包后,执行报错:NameError: name ‘exit‘ is not defined
    try:file_name=os.path.basename(src)file_size=os.stat(src).st_sizeexceptException:print("源文件不存在:",src)exit()在ide使用中没有问题,但是封装成应用程序时就出现问题: NameError:name'exit'isnotdef......
  • Failed to load resource: xxx 504 (Gateway Time-out)
    问题描述:上传文件js,报错如下:Failedtoloadresource:theserverrespondedwithastatusof504(GatewayTime-out) 问题原因:网络超时 解决办法:nginx配置 proxy_read_timeout150;location/{proxy_read_timeout150;//单位为秒}就是把超时时间调长一点,保证......