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

Bug 419176

Summary: [server] Runtime exception thrown with orphan files in the Orion repository
Product: [ECD] Orion Reporter: Anthony Hunter <ahunter.eclipse>
Component: ServerAssignee: Anthony Hunter <ahunter.eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: john.arthorne
Version: 4.0Flags: john.arthorne: review+
Target Milestone: 4.0 RC2   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Anthony Hunter CLA 2013-10-10 14:31:37 EDT
Use the new simple metadata storage and toss a file like ls.txt into /serverworkspace/ls.txt. When the server starts, a call to readAllUsers() results in a runtime exception. This is too aggressive a response, a simple warning would suffice and continue on.

!ENTRY org.eclipse.core.jobs 4 2 2013-10-10 14:25:36.839
!MESSAGE An internal error occurred during: "Indexing".
!STACK 0
java.lang.RuntimeException: Meta File Error, root contains invalid metadata:/serverworkspace at ls.txt
	at org.eclipse.orion.internal.server.core.metastore.SimpleMetaStoreUtil.listMetaUserFolders(SimpleMetaStoreUtil.java:335)
	at org.eclipse.orion.internal.server.core.metastore.SimpleMetaStore.readAllUsers(SimpleMetaStore.java:354)
	at org.eclipse.orion.internal.server.search.Indexer.run(Indexer.java:283)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Comment 1 Anthony Hunter CLA 2013-10-10 15:12:48 EDT
I have fixed the orphan folders case as well.

2013-10-10 15:07:41.372 [Worker-0] WARN  org.eclipse.orion.server.config - Meta File Error, root contains invalid metadata:/workspace/foo/zz at zz
2013-10-10 15:07:41.373 [Worker-0] WARN  org.eclipse.orion.server.config - Meta File Error, root contains invalid metadata:/workspace/foo/A at B
2013-10-10 15:07:41.374 [Worker-0] WARN  org.eclipse.orion.server.config - Meta File Error, root contains invalid metadata:/workspace/foo/ls.txt at ls.txt

The fix is at commit:
http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?h=ah-Bug419176&id=dc6ea07f4ed771843f1c79a6c9b68b75d8518a02
Comment 2 John Arthorne CLA 2013-10-10 15:56:40 EDT
Looks good. Not as urgent but we should have some tests for these kinds of scenarios. I.e., place a bunch of bogus files on disk in places where we expect metadata and make sure it doesn't trip us up. Also metadata files that have correct names but JSON syntax errors for example. Printing warnings in the log is good but we should be resilient to corrupt metadata in all forms.
Comment 3 Anthony Hunter CLA 2013-10-10 16:29:12 EDT
(In reply to Anthony Hunter from comment #1)
> The fix is at commit:
> http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?h=ah-
> Bug419176&id=dc6ea07f4ed771843f1c79a6c9b68b75d8518a02