Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Unable to push to repository on USB drive(Get a TransportException when I try to push to a repository on a USB flash drive)
Unable to push to repository on USB drive [message #1806758] Tue, 14 May 2019 18:48 Go to next message
David Gauntt is currently offline David GaunttFriend
Messages: 7
Registered: May 2014
Junior Member
Whenever I use Egit try to push commits onto a repository on a USB flash drive, it fails with the message "error occurred during unpacking on the remote end: error Cannot lock pack in /Volumes/<path to repository>/.git/objects/pack/pack-b54....pack".

Any suggestions on what to try next?

Details

I have a USB flash drive that I use to keep projects on my home computer (Windows 10) synchronized with my office computer (Mac OS X 10.11.6). I recently upgraded both computers to Eclipse 2019-03, and sometime since then I have been unable to push commits from my Mac to the flash drive. I do not know if the problem started immediately after the upgrade or after. There is no problem with pushing from the Windows computer.

I have verified that I can push to a second local repository on my Mac hard drive. I have also tried and failed to push onto repositories on two different flash drives, and also tried cloning a repository onto a flash drive. Error messages and stack traces are below.

I have looked at the file permissions through the directory structure on one of the USB drives, and they are rwxrwxrwx all the way down, so it doesn't look like a permissions problem.

At this point the only cause I can think of is that the .git directory is hidden by default in OS X, and that is somehow tripping up EGit since the upgrade.

Full error message caused by push

Caused by: org.eclipse.jgit.errors.TransportException: file:////Volumes/SANDISK/EGit/SANDISK_DESKTOPPOI/: error occurred during unpacking on the remote end: error Cannot lock pack in /Volumes/SANDISK/EGit/SANDISK_DESKTOPPOI/.git/objects/pack/pack-b54a095ea27b0788e1ce57d53f3d893d9fff547b.pack
at org.eclipse.jgit.transport.BasePackPushConnection.readStatusReport(BasePackPushConnection.java:382)
at org.eclipse.jgit.transport.BasePackPushConnection.doPush(BasePackPushConnection.java:222)

Full error message caused by clone

/Volumes/WHITE LEXAR/EGit/IMAC_DESKTOPPOI/.git/HEAD.lock.6def3a6c1de54091aae558c1ee1d7a29 -> /Volumes/WHITE LEXAR/EGit/IMAC_DESKTOPPOI/.git/HEAD.lock: Operation not supported

Stack trace after pull failed

org.eclipse.jgit.api.errors.TransportException: file:////Volumes/SANDISK/EGit/SANDISK_DESKTOPPOI/: error occurred during unpacking on the remote end: error Cannot lock pack in /Volumes/SANDISK/EGit/SANDISK_DESKTOPPOI/.git/objects/pack/pack-b54a095ea27b0788e1ce57d53f3d893d9fff547b.pack
at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:180)
at org.eclipse.egit.core.op.PushOperation.run(PushOperation.java:217)
at org.eclipse.egit.ui.internal.push.PushJob.performJob(PushJob.java:86)
at org.eclipse.egit.ui.internal.jobs.RepositoryJob.run(RepositoryJob.java:59)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.eclipse.jgit.errors.TransportException: file:////Volumes/SANDISK/EGit/SANDISK_DESKTOPPOI/: error occurred during unpacking on the remote end: error Cannot lock pack in /Volumes/SANDISK/EGit/SANDISK_DESKTOPPOI/.git/objects/pack/pack-b54a095ea27b0788e1ce57d53f3d893d9fff547b.pack
at org.eclipse.jgit.transport.BasePackPushConnection.readStatusReport(BasePackPushConnection.java:382)
at org.eclipse.jgit.transport.BasePackPushConnection.doPush(BasePackPushConnection.java:222)
at org.eclipse.jgit.transport.BasePackPushConnection.push(BasePackPushConnection.java:170)
at org.eclipse.jgit.transport.PushProcess.execute(PushProcess.java:172)
at org.eclipse.jgit.transport.Transport.push(Transport.java:1346)
at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:170)
... 4 more

Stack trace after clone failed

org.eclipse.jgit.api.errors.JGitInternalException: /Volumes/WHITE LEXAR/EGit/IMAC_DESKTOPPOI/.git/HEAD.lock.6def3a6c1de54091aae558c1ee1d7a29 -> /Volumes/WHITE LEXAR/EGit/IMAC_DESKTOPPOI/.git/HEAD.lock: Operation not supported
at org.eclipse.jgit.api.InitCommand.call(InitCommand.java:128)
at org.eclipse.jgit.api.CloneCommand.init(CloneCommand.java:274)
at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:195)
at org.eclipse.egit.core.op.CloneOperation.run(CloneOperation.java:180)
at org.eclipse.egit.ui.internal.clone.AbstractGitCloneWizard.executeCloneOperation(AbstractGitCloneWizard.java:486)
at org.eclipse.egit.ui.internal.clone.AbstractGitCloneWizard.access$2(AbstractGitCloneWizard.java:479)
at org.eclipse.egit.ui.internal.clone.AbstractGitCloneWizard$6.run(AbstractGitCloneWizard.java:458)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.nio.file.FileSystemException: /Volumes/WHITE LEXAR/EGit/IMAC_DESKTOPPOI/.git/HEAD.lock.6def3a6c1de54091aae558c1ee1d7a29 -> /Volumes/WHITE LEXAR/EGit/IMAC_DESKTOPPOI/.git/HEAD.lock: Operation not supported
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixFileSystemProvider.createLink(UnixFileSystemProvider.java:476)
at java.nio.file.Files.createLink(Files.java:1086)
at org.eclipse.jgit.util.FS_POSIX.createNewFileAtomic(FS_POSIX.java:457)
at org.eclipse.jgit.internal.storage.file.LockFile.lock(LockFile.java:164)
at org.eclipse.jgit.internal.storage.file.RefDirectoryUpdate.tryLock(RefDirectoryUpdate.java:89)
at org.eclipse.jgit.lib.RefUpdate.link(RefUpdate.java:708)
at org.eclipse.jgit.internal.storage.file.FileRepository.create(FileRepository.java:309)
at org.eclipse.jgit.api.InitCommand.call(InitCommand.java:125)
... 7 more
Re: Unable to push to repository on USB drive [message #1806762 is a reply to message #1806758] Tue, 14 May 2019 21:00 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 576
Registered: August 2016
Senior Member
Looks like a problem on Mac because JGit thinks it's on a POSIX file system, but the USB stick probably is formatted as exFAT. Java cannot create a hard link there, UnixFileSystemProvider throws a generic FileSystemException, which JGit doesn't catch. On Windows it works because JGit doesn't try this hard-link mechanism.

Related is bug 544460, but even if that were fixed, I suppose the fact that we end up in UnixFileSystemProvider means it wouldn't help here.

So org.eclipse.jgit.util.FS_POSIX.createNewFileAtomic() should probably also catch the generic FileSystemException.

As a work-around you could set
git config --global core.supportsatomicfilecreation true

in your git user config.
Re: Unable to push to repository on USB drive [message #1806825 is a reply to message #1806762] Wed, 15 May 2019 17:46 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 576
Registered: August 2016
Senior Member
I've created bug 547332 for this.
Re: Unable to push to repository on USB drive [message #1806910 is a reply to message #1806825] Fri, 17 May 2019 13:08 Go to previous messageGo to next message
David Gauntt is currently offline David GaunttFriend
Messages: 7
Registered: May 2014
Junior Member
Thomas,

Thank you! I look forward to the bug fix.

Further information

I just tried the following:

  1. Quit Eclipse
  2. Enter "git config --global core.supportsatomicfilecreation true" in the command line
  3. Enter "git config --list" to confirm the change.
  4. git replied with "core.supportsatomicfilecreation=true"
  5. Restart Eclipse
  6. Push to the USB drive from Eclipse

This resulted in the same error message.


As further information, I just tried pushing from the command line, and that works properly, confirming that it is a JGit problem and not a git problem.
Re: Unable to push to repository on USB drive [message #1806944 is a reply to message #1806910] Sat, 18 May 2019 21:14 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 576
Registered: August 2016
Senior Member
When I tried this, I got a different exception.

First I got
Can't connect to any repository: file:///Volumes/USB DISK/gittest/.git (file:///Volumes/USB DISK/gittest/.git: error occurred during unpacking on the remote end: error /Volumes/USB DISK/gittest/.git/objects/pack/pack-dbd37e62820451e705d8d5d890153f71b554c18d.keep.lock.37197561a34841e2856f1cf696352e73 -> /Volumes/USB DISK/gittest/.git/objects/pack/pack-dbd37e62820451e705d8d5d890153f71b554c18d.keep.lock: Operation not supported)

After setting core.supportsatomicfilecreation I got
Can't connect to any repository: file:///Volumes/USB DISK/gittest/.git (file:///Volumes/USB DISK/gittest/.git: error occurred during unpacking on the remote end: error Cannot lock pack in /Volumes/USB DISK/gittest/.git/objects/pack/pack-dbd37e62820451e705d8d5d890153f71b554c18d.pack)

The problem is that after the first failure, the lock file mentioned in the first error message is still there, so trying to push the same commit again fails because there is already a lock file.

After manually removing the lock file, in my case /Volumes/USB DISK/gittest/.git/objects/pack/pack-dbd37e62820451e705d8d5d890153f71b554c18d.keep.lock, pushing to the USB drive worked.
Re: Unable to push to repository on USB drive [message #1807043 is a reply to message #1806944] Tue, 21 May 2019 16:46 Go to previous messageGo to next message
David Gauntt is currently offline David GaunttFriend
Messages: 7
Registered: May 2014
Junior Member
Good detective work! I found that I had lock files, deleted them, set core.supportsatomicfilecreation, and then tried pushing again, and got the first error message that you listed above ("Operation not supported"). My core settings in git are
credential.helper=osxkeychain
user.name=David M. Gauntt
user.email=<my email address>
core.autocrlf=true
core.supportsatomicfilecreation=true
core.repositoryformatversion=0
core.filemode=false
core.logallrefupdates=true
core.precomposeunicode=true

I guess that I will stick to the command line approach for now.
Re: Unable to push to repository on USB drive [message #1807207 is a reply to message #1807043] Fri, 24 May 2019 15:46 Go to previous messageGo to next message
David Gauntt is currently offline David GaunttFriend
Messages: 7
Registered: May 2014
Junior Member
I have a nice workaround to share with anyone else with this problem. This works only with Mac OS X, but I think the problem is specific to OS X.

1) Create a text file named "push.sh" in the root directory of your project; this is the directory containing the file ".project".
2) Enter the following text into the file:

#!/bin/bash
cd ..
echo Pushing $PWD
git push
echo Push finished


3) Make the file executable. To do this, open the Terminal and enter the following commands:

cd <the directory containing push.sh>
chmod u+x push.sh


4) Create a new External Tool in Eclipse. A simple tutorial for doing this is at https://stackoverflow.com/questions/1562600/is-there-an-eclipse-plugin-to-run-system-shell-in-the-console. Follow the instructions in the reply that starts with "You don't need a plugin", but configure your new tool with the following options:

Name: Push current project
Location: /bin/bash
Working directory: ${project_loc}
Arguments: push.sh

5) To push a project containing push.sh, select a file in the project and then select "Push current project" from the External Tools menu. The script will write messages to the console; these won't include progress messages, but you will get a message when the push is done:

Pushing /Users/dgauntt/git/IMAC_CTPM
Everything up-to-date
Push finished

[Updated on: Fri, 24 May 2019 15:49]

Report message to a moderator

Re: Unable to push to repository on USB drive [message #1808023 is a reply to message #1806825] Fri, 14 June 2019 06:54 Go to previous message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 576
Registered: August 2016
Senior Member
Thomas Wolf wrote on Wed, 15 May 2019 17:46
I've created bug 547332 for this.

This is fixed in the upcoming EGit 5.4.0 release (public on 2019-06-19). The fix is also available in EGit nightly already.
Previous Topic:Cannot open git-receive-pack when pushing with egit, git-upload-pack when pulling
Next Topic:Does eGit require gitbash to be loaded on the device?
Goto Forum:
  


Current Time: Fri Mar 29 00:14:12 GMT 2024

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

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

Back to the top