Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Custom JGit endpoint for Amazon S3(Related to open-source tool S3 Server)
Custom JGit endpoint for Amazon S3 [message #1763594] Wed, 17 May 2017 17:18 Go to next message
Laure V is currently offline Laure VFriend
Messages: 1
Registered: May 2017
Junior Member
Hello there,

I've been using JGit in the past to push my git repos to Amazon S3 and it has worked marvels.
Recently, I stumbled upon a pretty cool open source project called s3 server (see and ) that implements an S3 API on any private storage you have. I've been using it for a while, and now am trying to combine it with Jgit and it's proving tough. I think my problem is the syntax for git remote add doesn't allow to specify an endpoint for S3 (I need to change it to http://localhost:8000 )

So I've a bucket called "mybucket", a git repo I initializaed called "~/mygitrepo", and my jgit credentials are in ~/.jgit_s3_public. These are the commands I ran:

$> cd mygitrepo
$> echo "toto" > ./test.txt
$> git add test.txt
$> git commit -m "test push to S3"
$> git remote add s3server amazon-s3://.jgit_s3_public@mybucket/mygitrepo.git

# and then this is where it fails:
$> jgit push s3server refs/heads/master
org.eclipse.jgit.api.errors.TransportException: amazon-s3://mybucket/mygitrepo.git/objects: error in packed-refs
	at org.eclipse.jgit.pgm.TextBuiltin.execute(
	at org.eclipse.jgit.pgm.Main.execute(
	at org.eclipse.jgit.pgm.Main.main(
Caused by: org.eclipse.jgit.errors.TransportException: amazon-s3://mybucket/mygitrepo.git/objects: error in packed-refs
	at org.eclipse.jgit.transport.WalkRemoteObjectDatabase.readPackedRefs(
	at org.eclipse.jgit.transport.TransportAmazonS3$DatabaseS3.readAdvertisedRefs(
	at org.eclipse.jgit.transport.TransportAmazonS3.openPush(
	at org.eclipse.jgit.transport.PushProcess.execute(
	at org.eclipse.jgit.transport.Transport.push(
	... 5 more
Caused by: Reading of 'mygitrepo.git/packed-refs' failed: 403 Forbidden
	at org.eclipse.jgit.transport.AmazonS3.error(
	at org.eclipse.jgit.transport.AmazonS3.get(
	at org.eclipse.jgit.transport.TransportAmazonS3$
	at org.eclipse.jgit.transport.WalkRemoteObjectDatabase.openReader(
	at org.eclipse.jgit.transport.WalkRemoteObjectDatabase.readPackedRefs(
	... 10 more
Caused by: 
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidAccessKeyId</Code><Message>The AWS Access Key Id you provided does not exist in our records.</Message><AWSAccessKeyId>accessKey1</AWSAccessKeyId><RequestId>D309612F2EB6D893</RequestId><HostId>o5nPBWZjC7HmRoIXDycJU0LbpTizDy2CNMvqPPuQNiQxOrZeWCD2rkS0Xk8BygDl/5w9zZEv9rY=</HostId></Error>
	at org.eclipse.jgit.transport.AmazonS3.error(

Is there a known way to configure the endpoint, or would that need a PR? If so, is there a team/person to get in touch with to design?

Re: Custom JGit endpoint for Amazon S3 [message #1765085 is a reply to message #1763594] Tue, 06 June 2017 13:04 Go to previous message
Daniel Holz is currently offline Daniel HolzFriend
Messages: 3
Registered: April 2017
Junior Member
I think I understand where this is coming from: org.eclipse.jgit.transport.AmazonS3 always tries to connect to 'http://<bucket name>.<domain>', where domain defaults to This can be changed in your property file, but the http and the <bucket>. cannot.
Previous Topic:egit Broken after upgrade
Next Topic:Newb question: can JGIT support manual password entering
Goto Forum:

Current Time: Tue Oct 15 04:21:17 GMT 2019

Powered by FUDForum. Page generated in 0.02464 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top