JGit S3支持唯一的标准美桶?标准、JGit

2023-09-11 09:54:25 作者:烟酒为伴

难道possbile使用除了美国标准的其他地方的S3桶与JGit(即通过配置文件等),还是我做错了什么吗?

如果我尝试使用S3桶JGit位于欧盟,jgit抛出一个错误

   - > jgit起源推主
计数对象:3
查找来源:100%(3/3)
获取尺寸:100%(2/2)
玉米pressing对象:100%(1/1)
写对象:100%(3/3)
显示java.lang.NullPointerException
    在org.eclipse.jgit.transport.AmazonS3.error(AmazonS3.java:518)
    在org.eclipse.jgit.transport.AmazonS3.putImpl(AmazonS3.java:505)
        ...
 

但是,当我尝试使用位于美国标准的水桶,然后一切工作正常。

   - >混帐推起源主
计数对象:3
查找来源:100%(3/3)
获取尺寸:100%(2/2)
玉米pressing对象:100%(1/1)
写对象:100%(3/3)
放包-132548a..idx:100%(1/1)
亚马逊-S3://.jgit@usreponame/chef-receipes.git
 * [新分支]大师 - >主
 
乐S3美国发布 传闻的双镜头乐Dual 3并未出现

解决方案

NullPointerException异常发生,因为在JGit的一个错误。该女将S3 API返回一个code既不是200或500,并JGit试图从连接读取错误流,而不是防范空错误流。

我已经推了建议修复此问题这里。

在此更改应用的实际响应code应该出现在异常消息,希望这将使它清楚为什么它是失败的。

Is it possbile to use other locations besides US-standard for S3 buckets with JGit (ie. through the config file etc.) or am I doing something wrong here?

If I try to use a S3 bucket with JGit that is located in EU, jgit throws an error

-> jgit push origin master
Counting objects:       3
Finding sources:        100% (3/3)
Getting sizes:          100% (2/2)
Compressing objects:    100% (1/1)
Writing objects:        100% (3/3)
java.lang.NullPointerException
    at org.eclipse.jgit.transport.AmazonS3.error(AmazonS3.java:518)
    at org.eclipse.jgit.transport.AmazonS3.putImpl(AmazonS3.java:505)
        ...

But when I try to use a bucket that is located in US-Standard, then everything works fine.

-> git push origin master
Counting objects:       3
Finding sources:        100% (3/3)
Getting sizes:          100% (2/2)
Compressing objects:    100% (1/1)
Writing objects:        100% (3/3)
Put pack-132548a..idx:  100% (1/1)
To amazon-s3://.jgit@usreponame/chef-receipes.git
 * [new branch]      master -> master

解决方案

The NullPointerException is occurring because of a bug in JGit. The Amazone S3 API is returning a code that is neither a 200 or a 500 and JGit is trying to read the error stream from the connection and is not guarding against a null error stream.

I have pushed a proposed fix for this issue here.

Once this change is applied the actual response code should appear in the exception message which will hopefully make it clear why it is failing.

 
精彩推荐
图片推荐