Git错误401通过哈德森的git插件访问它 [英] Git error 401 while accessing it via hudson's git plugin

查看:104
本文介绍了Git错误401通过哈德森的git插件访问它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在服务器上配置了hudson,并使用从我的git存储库中获取的代码。
实际上,我已经正确设置了环境,并且所有通过哈德森的构建都成功了,但是最近我从github.com更改了我的git密码,现在所有构建都失败了,导致401错误,我知道它是由于密码更改。任何人都可以告诉我如何通过git插件更改Hudson中的密码,以便验证通过。
这是我得到的错误

 错误:从原点/原点取回问题 - 可能无法使用。继续无论如何
错误:(底层报告):执行命令时出错:/ usr / bin / git fetch -t
https://github.com/xxx/xxx + refs / heads / *:refs / remotes / origin / *

命令/ usr / bin / git fetch -t https://github.com/xxx/xxx + refs / heads / *:refs

/ remotes / origin / *返回状态码128:错误:请求的URL返回错误:401

访问https://github.com/xxx/xxx/info/refs

致命错误:HTTP请求失败

错误:无法从任何存储库中获取
致命错误:无法从任何存储库中获取

任何想法

解决方案

在GitHub设置,提到:


有些工具无需SSH即可连接到GitHub。要正确使用这些工具,您需要查找和配置API令牌。 --global github.user用户名
$ git config --global github.token 0123456789yourf0123456789token




注意 如果您更改过GitHub密码,则会创建一个新的令牌并需要更新。 b

尽管您的ssh认证应该保持不变,但请确保Hudson用户使用的全局git配置已更新了一些github设置。






After 90分钟的讨论,结果发现可能受到密码更改影响的其他文件是 .netrc 文件

请参阅 git克隆通过https 401错误,而不是要求用户名或密码


I have hudson configured on my server and i am using code fetched from my git repository. Actually , i had set up the environment correctly and all the builds via Hudson were successful but recently i changed my git password from github.com and now all the builds fail giving a 401 error , I know its due to password change . Can anyone tell me how to change the password in Hudson via the git plugin so that the authentication passes. Here is the error I am getting

ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
ERROR:  (Underlying report) : Error performing command: /usr/bin/git fetch -t 
https://github.com/xxx/xxx +refs/heads/*:refs/remotes/origin/*

Command "/usr/bin/git fetch -t https://github.com/xxx/xxx +refs/heads/*:refs

/remotes/origin/*" returned status code 128: error: The requested URL returned error: 401 

while accessing https://github.com/xxx/xxx/info/refs

fatal: HTTP request failed

ERROR: Could not fetch from any repository
FATAL: Could not fetch from any repository

Any ideas ??

解决方案

In the GitHub setup, it is mentioned:

Some tools connect to GitHub without SSH. To use these tools properly you need to find and configure your API Token.

$ git config --global github.user username
$ git config --global github.token 0123456789yourf0123456789token

Note If you ever change your GitHub password, a new token will be created and will need to be updated.

Even though your ssh authentications should be unchanged, make sure the global git config used by the Hudson user has some github settings updated.


After 90 minutes of discussion, it turned out that the other file that can be impacted by a password change is your .netrc file.
See "git clone over https 401 error and not asking for username or password"

这篇关于Git错误401通过哈德森的git插件访问它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆