Bug 410580 - [regression] Internal Exception: Parent and local keys must be specified when adding comment
Summary: [regression] Internal Exception: Parent and local keys must be specified when...
Status: CLOSED MOVED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X
: P2 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 415490
  Show dependency tree
 
Reported: 2013-06-12 07:00 EDT by Steffen Pingel CLA
Modified: 2013-12-19 13:18 EST (History)
2 users (show)

See Also:
sam.davis: documentation+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Pingel CLA 2013-06-12 07:00:16 EDT
What steps will reproduce the problem?
1. 
2. 
3. 

Steps:
1. Compare with Base
2. Add comment from compare editor

-- Error Details --
Date: Wed Jun 12 12:57:07 CEST 2013
Message: Unhandled event loop exception
Severity: Error
Product: Eclipse SDK 3.8.2.v201301310800 (org.eclipse.sdk.ide)

Exception Stack Trace:
java.lang.RuntimeException: Internal Exception: Parent and local keys must be specified.
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.AbstractRemoteEmfFactory$UniqueLocalReference.<init>(AbstractRemoteEmfFactory.java:59)
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.AbstractRemoteEmfFactory.findConsumer(AbstractRemoteEmfFactory.java:263)
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.AbstractRemoteEmfFactory.getConsumerForLocalKey(AbstractRemoteEmfFactory.java:176)
	at org.eclipse.mylyn.internal.reviews.ui.dialogs.AddCommentDialog.performOperation(AddCommentDialog.java:146)
	at org.eclipse.mylyn.internal.reviews.ui.dialogs.AddCommentDialog.close(AddCommentDialog.java:83)
	at org.eclipse.jface.dialogs.Dialog.okPressed(Dialog.java:940)
	at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:472)
	at org.eclipse.mylyn.reviews.ui.ProgressDialog.access$1(ProgressDialog.java:1)
	at org.eclipse.mylyn.reviews.ui.ProgressDialog$2.widgetSelected(ProgressDialog.java:265)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4136)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1458)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1481)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1271)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3982)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3621)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.mylyn.internal.reviews.ui.actions.AddLineCommentToFileAction.run(AddLineCommentToFileAction.java:119)
	at org.eclipse.mylyn.internal.reviews.ui.actions.AbstractReviewAction.run(AbstractReviewAction.java:49)
	at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:168)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4136)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1458)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1481)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1271)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3982)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3621)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
Comment 1 Steffen Pingel CLA 2013-06-12 07:02:34 EDT
The comment was added but I still got the error which made it seem like the submission failed.
Comment 2 Steffen Pingel CLA 2013-06-12 07:59:13 EDT
Let's disregard this for now. I was running an older build.
Comment 3 Miles Parker CLA 2013-06-12 12:12:42 EDT
Whew. I thought I'd seen the last of that bug.
Comment 4 Steffen Pingel CLA 2013-06-13 08:56:46 EDT
Clearly saw this exception now with a new review that I hadn't looked at before using the release build when adding a comment:

java.lang.RuntimeException: Internal Exception: Parent and local keys must be specified.
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.AbstractRemoteEmfFactory$UniqueLocalReference.<init>(AbstractRemoteEmfFactory.java:59)
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.AbstractRemoteEmfFactory.findConsumer(AbstractRemoteEmfFactory.java:263)
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.AbstractRemoteEmfFactory.getConsumerForLocalKey(AbstractRemoteEmfFactory.java:176)
	at org.eclipse.mylyn.internal.reviews.ui.dialogs.AddCommentDialog.performOperation(AddCommentDialog.java:146)
	at org.eclipse.mylyn.internal.reviews.ui.dialogs.AddCommentDialog.close(AddCommentDialog.java:83)
	at org.eclipse.jface.dialogs.Dialog.okPressed(Dialog.java:940)
	at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:472)
	at org.eclipse.mylyn.reviews.ui.ProgressDialog.access$1(ProgressDialog.java:1)
	at org.eclipse.mylyn.reviews.ui.ProgressDialog$2.widgetSelected(ProgressDialog.java:265)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4136)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1458)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1481)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1271)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3982)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3621)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.mylyn.internal.reviews.ui.actions.AddLineCommentToFileAction.run(AddLineCommentToFileAction.java:119)
	at org.eclipse.mylyn.internal.reviews.ui.actions.AbstractReviewAction.run(AbstractReviewAction.java:49)
	at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:168)
Comment 5 Miles Parker CLA 2013-06-13 13:13:39 EDT
(In reply to comment #4)
> Clearly saw this exception now with a new review that I hadn't looked at before
> using the release build when adding a comment:

Ok, do you have a specific review and file item you're seeing it on? Is it all file items within a given patch set? All file items within any patch set?
Comment 6 Steffen Pingel CLA 2013-06-13 16:46:28 EDT
I saw this with our internal Gerrit. I'll keep watching for it on Eclipse.org reviews and try to provide steps to reproduce.
Comment 7 Sam Davis CLA 2013-06-13 17:39:50 EDT
I have seen this several times running on the latest.
Comment 8 Miles Parker CLA 2013-06-13 17:44:02 EDT
My *guess* is that it is caused by bug 410532.
Comment 9 Sam Davis CLA 2013-06-14 13:30:05 EDT
I am seeing this on reviews that have no drafts currently.
Comment 10 Miles Parker CLA 2013-06-20 19:09:46 EDT
https://git.eclipse.org/r/#/c/13965/
Comment 11 Miles Parker CLA 2013-06-20 19:25:53 EDT
Merged https://git.eclipse.org/r/#/c/13965/

Note that this was caused by the code attempting to update observers for any review item set contents. The code allows the Review Explorer to immediately update with the new comment count and contents. However, in the case of a compare set, the review item set (e.g. Gerrit patch set) isn't actually contained in a model (because it isn't a permanent part of the review). The IFileVersions and IFiles themselves is generated from the patch sets freshly, even if a corresponding file already exists. So unfortunatetly, this means that in this case we won't be able to update the Review Explorer automatically.

We could do something like temporarily add the compare to the patch set and search to match the IFile but I think that adds a lot of complexity for very little gain.
Comment 12 Steffen Pingel CLA 2013-07-30 13:42:01 EDT
Just hit this again while opening and closing (quickly) a review that was in the process of being synchronized. This was with 2.0.1.20130712.

java.lang.RuntimeException: Internal Exception: Parent and local keys must be specified.
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.AbstractRemoteEmfFactory$UniqueLocalReference.<init>(AbstractRemoteEmfFactory.java:59)
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.AbstractRemoteEmfFactory.findConsumer(AbstractRemoteEmfFactory.java:263)
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.AbstractRemoteEmfFactory.getConsumerForModel(AbstractRemoteEmfFactory.java:250)
	at org.eclipse.mylyn.internal.gerrit.core.remote.PatchSetDetailRemoteFactory.getRemoteObjectForLocalKey(PatchSetDetailRemoteFactory.java:90)
	at org.eclipse.mylyn.internal.gerrit.core.remote.PatchSetDetailRemoteFactory.getRemoteObjectForLocalKey(PatchSetDetailRemoteFactory.java:1)
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.AbstractRemoteEmfFactory.getRemoteKeyForLocalKey(AbstractRemoteEmfFactory.java:334)
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.RemoteEmfConsumer.pull(RemoteEmfConsumer.java:148)
	at org.eclipse.mylyn.internal.gerrit.core.remote.PatchSetContentIdRemoteFactory.pull(PatchSetContentIdRemoteFactory.java:43)
	at org.eclipse.mylyn.internal.gerrit.core.remote.PatchSetContentIdRemoteFactory.pull(PatchSetContentIdRemoteFactory.java:1)
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.RemoteEmfConsumer.pull(RemoteEmfConsumer.java:164)
	at org.eclipse.mylyn.reviews.core.spi.remote.JobRemoteService$1.run(JobRemoteService.java:60)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 13 Sam Davis CLA 2013-08-01 19:03:52 EDT
I still get this sometimes when opening reviews. Once it happens, sometimes I can't refresh the review until I restart.
Comment 14 Steffen Pingel CLA 2013-08-19 07:27:57 EDT
I saw this bug when I opened and closed a review while background synchronization was still in progress. I was wondering if cancelation could somehow contribute to this bug.
Comment 15 Steffen Pingel CLA 2013-08-19 13:50:23 EDT
Miles, could this be the same problem discussed on bug 414799 where closing of the AbstractRemoteEditFactoryProvider clears references that are still in use by other consumers of the model? From looking at the code it's not quite clear to me what references are removed there.
Comment 16 Tomasz Zarna CLA 2013-08-20 10:18:44 EDT
(In reply to comment #15)
> Miles, could this be the same problem discussed on bug 414799

I'm not 100% sure if this is the same problem, but I got a similar exception quite often when trying to reproduce the other bug. _Parent and local keys must be specified._ often followed the NPE in Review Explorer.
Comment 17 Tomasz Zarna CLA 2013-08-22 10:07:26 EDT
Trying out https://git.eclipse.org/r/#/c/15004/9 :

java.lang.RuntimeException: Internal Exception: Parent and local keys must be specified.
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.AbstractRemoteEmfFactory$UniqueLocalReference.<init>(AbstractRemoteEmfFactory.java:58)
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.AbstractRemoteEmfFactory.findConsumer(AbstractRemoteEmfFactory.java:262)
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.AbstractRemoteEmfFactory.getConsumerForModel(AbstractRemoteEmfFactory.java:249)
	at org.eclipse.mylyn.internal.gerrit.core.remote.PatchSetDetailRemoteFactory.getRemoteObjectForLocalKey(PatchSetDetailRemoteFactory.java:90)
	at org.eclipse.mylyn.internal.gerrit.core.remote.PatchSetDetailRemoteFactory.getRemoteObjectForLocalKey(PatchSetDetailRemoteFactory.java:1)
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.AbstractRemoteEmfFactory.getRemoteKeyForLocalKey(AbstractRemoteEmfFactory.java:333)
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.RemoteEmfConsumer.pull(RemoteEmfConsumer.java:121)
	at org.eclipse.mylyn.internal.gerrit.core.remote.PatchSetContentIdRemoteFactory.pull(PatchSetContentIdRemoteFactory.java:43)
	at org.eclipse.mylyn.internal.gerrit.core.remote.PatchSetContentIdRemoteFactory.pull(PatchSetContentIdRemoteFactory.java:1)
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.RemoteEmfConsumer.pull(RemoteEmfConsumer.java:127)
	at org.eclipse.mylyn.reviews.core.spi.remote.JobRemoteService$1.run(JobRemoteService.java:60)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 18 Tomasz Zarna CLA 2013-08-22 10:09:28 EDT
(In reply to comment #17)
> Trying out https://git.eclipse.org/r/#/c/15004/9 :
> 
> java.lang.RuntimeException: Internal Exception: Parent and local keys must
> be specified.
> 	at
> org.eclipse.mylyn.reviews.core.spi.remote.emf.
> AbstractRemoteEmfFactory$UniqueLocalReference.
> <init>(AbstractRemoteEmfFactory.java:58)

This is almost identical to comment 12.
Comment 19 Miles Parker CLA 2013-08-22 13:27:56 EDT
Yeah this is clearly a result of bug 415490. We're attempting to find a given review for the supplied Patch Set. But the Review's consumer has been disposed and so that review is no longer associated w/ a patch set.

One approach to look at is to special case the Review remote Factory so that it will find and set the repository if it isn't currently associated with the review.

Overall, perhaps we're being too aggressive with disposing these reviews. I hate to say it, because it's not a very nice solution from an engineering standpoint, and we should address the root concern, but these issues would go away if we simply let the reviews dwell for a while, or even waited to dispose them until workbench exit. I think in some sense the current solution is overly sophisticated...
Comment 20 Miles Parker CLA 2013-10-17 16:42:00 EDT
Reassigning to default as I'm not sure how much time I'll be able to devote to this.
Comment 21 Eclipse Webmaster CLA 2022-11-15 11:45:08 EST
Mylyn has been restructured, and our issue tracking has moved to GitHub [1].

We are closing ~14K Bugzilla issues to give the new team a fresh start. If you feel that this issue is still relevant, please create a new one on GitHub.

[1] https://github.com/orgs/eclipse-mylyn