Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » JGit, Amazon S3 and Windows -
JGit, Amazon S3 and Windows - [message #1726446] Sun, 13 March 2016 21:26 Go to next message
Oculus Hut is currently offline Oculus HutFriend
Messages: 1
Registered: March 2016
Junior Member
So, I have downloaded the jgit.sh file (https://eclipse.org/jgit/download/) and am trying to use it to store a repository within Amazon S3.

I am on Windows 10 with the following Java runtime:
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

I have created a local Git test repository.
F:\#Downloads\JGit\afolder>git status
On branch master
nothing to commit, working directory clean

I have specified the remote repository URL that I would like to push to:
F:\#Downloads\JGit\afolder>git remote -v
origin  amazon-s3://secret@git.test/ (fetch)
origin  amazon-s3://secret@git.test/ (push)

The AWS account I am using should have access to the git.test bucket.

This is what I get when I try and push to the S3 bucket:
F:\#Downloads\JGit\afolder>java -cp F:\#Downloads\JGit\\jgit.sh org.eclipse.jgit.pgm.Main push origin master
org.eclipse.jgit.api.errors.TransportException: amazon-s3://git.test//objects: error in packed-refs
        at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:164)
        at org.eclipse.jgit.pgm.Push.run(Push.java:130)
        at org.eclipse.jgit.pgm.TextBuiltin.execute(TextBuiltin.java:199)
        at org.eclipse.jgit.pgm.Main.execute(Main.java:246)
        at org.eclipse.jgit.pgm.Main.run(Main.java:138)
        at org.eclipse.jgit.pgm.Main.main(Main.java:110)
Caused by: org.eclipse.jgit.errors.TransportException: amazon-s3://git.test//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:311)
        at org.eclipse.jgit.transport.TransportAmazonS3.openPush(TransportAmazonS3.java:211)
        at org.eclipse.jgit.transport.PushProcess.execute(PushProcess.java:155)
        at org.eclipse.jgit.transport.Transport.push(Transport.java:1250)
        at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:157)
        ... 5 more
Caused by: java.io.IOException: Reading of '/packed-refs' failed: 403 Forbidden
        at org.eclipse.jgit.transport.AmazonS3.error(AmazonS3.java:527)
        at org.eclipse.jgit.transport.AmazonS3.get(AmazonS3.java:299)
        at org.eclipse.jgit.transport.TransportAmazonS3$DatabaseS3.open(TransportAmazonS3.java:285)
        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>AccessDenied</Code><Message>Access Denied</Message><RequestId>D4C469A1471BFA57</RequestId><HostId>THRefkTC6doabYZqxoqIMoyNyEh4cXcFqbOqj7mcOsNvI7+t/f9oWVcaYQdGONluQRpkLlywm1s=</HostId></Error>
        at org.eclipse.jgit.transport.AmazonS3.error(AmazonS3.java:546)
        ... 14 more

Any ideas what could have gone wrong? JGit setup problem, AWS setup problem or something else?

Any assistance would be very much appreciated!
Re: JGit, Amazon S3 and Windows - [message #1729406 is a reply to message #1726446] Wed, 13 April 2016 21:53 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
TransportAmazonS3 loads credentials from a property file named like the userid given in the URL [1]
either .git/<userid> or ~/<userid>

See [2] for instructions, I didn't try this on my own

[1] http://git.eclipse.org/c/jgit/jgit.git/tree/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java#n166
[2] http://blog.spearce.org/2008/07/using-jgit-to-publish-on-amazon-s3.html
Previous Topic:Eclipse upgrade to 4.5.2
Next Topic:How can i increase the log level of egit/jgit
Goto Forum:
  


Current Time: Thu Apr 25 04:48:50 GMT 2024

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

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

Back to the top