Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 419700

Summary: unable to refresh config for Gerrit 2.7 => NPE in GerritReviewRemoteFactory.updateModel
Product: z_Archived Reporter: Tomasz Zarna <tomasz.zarna>
Component: MylynAssignee: Tomasz Zarna <tomasz.zarna>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: milesparker, sam.davis
Version: unspecified   
Target Milestone: 2.0.2   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 412872    
Bug Blocks: 410597    

Description Tomasz Zarna CLA 2013-10-17 08:27:32 EDT
For two 2.7 Gerrit instances [1][2] I wasn't able to refresh config, got error msg saying "Gerrit connection issue: No such service method". And while running a query I got:

!ENTRY org.eclipse.ui 4 0 2013-10-17 14:21:20.549
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
	at org.eclipse.swt.SWT.error(SWT.java:4361)
	at org.eclipse.swt.SWT.error(SWT.java:4276)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4144)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
	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:606)
	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)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Caused by: java.lang.NullPointerException
	at org.eclipse.mylyn.internal.gerrit.core.remote.GerritReviewRemoteFactory.updateModel(GerritReviewRemoteFactory.java:202)
	at org.eclipse.mylyn.internal.gerrit.core.remote.GerritReviewRemoteFactory.updateModel(GerritReviewRemoteFactory.java:1)
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.RemoteEmfConsumer.applyModel(RemoteEmfConsumer.java:183)
	at org.eclipse.mylyn.reviews.core.spi.remote.JobRemoteService$3.run(JobRemoteService.java:95)
	at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:164)
	at org.eclipse.ui.internal.UISynchronizer$3.run(UISynchronizer.java:158)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	... 23 more

[1] https://android-review.googlesource.com (2.7-1844-g7a2d8d4)
[2] http://gerrit.aokp.co (2.7-1856-g9033b5e)
Comment 1 Steffen Pingel CLA 2013-10-17 10:52:54 EDT
It looks like the stack trace is only a result of the failed call (and a null check maybe missing somewhere in there). Do you think you could capture the stack trace for the No such service method error? I'm curious which remote call is actually failing.

The NPE is actually the same as bug 410597: [regression] NPE when querying and configuration is not cached.
Comment 2 Tomasz Zarna CLA 2013-10-17 11:04:37 EDT
It's getProjectAdminService(..).visibleProjectDetails(..) :

Thread [ModalContext] (Suspended (exception GerritException))	
	JSonSupport.parseJsonResponse(String, Type) line: 207	
	GerritService.invoke(Object, Method, Object[]) line: 116	
	$Proxy4.visibleProjectDetails(AsyncCallback) line: not available	
	GerritClient$25.execute(IProgressMonitor) line: 958	
	GerritConnector$1(GerritClient).executeOnce(IProgressMonitor, Operation<T>) line: 1049	
	GerritConnector$1(GerritClient).execute(IProgressMonitor, Operation<T>) line: 1007	
	GerritConnector$1(GerritClient).getVisibleProjects(IProgressMonitor, GerritConfig) line: 955	
	GerritConnector$1(GerritClient).refreshConfig(IProgressMonitor) line: 750	
	GerritConnector.updateRepositoryConfiguration(TaskRepository, IProgressMonitor) line: 274	
	AbstractRepositoryQueryPage2$3.run(IProgressMonitor) line: 328	
	ModalContext$ModalContextThread.run() line: 121
Comment 3 Tomasz Zarna CLA 2013-10-17 11:19:04 EDT
After checking why we need the projects in the first place ([1][2]), I think retrieving @ProjectInfo@s [3] should be enough. All we need is project name.

[1] org.eclipse.mylyn.internal.gerrit.ui.wizards.ProjectNameContentProposalProvider.getProposals(String, int)
[2] org.eclipse.mylyn.internal.gerrit.ui.egit.GerritRepositorySearchPageContentProvider.getProjects(TaskRepository)
[3] https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#list-projects
Comment 4 Tomasz Zarna CLA 2013-10-17 11:20:31 EDT
(In reply to comment #3)
> I think retrieving @ProjectInfo@s [3] should be enough

Let's check that.
Comment 5 Tomasz Zarna CLA 2013-10-17 12:40:31 EDT
Review: https://git.eclipse.org/r/#/c/17469/
Comment 6 Tomasz Zarna CLA 2013-10-18 12:47:57 EDT
Fixed in 7c990859bddb22de782e412087f083a2f90234a7
Comment 7 Tomasz Zarna CLA 2013-10-18 12:48:47 EDT
.
Comment 8 Steffen Pingel CLA 2013-10-18 17:38:36 EDT
Reopening so we can consider for inclusion in 3.10. I'm +1 on this. Sam, Miles, do you have any input?
Comment 9 Sam Davis CLA 2013-10-18 18:09:19 EDT
+1
Comment 10 Miles Parker CLA 2013-10-18 18:10:25 EDT
+1
Comment 11 Steffen Pingel CLA 2013-10-19 02:09:10 EDT
Thanks. I have merged the change on the 3.10.x branch.
Comment 12 Steffen Pingel CLA 2013-10-24 08:20:12 EDT
I also back-ported the change for 3.9.2.