503错误推送到远程 [英] 503 error pushing to remote

查看:934
本文介绍了503错误推送到远程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到推送到Github的503错误:

I am encountering a 503 error pushing to Github:

$ git push github develop
Counting objects: 22, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (22/22), done.
Writing objects: 100% (22/22), 4.16 KiB | 0 bytes/s, done.
Total 22 (delta 16), reused 0 (delta 0)
error: RPC failed; HTTP 503 curl 22 The requested URL returned error: 503 Service Unavailable
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

我检查了他们的状态页面和所有系统运行所以我认为它必须是我的配置。我的 .gitconfig 文件只有我的姓名和电子邮件:

I've checked their status page and "All systems operational" so I'm thinking it must be something with my configuration. My .gitconfig file just have my name and email:

[user]
    name = Bradley Wogsland
    email = <omitted>

(我在这里省略了我的真实电子邮件,但在实际文件中它已存在)。

(I've omitted my real email here but in the actual file it's there).

推荐答案

我遇到了同样的问题并通过将Git缓冲区大小增加到我的仓库的最大单个文件大小来修复它:

I had the same issue and fixed it by increasing the Git buffer size to the largest individual file size of my repo:

git config --global http.postBuffer 157286400

Atferwards,我可以执行推送请求qithout任何问题:

Atferwards, I could execute the push request qithout any problems:

git push

以下是 Bitbucket支持

Git中的智能HTTP协议在POST请求中使用Transfer-Encoding:chunked,当它包含大小超过1MB的打包对象时。

The "Smart HTTP" protocol in Git uses "Transfer-Encoding: chunked" in POST requests when it contains packed objects greater than 1MB in size.

某些代理服务器(如Nginx)不支持此转移e默认情况下编码,请求将在到达Bitbucket Server之前被拒绝。因此,Bitbucket Server日志不会显示任何额外信息。

Some proxy servers, like Nginx, do not support this transfer encoding by default, and the requests will be rejected before they get to Bitbucket Server. Because of this, the Bitbucket Server logs will not show any extra information.

另一个可能的原因是负载均衡器配置错误。

Another possible cause is a load balancer misconfiguration.

http.postBuffer 缓冲区的最大字节数在将数据发布到远程系统时由智能HTTP传输使用。对于大于此缓冲区大小的请求,使用HTTP / 1.1和Transfer-Encoding:chunked来避免在本地创建大量包文件。默认值为1 MiB,足以满足大多数请求。

http.postBuffer Maximum size in bytes of the buffer used by smart HTTP transports when POSTing data to the remote system. For requests larger than this buffer size, HTTP/1.1 and Transfer-Encoding: chunked is used to avoid creating a massive pack file locally. Default is 1 MiB, which is sufficient for most requests.

反向代理上的配置。通常ngnix参数client_max_body_size是一个阻止程序。反向代理也可能具有关闭连接的连接超时(例如,apache中的TimeOut或ProxyTimeout,ngnix中的proxy_read_timeout)。尝试直接推送到Bitbucket Server IP:端口绕过代理。如果这样做,很可能代理服务器导致提前断开连接并需要调整。

Configuration on your reverse proxy. Usually ngnix the parameter client_max_body_size is a blocker. The reverse proxy may also have a connection timeout that's closing the connection (e.g. TimeOut or ProxyTimeout in apache, proxy_read_timeout in ngnix). Try bypassing the proxy by pushing directly to Bitbucket Server IP:port. If this works, it's highly likely that the proxy server is causing the early disconnect and needs to be tuned.

用户正在他的机器上使用出站代理导致问题。

User is using an outbound proxy on his machine that is causing the issue.


  • 将Git缓冲区大小增加到repo的最大单个文件大小:
    git config --global http.postBuffer 157286400

  • Increase the Git buffer size to the largest individual file size of your repo: git config --global http.postBuffer 157286400

请参阅 Git推送失败 - 客户端打算为ngnix反向代理配置发送太大的块体。将此参数增加到您的仓库的最大单个文件大小。

Refer to the resolution of Git push fails - client intended to send too large chunked body for ngnix reverse proxy configuration. Increase this parameter to the largest individual file size of your repo.

按照由于git出站代理无法克隆或拉取

这篇关于503错误推送到远程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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