2

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
Andris
  • 27,649
  • 4
  • 34
  • 38

1 Answers1

5

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.

Kevin Sawicki
  • 3,002
  • 1
  • 20
  • 18
  • The fix for this has been committed to JGit. If you download the latest JGit 2.0 nightlies you should be able to now know the actual response code from S3 that is causing the failure which should help to track down why the issue is happening. – Kevin Sawicki Mar 08 '12 at 17:20