• 카테고리

    질문 & 답변
  • 세부 분야

    데브옵스 · 인프라

  • 해결 여부

    미해결

소스코드관리>Git>Repository URL 입력시 returned status code 128: 에러

22.11.11 18:44 작성 조회수 5.14k

0

안녕하세요 강사님! 소스코드관리>Git>Repository URL을 입력하면

Failed to connect to repository : Command "git ls-remote -h https://github.com/joneconsulting/cicd-web-project HEAD" returned status code 128:
stdout:
stderr: error:  while accessing
https://github.com/joneconsulting/cicd-web-project/info/refs

fatal
: HTTP request failed

위와 같은 메세지가 나옵니다..

구글링 해보았으나, 해결이 되고 있지 않습니다.

빌드시 콘솔로그는 다음과같습니다.

Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/Spring-Maven-jenkins-test-01
The recommended git tool is: NONE
No credentials specified
 > git rev-parse --resolve-git-dir /var/lib/jenkins/workspace/Spring-Maven-jenkins-test-01/.git # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://github.com/joneconsulting/cicd-web-project # timeout=10
Fetching upstream changes from https://github.com/joneconsulting/cicd-web-project
 > git --version # timeout=10
 > git --version # 'git version 1.7.1'
 > git fetch --tags --progress https://github.com/joneconsulting/cicd-web-project +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://github.com/joneconsulting/cicd-web-project
	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:1006)
	at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1248)
	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1312)
	at hudson.scm.SCM.checkout(SCM.java:540)
	at hudson.model.AbstractProject.checkout(AbstractProject.java:1217)
	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:647)
	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:519)
	at hudson.model.Run.execute(Run.java:1897)
	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
	at hudson.model.ResourceController.execute(ResourceController.java:101)
	at hudson.model.Executor.run(Executor.java:442)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress https://github.com/joneconsulting/cicd-web-project +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: error:  while accessing https://github.com/joneconsulting/cicd-web-project/info/refs

fatal: HTTP request failed

	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2736)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2111)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:87)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:623)
	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:1004)
	... 11 more
ERROR: Error fetching remote repo 'origin'
Finished: FAILURE

 

혹시 짐작가시는 원인이 있으실까요?

답변 2

·

답변을 작성해보세요.

0

이병욱님의 프로필

이병욱

질문자

2022.11.15

감사합니다 강사님

덕분에 해결되었습니다.

원인은 저의 jenkins가 설치된 centOS 6.9 버전에 설치되어있는데 git의 버전이 1.7.1로 낮아 발생한 문제 였습니다.

아래 첨부한 url 보고 해결하였습니다.

git의 버전: 1.7.1 -> 2.31.1

(centOS 6.x 는 여러모로 yum 이 작동을 잘 하지 않더라구요 ㅠㅠ )

감사합니다.

https://www.deok.me/entry/CentOS-6x-%ED%98%B9%EC%9D%80-7x-%EC%97%90%EC%84%9C-git-%EC%82%AC%EC%9A%A9%EC%8B%9C-fatal-HTTP-request-failed-%EC%97%90%EB%9F%AC-%EC%B2%98%EB%A6%AC-%EB%B0%A9%EB%B2%95

0

안녕하세요, 이도원입니다.

말씀하신 Github repository를 다시 확인하였을 때 이상은 없는 것 같습니다. 새로운 프로젝트로 젠킨스에서 실행할 때에도 잘 접속이 되는 것으로 봐서는, 작업하시는 환경에서 github에 접속이 안된 경우일 수도 있을 것 같습니다. 관련 에러는 git repository에 접속이 안되는 오류라고 하는데, 제공하는 소스코드는 public으로 공유한거라 특별한 제한없이 접속 가능합니다. 젠킨스 말고 사용하시는 시스템(Windows 혹은 MacOS 그리고 젠키스가 설치된 도커)에서 git 명령어를 이용하여 직접 소스 코드가 clone 및 fetch가 되는지 확인해 보시면 좋을 것 같습니다. 시스템에는 git이 설치되어 있어야 하기 때문에, 사전에 git이 설치되어 있는지도 확인해 보시기 바랍니다.

Windows, MacOS 혹은 Jenkins가 설치된 Docker)

git clone https://github.com/joneconsulting/cicd-web-project 

 

감사합니다.