development

Github 푸시 오류 : RPC 실패;

big-blog 2020. 7. 14. 07:42
반응형

Github 푸시 오류 : RPC 실패; 결과 = 22, HTTP 코드 = 413


지금 Github과 관련된 어리석은 문제. 적절한 크기의 변경 (최대 120MB)이 있는데, 푸시하려고 할 때 이런 일이 발생합니다.

error: RPC failed; result=22, HTTP code = 413
fatal: The remote end hung up unexpectedly 
fatal: The remote end hung up unexpectedly

나는 이미 했어

git config http.postBuffer 524288000따라서 문제가되지 않는 것 같습니다. 뭐가 될수 있었는지?


오류 413이 발생하면 문제는 git이 아니라 웹 서버에 있습니다. 큰 업로드 파일을 차단하는 것은 웹 서버입니다.

nginx를위한 솔루션

http 블록에 로드 nginx.conf하고 추가 client_max_body_size 50m;(필요에 따라 값 변경)하십시오.

실행하여 새 구성을 수락하도록 nginx를 다시로드 sudo service nginx reload하고 http를 통해 커밋을 다시 푸시하십시오.

아파치 솔루션

당신에 httpd.conf추가 LimitRequestBody 52428800, 안쪽 (필요에 값 변경) <Directory />블록을. 이렇게하면 전체 서버 파일 시스템, 단일 가상 호스트 또는 디렉토리의 요청을 제한 할 수 있습니다.

이게 도움이 되길 바란다.


나는 그것을 알아!!! 물론 나는 포스트를 친 직후에 것입니다!

리포지토리에 HTTPS URL을 사용하도록 설정하고 SSH 주소로 변경했으며 모든 것이 완벽하게 작동하기 시작했습니다.


https-> git @ ...에서 원격 URL을 변경하는 명령은 다음과 같습니다.

git remote set-url origin git@github.com:GitUserName/GitRepoName.git

여기서 origin은 내 리모컨의 이름입니다 (git remote 및 나오는 것은 origin입니다).


나는 같은 문제가 있었지만 리버스 프록시를 사용하고있었습니다.

그래서 설정해야했습니다

client_max_body_size 50m; 

두 구성 파일 내부 :

  • gitlab nginx 웹 서버에서 (이전 답변에서 언급했듯이)
  • 전용 서버에서 호스팅되는 nginx 리버스 프록시에서도 마찬가지입니다.

자식 URL에 이미 "HTTPS //"가 있었지만이 오류가 발생했습니다.

내가 한 것은 push와 함께 옵션 -u를 추가하는 것이 었습니다.

git push -u origin master


IIS 7사용 하여 git http/ httpsendpoint 를 호스팅하는 사람들은 :

을 늘려야합니다 uploadReadAheadSize.

시작 인터넷 정보 서비스 (IIS) 관리자

  1. 서버 필드를 펼치십시오

  2. 사이트 확장

  3. 수정하려는 사이트를 선택하십시오.

  4. 기능 섹션에서 두 번 클릭하십시오. Configuration Editor

  5. 아래에서 Section선택 :system.webServer > serverRuntime

  6. 수정 uploadReadAheadSize섹션 (값은 사이 여야합니다 02147483647.)

  7. 딸깍 하는 소리 Apply

  8. 웹 사이트를 다시 시작하십시오


큰 크기의 변경 사항을 푸시하는 동안이 문제가 발생하면 터미널에서 아래 명령을 실행하십시오.

git config --global http.postBuffer 157286400

자세한 내용은 이것을 참조하십시오.


I got this problem when I try to clone a git repo in Linux machine.

the following URL is working for me in windows

http://swamy@git.swamy.com/scm/project/swamy-main.git

whereas the following URL works in Linux machine and it has https in URL

https://swamy@git.swamy.com/scm/project/swamy-main.git

https clone of gists fails (ssh works, see below):

12:00 jean@laptop:~/tmp$ GIT_CURL_VERBOSE=1 git clone https://gist.github.com/123456.git username
Initialized empty Git repository in /home/jean/tmp/username/.git/
* Couldn't find host gist.github.com in the .netrc file; using defaults
* About to connect() to gist.github.com port 443 (#0)
*   Trying 192.30.252.142... * Connected to gist.github.com (192.30.252.142) port 443 (#0)
* found 141 certificates in /etc/ssl/certs/ca-certificates.crt
*        server certificate verification OK
*        common name: *.github.com (matched)
*        server certificate expiration date OK
*        server certificate activation date OK
*        certificate public key: RSA
*        certificate version: #3
*        subject: C=US,ST=California,L=San Francisco,O=GitHub\, Inc.,CN=*.github.com
*        start date: Mon, 30 Apr 2012 00:00:00 GMT
*        expire date: Wed, 09 Jul 2014 12:00:00 GMT
*        issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert High Assurance CA-3
*        compression: NULL
*        cipher: ARCFOUR-128
*        MAC: SHA1
> GET /123456.git/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.7.1
Host: gist.github.com
Accept: */*
Pragma: no-cache

< HTTP/1.1 301 Moved Permanently
< Server: GitHub.com
< Date: Fri, 01 Nov 2013 05:00:51 GMT
< Content-Type: text/html
< Content-Length: 178
< Location: https://gist.github.com/gist/123456.git/info/refs?service=git-upload-pack
< Vary: Accept-Encoding
<
* Ignoring the response-body
* Expire cleared
* Connection #0 to host gist.github.com left intact
* Issue another request to this URL: 'https://gist.github.com/gist/123456.git/info/refs?service=git-upload-pack'
* Couldn't find host gist.github.com in the .netrc file; using defaults
* Re-using existing connection! (#0) with host gist.github.com
* Connected to gist.github.com (192.30.252.142) port 443 (#0)
> GET /gist/123456.git/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.7.1
Host: gist.github.com
Accept: */*
Pragma: no-cache

< HTTP/1.1 200 OK
< Server: GitHub.com
< Date: Fri, 01 Nov 2013 05:00:52 GMT
< Content-Type: application/x-git-upload-pack-advertisement
< Transfer-Encoding: chunked
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate
< Vary: Accept-Encoding
<
* Connection #0 to host gist.github.com left intact
* Couldn't find host gist.github.com in the .netrc file; using defaults
* About to connect() to gist.github.com port 443 (#0)
*   Trying 192.30.252.142... * connected
* Connected to gist.github.com (192.30.252.142) port 443 (#0)
* found 141 certificates in /etc/ssl/certs/ca-certificates.crt
* SSL re-using session ID
*        server certificate verification OK
*        common name: *.github.com (matched)
*        server certificate expiration date OK
*        server certificate activation date OK
*        certificate public key: RSA
*        certificate version: #3
*        subject: C=US,ST=California,L=San Francisco,O=GitHub\, Inc.,CN=*.github.com
*        start date: Mon, 30 Apr 2012 00:00:00 GMT
*        expire date: Wed, 09 Jul 2014 12:00:00 GMT
*        issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert High Assurance CA-3
*        compression: NULL
*        cipher: ARCFOUR-128
*        MAC: SHA1
> POST /123456.git/git-upload-pack HTTP/1.1
User-Agent: git/1.7.1
Host: gist.github.com
Accept-Encoding: deflate, gzip
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result
Content-Length: 116

< HTTP/1.1 301 Moved Permanently
< Server: GitHub.com
< Date: Fri, 01 Nov 2013 05:00:53 GMT
< Content-Type: text/html
< Content-Length: 178
< Location: https://gist.github.com/gist/123456.git/git-upload-pack
< Vary: Accept-Encoding
<
* Ignoring the response-body
* Connection #0 to host gist.github.com left intact
* Issue another request to this URL: 'https://gist.github.com/gist/123456.git/git-upload-pack'
* Violate RFC 2616/10.3.2 and switch from POST to GET
* Couldn't find host gist.github.com in the .netrc file; using defaults
* Re-using existing connection! (#0) with host gist.github.com
* Connected to gist.github.com (192.30.252.142) port 443 (#0)
> GET /gist/123456.git/git-upload-pack HTTP/1.1
User-Agent: git/1.7.1
Host: gist.github.com
Accept-Encoding: deflate, gzip
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result

* The requested URL returned error: 400
* Closing connection #0
error: RPC failed; result=22, HTTP code = 400

This works: git clone git@gist.github.com:123456.git


I had this error (error: RPC failed; result=22, HTTP code = 413) when I tried to push my initial commit to a new BitBucket repository. The error occurred for me because the BitBucket repo had no master branch. If you are using SourceTree you can create a master branch on the origin by pressing the Git Flow button.


The error occurs in 'libcurl', which is the underlying protocol for https upload. Solution is to somehow updgrade libcurl. To get more details about the error, set GIT_CURL_VERBOSE=1

https://confluence.atlassian.com/pages/viewpage.action?pageId=306348908

Meaning of error, as per libcurl doc: CURLE_HTTP_RETURNED_ERROR (22)

This is returned if CURLOPT_FAILONERROR is set TRUE and the HTTP server returns an error code that is >= 400.

http://curl.haxx.se/libcurl/c/libcurl-errors.html


I had the same issue (on Win XP), I updated the libcurl-4.dll file in my Git bin directory to the SSL version from http://www.paehl.com/open_source/?download=curl_DLL_ONLY.7z (renaming to libcurl4.dll). All working ok now.


Was facing same issue. In my case it was non-compatible GIT versions across multiple users who are accessing(pull/push) same project.

have just updated GIT version and updated the path on Android studio settings and its working fine for me.

Edit -

Git for Windows (1.9.5) having some problem, updating the same may helps.


Was facing the same issue however it got resolved by cleaning up the git repository (Clean untracked files using "git clean").


Need to change remote url to ssh or https

git remote set-url origin git@github.com:laravel/laravel.git

or

git remote set-url origin https://github.com/laravel/laravel.git

Hope, this will help :)


Do you use https links instead of ssh links? Because the https link is limited by the size of the upload of HttpServer (such as Apache, Ngnix), there is no such restriction when using ssh.

Use the following method to switch to the ssh link.

  1. Open terminal.
  2. Switch to your project's working directory.
  3. Get the name of the remote repository
$ git remote -v
origin  https://github.com/[user_name]/[project_name].git (fetch)
origin  https://github.com/[user_name]/[project_name].git (push)
  1. Modify the git address to ssh link.
git remote set-url origin git@github.com:[user_name]/[project_name].git

If you determine the remote repository name, proceed directly to step 4. Now, you can do the push operation happily.


when I used the https url to push to the remote master, I met the same proble, I changed it to the SSH address, and everything resumed working flawlessly.

참고URL : https://stackoverflow.com/questions/7489813/github-push-error-rpc-failed-result-22-http-code-413

반응형