英文:
Jenkins Bitbucket Credentials Cannot read repo
问题
Jenkins Bitbucket Credentials Cannot read repo
我想通过Git从Jenkins读取Bitbucket仓库。
我在Maven集成项目中提供了Bitbucket的URL,并提供了我的用户名和密码,但不幸的是它无法读取仓库。我不知道出了什么问题。有人可以为我解惑吗?
错误信息是:
连接到仓库失败:
命令"C:\Program Files\Git\bin\git.exe ls-remote -h -- https://nicholasWongKC@bitbucket.org/mediaprimadigital/butv3-automation-testing.git HEAD" 返回
状态码128:stdout: stderr: 致命错误:无法提示,因为已禁用用户交互。
远程:由于登录凭据不正确或方法不正确而登录失败。
远程:如果您不确定要使用哪个登录详细信息或登录方法,请访问:
远程:https://support.atlassian.com/bitbucket-cloud/docs/log-into-or-connect-to-bitbucket-cl
如何解决这个错误?我在Jenkins中是完全初学者,请帮助我。
附注:我已经使用了Jenkins的凭据助手,即用户名和密码,但仍然弹出错误。
我尝试使用我的个人GitHub仓库,它完美运行,但当我使用公司的Bitbucket仓库时,出现错误。
我尝试过使用Bitbucket个人访问令牌,但它不显示。
我可以知道出了什么问题吗?
英文:
Jenkins Bitbucket Credentials Cannot read repo
I want to read the Bitbucket repo from Jenkins through Git.
I did provide the Bitbucket URL in Maven integration project and provide my username and password to it, but unfortunately it cannot read the repo. I don't know what wrong with it. Anyone can enlighten me.
The Error is
Failed to connect to repository :
Command "C:\Program Files\Git\bin\git.exe ls-remote -h -- https://nicholasWongKC@bitbucket.org/mediaprimadigital/butv3-automation-testing.git HEAD" returned
status code 128: stdout: stderr: fatal: Cannot prompt because user interactivity has been disabled.
remote: Login failed due to incorrect login credentials or method.
remote: If you are unsure of which login details or login method to use, visit:
remote: https://support.atlassian.com/bitbucket-cloud/docs/log-into-or-connect-to-bitbucket-cl
How to solve this error? I am totally a beginner in Jenkins. Please help me.
PS: I have used the Jenkins credential helper which is username and password but still there is error pop out.
I tried with my personal GitHub repo, and it is working perfectly, but when I am using company Bitbucket repo, it displays error.
I had tried with Bitbucket Personal Access Token, but it doesn't display it.
May I know what wrong with it?
答案1
得分: 1
在Jenkins任务的“源代码控制”配置中,最好仅使用URL而不带身份验证:
https://bitbucket.org/mediaprimadigital/butv3-automation-testing.git
然后确保为该存储库选择正确的凭据:
您将首先定义该凭据:
请使用凭据的用户名和令牌(PAT),而不是密码。
这将在您的HTTPS URL中注入username:token
,确保Git不会在URL中只有用户名时尝试询问密码,就像以前那样。
英文:
In a Jenkins job "source control" configuration, it is best to use the URL alone, without authentication:
https://bitbucket.org/mediaprimadigital/butv3-automation-testing.git
Then make sure to select the right credential for this repository:
You will have defined that credential first:
Do use the credential username and token (PAT) not password.
That should inject both username:token
in your HTTPS URL, making sure Git will not try to ask for your password as it did when only the username was in the URL.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论