Missing unknown when doing pull [message #1463304] |
Thu, 06 November 2014 07:28  |
Eclipse User |
|
|
|
Hi,
We often get Missing unknown exception when pulling from remote repository in EGit (Note this do not happen with native git). We are using Eclipse Luna on Windows and I tried both 3.5.[0,1] and the 3.6.0).
Our repository contains one sub module (used as a lib so no changes will ever be done on this sub-module).
The missing commit in the stack trace below is a commit from the sub-module. I have tried to do a fetch from upstream on the sub-module to make sure the sub-module is up-to-date before pulling but that doesn't help? So when this happens we use native git and it always works.
Anyone having the same problem? Should I file a EGit/JGit bug? Any workarounds?
Br,
/Mattias
org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during execution of merge command. org.eclipse.jgit.errors.MissingObjectException: Missing unknown 22175d544e9a5f7f0c9a2f9918cf385cf6b47b03
at org.eclipse.jgit.api.MergeCommand.call(MergeCommand.java:413)
at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:322)
at org.eclipse.egit.core.op.PullOperation$1.run(PullOperation.java:97)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313)
at org.eclipse.egit.core.op.PullOperation.execute(PullOperation.java:128)
at org.eclipse.egit.ui.internal.pull.PullOperationUI.execute(PullOperationUI.java:139)
at org.eclipse.egit.ui.internal.pull.PullOperationUI$1.runInWorkspace(PullOperationUI.java:114)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing unknown 22175d544e9a5f7f0c9a2f9918cf385cf6b47b03
at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:148)
at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:229)
at org.eclipse.jgit.dircache.DirCacheCheckout.checkoutEntry(DirCacheCheckout.java:1201)
at org.eclipse.jgit.merge.ResolveMerger.checkout(ResolveMerger.java:316)
at org.eclipse.jgit.merge.ResolveMerger.mergeTrees(ResolveMerger.java:1048)
at org.eclipse.jgit.merge.ResolveMerger.mergeImpl(ResolveMerger.java:303)
at org.eclipse.jgit.merge.Merger.merge(Merger.java:203)
at org.eclipse.jgit.merge.Merger.merge(Merger.java:156)
at org.eclipse.jgit.merge.ThreeWayMerger.merge(ThreeWayMerger.java:114)
at org.eclipse.jgit.api.MergeCommand.call(MergeCommand.java:342)
... 8 more
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Missing unknown when doing pull [message #1623960 is a reply to message #1587424] |
Thu, 19 February 2015 07:57   |
Eclipse User |
|
|
|
I tried to reproduce. I tried to be quite close to the description you gave. But for me it works. The pull succeeds. Here is my script (containing also in which eclipse views I triggered what). What am I missing?
/tmp> uname -a
Linux vblub14 3.13.0-45-generic #74-Ubuntu SMP Tue Jan 13 19:36:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
/tmp> git --version
git version 2.2.2
/tmp> git init --bare lib.git
Reinitialized existing Git repository in /tmp/lib.git/
/tmp> git clone lib.git lib2
Cloning into 'lib2'...
warning: You appear to have cloned an empty repository.
done.
/tmp> cd lib2/
/tmp/lib2> echo a >lib.jar
/tmp/lib2> git add lib.jar
/tmp/lib2> git commit -m "add lib.jar"
[master (root-commit) 22e3b1a] add lib.jar
1 file changed, 1 insertion(+)
create mode 100644 lib.jar
/tmp/lib2> git push origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 217 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To /tmp/lib.git
* [new branch] master -> master
/tmp/lib2> git tag VERSION_01
/tmp/lib2> git push origin --tags
Total 0 (delta 0), reused 0 (delta 0)
To /tmp/lib.git
* [new tag] VERSION_01 -> VERSION_01
/tmp/lib2> cd ..
/tmp> git init --bare a.git
Initialized empty Git repository in /tmp/a.git/
/tmp> # In Eclipse "Git Repositories" view cloned file://tmp/a.git to ~/git/a2. Selected "clone submodules" during clone.
/tmp> # ... got warnings that I cloned an empty repository
/tmp>
/tmp> # Create a new Java project name "aproj" located at ~/git/a2
/tmp> # Project was automatically set to be version controlled by git repo ~/git/a2
/tmp> # The files .gitignore, .gitignore, .project got created
/tmp> # In Eclipse: staged the three files, commitet them and pushed upstream
/tmp>
/tmp> # In Eclipse "Git Repositories" view right-clicked on the repo, selected "add Submodule", Submodule Path="lib", URI=file:////tmp/lib.git
/tmp> # In Eclipse: committed the submodule addition, pushed upstream
/tmp>
/tmp> cd lib2/
/tmp/lib2> echo b >lib2.jar
/tmp/lib2> git add lib2.jar
/tmp/lib2> git commit -m "add lib2.jar"
[master ddfb416] add lib2.jar
1 file changed, 1 insertion(+)
create mode 100644 lib2.jar
/tmp/lib2> git push origin master
Counting objects: 3, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 274 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To /tmp/lib.git
22e3b1a..ddfb416 master -> master
/tmp/lib2> git tag VERSION_02
/tmp/lib2> git push origin --tags
Total 0 (delta 0), reused 0 (delta 0)
To /tmp/lib.git
* [new tag] VERSION_02 -> VERSION_02
/tmp/lib2> cd ..
/tmp> git clone a.git/ a3
Cloning into 'a3'...
done.
/tmp> cd a3
/tmp/a3> git pull origin master
From /tmp/a
* branch master -> FETCH_HEAD
Already up-to-date.
/tmp/a3> git submodule init
Submodule 'lib' (file:////tmp/lib.git) registered for path 'lib'
/tmp/a3> git submodule update
Cloning into 'lib'...
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6/6), done.
Checking connectivity... done.
Submodule path 'lib': checked out '22e3b1af9de89bc8e31285426ecb27983f2def8c'
/tmp/a3> cd lib
/tmp/a3/lib> git fetch --tags origin master
From file:////tmp/lib
* branch master -> FETCH_HEAD
/tmp/a3/lib> git checkout VERSION_02
Previous HEAD position was 22e3b1a... add lib.jar
HEAD is now at ddfb416... add lib2.jar
/tmp/a3/lib> cd ..
/tmp/a3> git add .
/tmp/a3> git commit -m "updated a to version 02"
[master 2d0cb45] updated a to version 02
1 file changed, 1 insertion(+), 1 deletion(-)
/tmp/a3> git push origin master
Counting objects: 2, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 259 bytes | 0 bytes/s, done.
Total 2 (delta 1), reused 0 (delta 0)
To /tmp/a.git/
a713eaa..2d0cb45 master -> master
/tmp>
/tmp> # In Eclipse "Package Explorer" view on project "aproj": Select "Pull"
/tmp> # Result: a succesfull "fast forward merge". See attached screenshot
/tmp>
/tmp/a3> cd ~/git/a2/
~/git/a2> git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: lib (new commits)
no changes added to commit (use "git add" and/or "git commit -a")
~/git/a2> git log --oneline --decorate
2d0cb45 (HEAD, origin/master, master) updated a to version 02
a713eaa add submodule
9baf943 add project
~/git/a2>
Attachment: lub14.png
(Size: 196.68KB, Downloaded 691 times)
|
|
|
|
|
|
|
|
|
|
Re: Missing unknown when doing pull [message #1645343 is a reply to message #1636549] |
Mon, 02 March 2015 08:10   |
Eclipse User |
|
|
|
I retried on windows: It works for me. What am I doing wrong? Here is the exact script I used:
[/tmp]$ uname -a
MINGW32_NT-6.2 WDFN00318987A 1.0.12(0.46/3/2) 2012-07-05 14:56 i686 unknown
[/tmp]$ git --version
git version 1.9.5.msysgit.0
[/tmp]$ git init --bare lib.git
Initialized empty Git repository in C:/Users/d032780/AppData/Local/Temp/lib.git/
[/tmp]$ git clone lib.git lib2
Cloning into 'lib2'...
warning: You appear to have cloned an empty repository.
done.
[/tmp]$ cd lib2
[/tmp/lib2 (master)]$ echo a >lib.jar
[/tmp/lib2 (master)]$ git add lib.jar
[/tmp/lib2 (master)]$ git commit -m "add lib.jar"
[master (root-commit) a23822a] add lib.jar
1 file changed, 1 insertion(+)
create mode 100644 lib.jar
[/tmp/lib2 (master)]$ git push origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 217 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To C:/Users/d032780/AppData/Local/Temp/lib.git
* [new branch] master -> master
[/tmp/lib2 (master)]$ git tag VERSION_01
[/tmp/lib2 (master)]$ git push origin --tags
Total 0 (delta 0), reused 0 (delta 0)
To C:/Users/d032780/AppData/Local/Temp/lib.git
* [new tag] VERSION_01 -> VERSION_01
[/tmp/lib2 (master)]$ cd ..
[/tmp]$ git init --bare a.git
Initialized empty Git repository in C:/Users/d032780/AppData/Local/Temp/a.git/
[/tmp]$ pwd
/tmp
[/tmp]$ # In Eclipse "Git Repositories" view cloned file://tmp/a.git to ~/git/a2. Selected "clone submodules" during clone.
[/tmp]$ # ... got warnings that I cloned an empty repository
[/tmp]$
[/tmp]$ # Create a new Java project name "aproj" located at ~/git/a2
[/tmp]$ # Project was automatically set to be version controlled by git repo ~/git/a2
[/tmp]$ # The files .gitignore, .gitignore, .project got created
[/tmp]$ # In Eclipse: staged the three files, commitet them and pushed upstream
[/tmp]$
[/tmp]$ # In Eclipse "Git Repositories" view right-clicked on the repo, selected "add Submodule", Submodule Path="lib", URI=file:////tmp/lib.git
[/tmp]$ # In Eclipse: committed the submodule addition, pushed upstream
[/tmp]$
[/tmp]$ cd lib2
[/tmp/lib2 (master)]$ echo b>lib2.jar
[/tmp/lib2 (master)]$ git add lib2.jar
[/tmp/lib2 (master)]$ git commit -m "add lib2.jar"
[master 650d15f] add lib2.jar
1 file changed, 1 insertion(+)
create mode 100644 lib2.jar
[/tmp/lib2 (master)]$ git push origin master
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 273 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To C:/Users/d032780/AppData/Local/Temp/lib.git
a23822a..650d15f master -> master
[/tmp/lib2 (master)]$ git tag VERSION_02
[/tmp/lib2 (master)]$ git push origin --tags
Total 0 (delta 0), reused 0 (delta 0)
To C:/Users/d032780/AppData/Local/Temp/lib.git
* [new tag] VERSION_02 -> VERSION_02
[/tmp/lib2 (master)]$ cd ..
[/tmp]$ git clone a.git/ a3
Cloning into 'a3'...
done.
[/tmp]$ cd a3
[/tmp/a3 (master)]$ cd pull origin master
sh.exe": cd: pull: No such file or directory
[/tmp/a3 (master)]$ git pull origin master
From C:/Users/d032780/AppData/Local/Temp/a
* branch master -> FETCH_HEAD
Already up-to-date.
[/tmp/a3 (master)]$ git submodule init
Submodule 'lib' (file:///C:\Users\d032780\AppData\Local\Temp\lib.git) registered for path 'lib'
[/tmp/a3 (master)]$ git submodule update
Cloning into 'lib'...
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6/6), done.
Checking connectivity... done.
Submodule path 'lib': checked out 'a23822a24a64426a03fe512510e98eeb5a6720ab'
[/tmp/a3 (master)]$ cd lib
[/tmp/a3/lib ((VERSION_01))]$ git fetch --tags origin master
From file:///C:\Users\d032780\AppData\Local\Temp\lib
* branch master -> FETCH_HEAD
[/tmp/a3/lib ((VERSION_01))]$ git checkout VERSION_02
Previous HEAD position was a23822a... add lib.jar
HEAD is now at 650d15f... add lib2.jar
[/tmp/a3/lib ((VERSION_02))]$ cd ..
[/tmp/a3 (master)]$ git add .
[/tmp/a3 (master)]$ git commit -m "updated a to version 02"
[master 0a33b1e] updated a to version 02
1 file changed, 1 insertion(+), 1 deletion(-)
[/tmp/a3 (master)]$ git push origin master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 257 bytes | 0 bytes/s, done.
Total 2 (delta 1), reused 0 (delta 0)
To C:/Users/d032780/AppData/Local/Temp/a.git/
2c4f843..0a33b1e master -> master
[/tmp/a3 (master)]$ cd ~/git/a2
[~/git/a2 (master)]$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: lib (new commits)
no changes added to commit (use "git add" and/or "git commit -a")
[~/git/a2 (master)]$ git log --oneline --decorate
0a33b1e (HEAD, origin/master, master) updated a to version 02
2c4f843 add submodule
4aeedc2 create prj
|
|
|
Re: Missing unknown when doing pull [message #1646056 is a reply to message #1645343] |
Mon, 02 March 2015 15:52   |
Eclipse User |
|
|
|
Hi Christian ,
I tried with the exact same commands as you have and I still got the exception. So I just went through all git settings and found merge.ff=false in my git user settings.
Changing this to merge.ff=true and the error was gone .
So setting merge.ff=false in Git User Setting triggers the missing unknown exception when pulling commits containing sub modules changes as far as I can tell.
After the exception do a Team ->Reset (--hard) and change the Git User Stetting to merge-ff=true and Team->pull will succeed.
I tried using "--no-ff" with native git (which I believe is the same) and it worked.
I used:
$ git config branch.master.mergeoptions "--no-ff"
and then when I did the pull in the a2 repository I got the following output.
man@SUPERMAN /f/git/a2 (master)
$ git pull origin master
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 2 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (2/2), done.
From file:///F:\git\a
* branch master -> FETCH_HEAD
8d209df..a0e006a master -> origin/master
Fetching submodule lib
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (6/6), done.
From file:///F:\git\lib
db71fdc..007d5b3 master -> origin/master
* [new tag] VERSION_06 -> VERSION_06
* [new tag] VERSION_04 -> VERSION_04
Merge made by the 'recursive' strategy.
lib | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
The "--no-ff" option did change the output from git pull compare to when -"--no-ff" was not set. But the end result is the same for both cases...
I tell the developers here to set merge.ff to true and hopefully this will fix these issues for us.
But I guess JGit should be enhanced (in the future) to support -merge.ff =false together with sub modules as well since as far as I can tell it works with native git.
Br,
/Mattias
[Updated on: Mon, 02 March 2015 15:52] by Moderator
|
|
|
|
|
|
|
|
|
|
|
Re: Missing unknown when doing pull [message #1787595 is a reply to message #1463304] |
Tue, 29 May 2018 15:04  |
Eclipse User |
|
|
|
Just for the record, I got a similar error when performing a commit.
It was due to a symbolic link I added to fix an external build reference. It was seen as a submodule by EGit thus throwing the error.
Another symptom was that branch information was not shown in package explorer view.
Removing the symlink fixed the issue.
Error occurred computing Git commit diffs
org.eclipse.jgit.errors.MissingObjectException: Missing unknown 22a7dde70daa480ba8b7e0953ad023cbf3c2dacf
at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:163)
at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:234)
at org.eclipse.jgit.treewalk.WorkingTreeIterator.readContentAsNormalizedString(WorkingTreeIterator.java:1056)
at org.eclipse.jgit.treewalk.WorkingTreeIterator.contentCheck(WorkingTreeIterator.java:1014)
at org.eclipse.jgit.treewalk.WorkingTreeIterator.isModified(WorkingTreeIterator.java:935)
at org.eclipse.jgit.treewalk.filter.IndexDiffFilter.include(IndexDiffFilter.java:227)
at org.eclipse.jgit.treewalk.filter.TreeFilter.matchFilter(TreeFilter.java:226)
at org.eclipse.jgit.treewalk.filter.AndTreeFilter$List.matchFilter(AndTreeFilter.java:189)
at org.eclipse.jgit.treewalk.TreeWalk.next(TreeWalk.java:829)
at org.eclipse.jgit.lib.IndexDiff.diff(IndexDiff.java:440)
at org.eclipse.egit.ui.internal.commit.CommitUI.getIndexDiff(CommitUI.java:327)
at org.eclipse.egit.ui.internal.actions.CommitActionHandler$2.run(CommitActionHandler.java:150)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
|
|
|