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

Bug 421537

Summary: Internal error in HostedStatusDecorator
Product: [ECD] Orion Reporter: John Arthorne <john.arthorne>
Component: ServerAssignee: Mark Macdonald <mamacdon>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ahunter.eclipse
Version: 4.0   
Target Milestone: 5.0 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
sites none

Description John Arthorne CLA 2013-11-12 09:28:44 EST
I20131110-2230

There are many errors in the log on orion.eclipse.org like below. Looks like a null check is needed.


org.json.JSONException: JSONObject["Id"] not found.
        at org.json.JSONObject.get(JSONObject.java:515)
        at org.json.JSONObject.getString(JSONObject.java:686)
        at org.eclipse.orion.internal.server.hosting.HostedStatusDecorator.addStatus(HostedStatusDecorator.java:84)
        at org.eclipse.orion.internal.server.hosting.HostedStatusDecorator.addAtributesFor(HostedStatusDecorator.java:48)
        at org.eclipse.orion.server.servlets.OrionServlet.decorateResponse(OrionServlet.java:96)
Comment 1 Mark Macdonald CLA 2013-11-12 11:40:16 EST
This is probably related to the "zombie sites" issue that Silenio observed. The first 3 sites in his list (which I assume are the migrated ones?) are corrupt and cannot be deleted.
Comment 2 Mark Macdonald CLA 2013-11-12 11:52:30 EST
Created attachment 237401 [details]
sites

Silenio's site list. The first 2 sites are missing the Id field (which is never supposed to happen, and causes the NPE). The NPE causes the decorator to terminate without adding the HostingStatus field, and because of that the Delete button never appears on the sites page.
Comment 3 Anthony Hunter CLA 2013-11-12 14:34:54 EST
(In reply to Mark Macdonald from comment #2)
> Created attachment 237401 [details]
> sites
> 
> Silenio's site list. The first 2 sites are missing the Id field (which is
> never supposed to happen, and causes the NPE). The NPE causes the decorator
> to terminate without adding the HostingStatus field, and because of that the
> Delete button never appears on the sites page.

The missing Id must be a side effect of sites not being migrated properly.
Comment 4 Mark Macdonald CLA 2013-11-12 15:26:01 EST
I fixed the decorator to not crash. Also enabled the "Delete" button on sites whose started/stopped status is unknown.

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=6cf6b91
http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=20554f4

This does not fix the site corruption, but it should allow bad sites to be deleted.
Comment 5 Anthony Hunter CLA 2013-11-12 16:49:46 EST
(In reply to Mark Macdonald from comment #4)
> This does not fix the site corruption, but it should allow bad sites to be
> deleted.

The site corruption during migration is fixed in Bug 421568 .
Comment 6 Mark Macdonald CLA 2013-11-12 16:51:26 EST
OK, marking this bug as FIXED then.