【GitLab】-HTTP 500 curl 22 The requested URL returned error: 500~SSH解决

这篇具有很好参考价值的文章主要介绍了【GitLab】-HTTP 500 curl 22 The requested URL returned error: 500~SSH解决。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

写在前面

  本文主要介绍通过SSH的方式拉取GitLab代码。
rpc failed; http 500 curl 22 the requested url returned error: 500,工作指北,gitlab,ssh,HTTP 500,returnd error,curl 22



一、场景描述

  之前笔者是通过 HTTP + Personal access token 的方式拉取、更新、提交代码的。直到有一天,休了个假。回来之后,发现代码无法拉取,其他同事也遇到同样问题。
报如下错误:

$ git pull
error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500
fatal: the remote end hung up unexpectedly

查询资料,未果。
不知道是不是GitLab服务器端有人做了什么sao操作,还是其他什么原因。网上查询了一些资料,有说是缓存问题,经亲测,也没什么卵用。

// 配置缓存的方式
git config --global http.postBuffer 157286400
https://stackoverflow.com/questions/44780221/git-push-failing-http-500-curl-22-the-requested-url-returned-error-500-internal

后来,经测试,发现通过SSH的方式可以正常拉取代码。如有人发现HTTP 500 具体错误原因的,请评论区指出,感谢~


二、具体步骤

1.环境说明

名称 说明
Windows版本 Win10/X64
IntelliJ IDEA 2019.2

2.生成秘钥

进入用户当前目录, 注意.ssh是隐藏目录

admin@LAPTOP-ROP3B248 MINGW64 ~
$ cd ~/.ssh

输入命令,user@email.com 换成自己邮箱即可,其他的直接默认回车即可。

admin@LAPTOP-ROP3B248 MINGW64 ~/.ssh
$ ssh-keygen -t rsa -b 4096 -C "user@email.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/admin/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/admin/.ssh/id_rsa
Your public key has been saved in /c/Users/admin/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:5P4vWucgzRdv9adk2VJmp+Bt/7S2Q9AMU4KEzmHrBN0 user@email.com
The key's randomart image is:
+---[RSA 4096]----+
|        . +..... |
|       . = E o.  |
|        * o   =  |
|       o =   . o |
|        S   o . *|
|       . + . = Xo|
|        o = + % =|
|         +.= = Bo|
|        ...oo oo*|
+----[SHA256]-----+

// 会生成2个文件
admin@LAPTOP-ROP3B248 MINGW64 ~/.ssh
$ ll
total 8
-rw-r--r-- 1 admin 197121 3389 Nov 13 11:08 id_rsa
-rw-r--r-- 1 admin 197121  747 Nov 13 11:08 id_rsa.pub

3.GitLab添加秘钥

登录GitLab,头像那个位置,点击settings。选择左侧SSH Keys
rpc failed; http 500 curl 22 the requested url returned error: 500,工作指北,gitlab,ssh,HTTP 500,returnd error,curl 22

复制生成的文件 id_rsa.pub(公钥) 文件的内容,粘贴到key中,点击Add key
rpc failed; http 500 curl 22 the requested url returned error: 500,工作指北,gitlab,ssh,HTTP 500,returnd error,curl 22
此时,邮箱会收到邮件。

4.验证SSH方式

将 {git地址} 替换为自己的git地址即可

admin@LAPTOP-ROP3B248 MINGW64 ~/.ssh
$ ssh -T git@{git地址}
The authenticity of host '{git地址}' can't be established.
ED25519 key fingerprint is SHA256:gyiXoXNV3lz8RqbCXnmVBBPW7WxuBVoOxnNbq8TSsUo.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '{git地址}' (ED25519) to the list of known hosts.
Welcome to GitLab, User!

4.更改原有HTTP方式为SSH

更改拉取代码的方式,以IDEA为例,选中项目,右键,Git-》Repository-》Remotes
修改URL由HTTP修改为SSH方式。说明:IDEA版本不同,步骤会有所不同

原有:	http://{git地址}/ace-group/ace-conf-parent.git
修改为:	git@{git地址}:ace-group/ace-conf-parent.git

rpc failed; http 500 curl 22 the requested url returned error: 500,工作指北,gitlab,ssh,HTTP 500,returnd error,curl 22

至此,就又可以愉快地玩耍了~


三、参考资料

gitlab 配置ssh key,通用ssh拉取代码


写在后面

  如果本文内容对您有价值或者有启发的话,欢迎点赞、关注、评论和转发。您的反馈和陪伴将促进我们共同进步和成长。


系列文章

【GitLab】-HTTP Basic: Access denied.remote:You must use a personal access token
【GitLab】-批量克隆更新GibLab项目脚本(Python版本)文章来源地址https://www.toymoban.com/news/detail-775937.html

到了这里,关于【GitLab】-HTTP 500 curl 22 The requested URL returned error: 500~SSH解决的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 执行git操作报错:The requested URL returned error: 500

    因为疫情居家办公了,然后家里面有一个台式机,就使用了台式机,结果想从git仓库重新拉取代码就报错了: 然后从网上找各种解决办法,都不生效,我突然记起自己的git密码重新修改过,修改密码之后没有在台式机上办过公,所以就重新设置了一下git的密码,如下: 使用

    2024年02月11日
    浏览(44)
  • git clone项目报错,The requested URL returned error: 500

    git clone项目报错,The requested URL returned error: 500,如何解决?试试修改电脑中存储的账号密码 有项目权限,至少在网页上能通过链接访问当前Git内容 曾在当前电脑登录过git账号 满足以上两种情况,但执行git clone时却报错The requested URL returned error: 500 在Windows系统中试试以下方法

    2024年02月12日
    浏览(41)
  • 解决 git 出现 unable to access ‘ ’The requested URL returned error 500 问题

    问题 在项目中 fetch、push 的时候,出现下面这个问题: 网上很多说时文件太大、代理、权限什么的,可能有人是这样吧,但是没能解决我这问题。 解决办法 最后还是看到一篇博客说是账号问题,想了下是不是密码错了,去登录一下直接的账号,发现还真有可能错了,而且这

    2024年02月11日
    浏览(39)
  • git 报错The requested URL returned error: 403

    目录 修改git 配置信息用户名和邮箱(无效) 修改当前项目下的git文件夹中的config(无效) 清除缓存(有效) 优化:每次拉取代码都要输入用户名和密码 今日更换电脑,从云效平台拉取代码报错。 原因:自己的账号和电脑上之前的Git账户有冲突,需清除缓存 主要参考:解

    2024年02月06日
    浏览(41)
  • 问题解决——IDEA git 操作报错:The requested URL returned error: 403

    使用的命令有:git pull、git push。 报错内容: remote: [session-424579a9] Access denied fatal: unable to access \\\'https://gitee.com/xxxxxx.git/\\\': The requested URL returned error: 403 查看 git 的用户名、邮箱和密码,命令如下; 如果不对就修改成你期望的 git 用户名、邮箱和密码; 问题依然没有解决的话,那

    2024年02月06日
    浏览(40)
  • 解决使用sourcetree推送(git push)代码提示 The requested URL returned error: 403 问题

    我使用sourcetree push 代码,他会显示403,也就是我当前的 push 是失败的,但是我直接在终端进行 git push origin HEAD:dev 它又是成功的! 终端能成功可能是因为直接我配置过 token ,它和 sourcetree 的区别可能就是出现在账号问题上(猜测 所以我的解决办法是将当前本地仓库的账号换

    2024年02月12日
    浏览(41)
  • git push 报错unable to access https://gitee.com/****/***.git/ : The requested URL returned error:403

    对于git小白来说,第一次使用git总会报各种稀奇古怪的错误。 最近的操作git的时候,就报了如上的错误fatal: unable to access  https://gitee.com/****/***.git/ : The requested URL returned error:403 对于这样的错误无非就是无权访问的问题, 解决的方法我试过的只有两种 : 1 .自己的git账户本身

    2023年04月08日
    浏览(35)
  • 解决Gitee或者Github出现Access denied fatal: unable to access,The requested URL returned error: 403

    从github或者gitee码云拉取其他人的私有项目时,报以下错误 要把某个项目push到Gitee码云或者Github上,已经设置了仓库地址,在最后一步推送代码时直接报错。 因为报的错是没有访问权限,只要本地使用过Github或者Gitee等git服务,电脑上就会存储git的账号和密码凭据.这样下次

    2024年01月25日
    浏览(39)
  • git push报错:fatal: unable to access ‘https://github.com/***/‘:The requested URL returned error: 403

    又是被自己菜死的一天。 使用git push命令后,报错信息如下: remote: Permission to *** denied to . fatal: unable to access \\\'https://github.com/ /\\\': The requested URL returned error: 403 当然在git push 之前生成teken是必要的,在设置里面开发者设置中Personal access tokens生成就可以了,注意生成之后需要复制

    2024年02月16日
    浏览(39)
  • git push提交代码到服务器报remote: [session-xx] Access denie The requested URL returned error: 403

    操作: 执行 git push -u origin master ,我想把commit的代码直接提交到远程的仓库,哪知道直接给我一个报错: remote: [session-xxx] Access denied fatal: unable to access \\\'https://gitee.com/xxx/xxx.git/\\\': The requested URL returned error: 403 原因: 这是账号不一致 可以通过查询一下当前用户: cat ~/.gitconfig

    2024年02月11日
    浏览(36)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包