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 github.com/scality/S3 and s3.scality.com ) 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.api.PushCommand.call(PushCommand.java:160)
	at org.eclipse.jgit.pgm.Push.run(Push.java:126)
	at org.eclipse.jgit.pgm.TextBuiltin.execute(TextBuiltin.java:174)
	at org.eclipse.jgit.pgm.Main.execute(Main.java:221)
	at org.eclipse.jgit.pgm.Main.run(Main.java:124)
	at org.eclipse.jgit.pgm.Main.main(Main.java:98)
Caused by: org.eclipse.jgit.errors.TransportException: amazon-s3://mybucket/mygitrepo.git/objects: error in packed-refs
	at org.eclipse.jgit.transport.WalkRemoteObjectDatabase.readPackedRefs(WalkRemoteObjectDatabase.java:433)
	at org.eclipse.jgit.transport.TransportAmazonS3$DatabaseS3.readAdvertisedRefs(TransportAmazonS3.java:306)
	at org.eclipse.jgit.transport.TransportAmazonS3.openPush(TransportAmazonS3.java:206)
	at org.eclipse.jgit.transport.PushProcess.execute(PushProcess.java:154)
	at org.eclipse.jgit.transport.Transport.push(Transport.java:1173)
	at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:156)
	... 5 more
Caused by: java.io.IOException: Reading of 'mygitrepo.git/packed-refs' failed: 403 Forbidden
	at org.eclipse.jgit.transport.AmazonS3.error(AmazonS3.java:513)
	at org.eclipse.jgit.transport.AmazonS3.get(AmazonS3.java:283)
	at org.eclipse.jgit.transport.TransportAmazonS3$DatabaseS3.open(TransportAmazonS3.java:280)
	at org.eclipse.jgit.transport.WalkRemoteObjectDatabase.openReader(WalkRemoteObjectDatabase.java:365)
	at org.eclipse.jgit.transport.WalkRemoteObjectDatabase.readPackedRefs(WalkRemoteObjectDatabase.java:423)
	... 10 more
Caused by: java.io.IOException: 
<?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(AmazonS3.java:532)


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?

Cheers!
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 s3.amazonaws.com. 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: Thu Apr 25 22:35:19 GMT 2024

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

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

Back to the top