我正在使用jgit使用S3存储桶来存储我的存储库,如本stackoverflow post中所述。我可以毫无问题地将一个小型存储库(〜2 GB)推送到此S3。当我尝试推送更大的存储库(约40 GB)时,出现以下错误:
Caused by: org.eclipse.jgit.errors.TransportException: amazon-s3://.jgit@example-repo/s3.git: cannot store objects
是造成此问题的原因是我的存储库大小,还是S3不喜欢的某种文件类型?我使用this post中所述的方法更改了.jgit属性文件,但仍然收到错误。
其他信息:
我的S3存储桶位于美国东部(弗吉尼亚北部)地区。
我的远程存储库配置如下:
amazon-s3://.jgit@example-repo/s3.git
.jgit属性文件:
accesskey: <my access key>
secretkey: <my secret key>
acl: private
domain: s3.us-east-1.amazonaws.com
此jgit push有效(回购大小为1 gb):
$ jgit push s3 master
Counting objects: 3
Finding sources: 100% (3/3)
Getting sizes: 100% (2/2)
Compressing objects: 100% (34/34)
Writing objects: 100% (3/3)
Put pack-5ef803f..idx: 100% (1/1)
To amazon-s3://.jgit@example-repo/s3.git
* [new branch] master -> master
这是失败的推送的完整输出(40 gb)
$ jgit push s3 master
Counting objects: 1251
Finding sources: 100% (1251/1251)
Getting sizes: 100% (1245/1245)
Compressing objects: 99% (673507/673520)
Writing objects: 100% (1251/1251)
Put pack-d85b1f0..pack: 0% ( 6064/35268928)
org.eclipse.jgit.api.errors.TransportException: amazon-s3://.jgit@example-repo/s3.git: cannot store objects
at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:180)
at org.eclipse.jgit.pgm.Push.run(Push.java:137)
at org.eclipse.jgit.pgm.TextBuiltin.execute(TextBuiltin.java:228)
at org.eclipse.jgit.pgm.Main.execute(Main.java:288)
at org.eclipse.jgit.pgm.Main.run(Main.java:176)
at org.eclipse.jgit.pgm.Main.main(Main.java:148)
Caused by: org.eclipse.jgit.errors.TransportException: amazon-s3://.jgit@example-repo/s3.git: cannot store objects
at org.eclipse.jgit.transport.WalkPushConnection.sendpack(WalkPushConnection.java:294)
at org.eclipse.jgit.transport.WalkPushConnection.push(WalkPushConnection.java:179)
at org.eclipse.jgit.transport.PushProcess.execute(PushProcess.java:172)
at org.eclipse.jgit.transport.Transport.push(Transport.java:1346)
at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:170)
... 5 more
Caused by: java.io.IOException: Error writing request body to server
at java.base/sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:3587)
at java.base/sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3570)
at org.eclipse.jgit.util.TemporaryBuffer$LocalFile.writeTo(TemporaryBuffer.java:509)
at org.eclipse.jgit.transport.AmazonS3.putImpl(AmazonS3.java:504)
at org.eclipse.jgit.transport.AmazonS3$1.close(AmazonS3.java:474)
at java.base/java.io.FilterOutputStream.close(FilterOutputStream.java:188)
at java.base/java.io.FilterOutputStream.close(FilterOutputStream.java:188)
at org.eclipse.jgit.transport.WalkPushConnection.sendpack(WalkPushConnection.java:274)
... 9 more
Suppressed: java.io.IOException: insufficient data written
at java.base/sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.close(HttpURLConnection.java:3609)
at org.eclipse.jgit.transport.AmazonS3.putImpl(AmazonS3.java:505)
... 13 more