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

Bug 418970

Summary: reams of NPEs logged by SimpleUserCredentialsService on startup
Product: [ECD] Orion Reporter: Rafael Chaves <eclipse>
Component: ServerAssignee: Anthony Hunter <ahunter.eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ken_walker
Version: 4.0   
Target Milestone: 4.0 RC3   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Rafael Chaves CLA 2013-10-08 18:19:57 EDT
Trying to open with 4.0RC1 an workspace that was started with 1.0RC2 leads to dozens (hundreds?) of exceptions like the one below. The server stays up though. Orion 3.0 doesn't complain about the same workspace at all.


!SESSION 2013-10-08 19:11:15.171 -----------------------------------------------
eclipse.buildId=I20131006-2230
java.version=1.6.0_38
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_CA
Command-line arguments:  -os linux -ws gtk -arch x86 -consoleLog -console -data serverworkspace -data repository

This is a continuation of log file /home/rafael/cloudfier/repository/.metadata/.bak_0.log
Created Time: 2013-10-08 19:11:17.666
!SESSION 2013-10-08 19:11:15.171 -----------------------------------------------
eclipse.buildId=I20131006-2230
java.version=1.6.0_38
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_CA
Command-line arguments:  -os linux -ws gtk -arch x86 -consoleLog -console -data serverworkspace -data repository

!ENTRY org.eclipse.equinox.ds 4 0 2013-10-08 19:11:17.667
!MESSAGE Exception occurred while creating new instance of component Component[
	name = org.eclipse.orion.server.user.credentials.simple
	activate = activate
	deactivate = deactivate
	modified = 
	configuration-policy = optional
	factory = null
	autoenable = true
	immediate = true
	implementation = org.eclipse.orion.internal.server.useradmin.simple.SimpleUserCredentialsService
	state = Unsatisfied
	properties = 
	serviceFactory = false
	serviceInterface = null
	references = null
	located in bundle = org.eclipse.orion.server.useradmin.simple_1.0.0.v20131004-1447 [94]
] 
!STACK 0
java.lang.NullPointerException
	at org.eclipse.orion.internal.server.useradmin.simple.SimpleUserProfileNode.get(SimpleUserProfileNode.java:134)
	at org.eclipse.orion.internal.server.useradmin.simple.SimpleUserCredentialsService.createUser(SimpleUserCredentialsService.java:131)
	at org.eclipse.orion.internal.server.useradmin.simple.SimpleUserCredentialsService.initStorage(SimpleUserCredentialsService.java:94)
	at org.eclipse.orion.internal.server.useradmin.simple.SimpleUserCredentialsService.<init>(SimpleUserCredentialsService.java:68)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at java.lang.Class.newInstance0(Class.java:355)
	at java.lang.Class.newInstance(Class.java:308)
	at org.eclipse.equinox.internal.ds.model.ServiceComponent.createInstance(ServiceComponent.java:493)
	at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.createInstance(ServiceComponentProp.java:270)
	at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:331)
	at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
	at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
	at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:473)
	at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:217)
	at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:816)
	at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:783)
	at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)
	at org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:70)
Comment 1 Anthony Hunter CLA 2013-10-09 13:48:19 EDT
(In reply to Rafael Chaves from comment #0)
> Trying to open with 4.0RC1 an workspace that was started with 1.0RC2 leads
> to dozens (hundreds?) of exceptions like the one below. The server stays up
> though. Orion 3.0 doesn't complain about the same workspace at all.

SimpleUserCredentialsService should not be starting at all unless you turn it on. This is fixed with Bug 418621. 

At some point we will want to migrate your Orion storage to the Orion 4.0 format. You are saying you created an Orion storage using 1.0 and have been updated over time using the same storage with 2.0, 3.0 and now 4.0? I should be able to download these builds and test.
Comment 2 Rafael Chaves CLA 2013-10-10 07:19:06 EDT
I dug further trying to reproduce this with a new workspace and turns out it is not triggered by old metadata, but by this setting in orion.conf:

#uncomment this line to use hierarchical user content layout based on user id
orion.file.layout=userTree

I can reproduce this issue with a brand new workspace by having this setting enabled in orion.conf. Once triggered, I can shutdown and comment out the setting again, and the issue will happen in again in following startups.
Comment 3 Anthony Hunter CLA 2013-10-17 16:54:15 EDT
This problem has been resolved by the fixes in:
Bug 419232 [server] MetaStore migration does not handle Orion 0.2 metadata
Bug 419176 [server] Runtime exception thrown with orphan files in the Orion repository