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

Bug 312304

Summary: Add support to MPC to send a notification that a listing was unable to install succesfully
Product: [Technology] MPC Reporter: Nathan Gervais <nathan>
Component: wizardAssignee: David Green <greensopinion>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ian.skerrett
Version: unspecified   
Target Milestone: 1.0.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
mylyn/context/zip none

Description Nathan Gervais CLA 2010-05-10 13:11:47 EDT
This would be similar to Bug 308697, but would allow the MPC to send back information to Marketplace on when a failure occurs along with the error message.

http://marketplace.eclipse.org/node/%/failure

The only outlying question i have here is how would we send back the error message.  Can you send variables via POST?  Or What about JSON data?
Comment 1 David Green CLA 2010-05-10 20:31:29 EDT
The URL is problematic since failure might be related to an attempt to install more than one catalog item simultaneously.

Here's what I suggest:
* provide one URL for reporting errors regardless of nodes
* use an HTTP parameter to indicate which nodes were selected (may have multiple values, similar to how an HTML select multiple works)
* use another HTTP parameter to pass the error message.

The submission would use HTTP POST.  JSON data is unnecessary since we're not passing structured data.

Here's an example of what I propose:
URL: http://marketplace.eclipse.org/install/errorReport?nodes=123&nodes=456&nodes=789&messageText=some+error+message+text

The above example suggests that the parameters would be passed via GET, however I recommend that we use POST instead since the message text may be large and the request has POST semantics.

What do you think?
Comment 2 Nathan Gervais CLA 2010-05-11 09:57:18 EDT
(In reply to comment #1)
> The submission would use HTTP POST.  JSON data is unnecessary since we're not
> passing structured data.
> 
> Here's an example of what I propose:
> URL:
> http://marketplace.eclipse.org/install/errorReport?nodes=123&nodes=456&nodes=789&messageText=some+error+message+text
> 
> The above example suggests that the parameters would be passed via GET, however
> I recommend that we use POST instead since the message text may be large and
> the request has POST semantics.
> 
> What do you think?

-  HTTP POST Variable names can only be used in a POST once.  Multiple Instances of 'nodes' would just end up with one value.

-  Since were sending along the error message which can be quite long, the max length of a url is ~2000 characters, while long would probably rival some Eclipse error messages i've seen.  I think JSON is a better way to wrap the data.
Comment 3 Ian Skerrett CLA 2010-05-11 14:16:11 EDT
We need to figure out a way for the client to send back which plugin failed.   I just don't know how the server will be able to parse a number of error messages and make sense of it.

btw, for the embedded browser install we will need the same thing.
Comment 4 David Green CLA 2010-05-11 20:23:44 EDT
(In reply to comment #2)
> -  HTTP POST Variable names can only be used in a POST once.  Multiple Instances
> of 'nodes' would just end up with one value.

When an HTML select multiple is used, variable names appear in the post data as many times as there are selections.  This occurs regardless of GET versus POST.  Perhaps you can elaborate on what you mean.

> -  Since were sending along the error message which can be quite long, the max
> length of a url is ~2000 characters, while long would probably rival some
> Eclipse error messages i've seen.  I think JSON is a better way to wrap the
> data.

This issue is moot if we use POST, since POST data is in the request body, not the URL.


(In reply to comment #3)
> We need to figure out a way for the client to send back which plugin failed.   I
> just don't know how the server will be able to parse a number of error messages
> and make sense of it.

Agreed, though the cause of any particular error might be related to more than one selected solution.  For example, if two selections are made that conflict with each other, we'll see an error.

> btw, for the embedded browser install we will need the same thing.

Of course.
Comment 5 David Green CLA 2010-05-12 17:49:21 EDT
I've pushed a candidate implementation of this feature, which will first appear in this build: https://build.eclipse.org/hudson/job/epp-mpc-nightly/64/

Here's how it works:
* an HTTP request is performed (using POST) to http://marketplace.eclipse.org/install/errorReport
* parameters are passed to indicate the details, as follows:
** @status@ the status, corresponds to the severity of @IStatus@ (usually 4 to indicate an error)
** @statusMessage@ the text of the brief message as provided by p2
** @node@ the id(s) of the node(s) involved, may have multiple values
** @iu@ the iu(s) and their versions involved.  Provided as the id of the IU, followed by a comma, followed by the version of the IU as it exists on a p2 repository (update site).  (example, com.example.foobar.feature.group,2.3.2123.I20031004)
** @detailedMessage@ the detailed error message as provided by p2

An example of some values that you might see:
* status=4
* statusMessage=Operation details
* node=483
* iu=ch.hsr.ifs.cute.feature.group,3.0.0.201005061337
* iu=ch.hsr.ifs.cute.headers.1_6.feature.group,1.1.3.201005061337
* detailedMessage=Cannot complete the install because one or more required items could not be found.
  Software being installed: Cute C++ Unit Testing Easier 3.0.0.201005061337 (ch.hsr.ifs.cute.feature.group 3.0.0.201005061337)
  Missing requirement: Cute C++ Unit Testing Easier 3.0.0.201005061337 (ch.hsr.ifs.cute.feature.group 3.0.0.201005061337) requires 'org.eclipse.cdt.debug.core [6.0.0,7.0.0)' but it could not be found]

Notice that in this example multiple ius are provided since the selected node involves multiple features

It's intended to provide as much information as possible to the server.  If you'd like to see it modified in any way to better suit your needs, please reopen this bug.
Comment 6 David Green CLA 2010-05-12 17:49:29 EDT
Created attachment 168283 [details]
mylyn/context/zip
Comment 7 Ian Skerrett CLA 2010-05-13 16:31:48 EDT
(In reply to comment #5)
Can you provide an example where multiple nodes we selected to install and then what is returned if one or multiple fail to install.  Specifically, if multiple node ids are selected will just the node id(s) that fail be returned.  
> 
> An example of some values that you might see:
> * status=4
> * statusMessage=Operation details
> * node=483
> * iu=ch.hsr.ifs.cute.feature.group,3.0.0.201005061337
> * iu=ch.hsr.ifs.cute.headers.1_6.feature.group,1.1.3.201005061337
> * detailedMessage=Cannot complete the install because one or more required
> items could not be found.
>   Software being installed: Cute C++ Unit Testing Easier 3.0.0.201005061337
> (ch.hsr.ifs.cute.feature.group 3.0.0.201005061337)
>   Missing requirement: Cute C++ Unit Testing Easier 3.0.0.201005061337
> (ch.hsr.ifs.cute.feature.group 3.0.0.201005061337) requires
> 'org.eclipse.cdt.debug.core [6.0.0,7.0.0)' but it could not be found]
> 
> Notice that in this example multiple ius are provided since the selected node
> involves multiple features
> 
> It's intended to provide as much information as possible to the server.  If
> you'd like to see it modified in any way to better suit your needs, please
> reopen this bug.
Comment 8 David Green CLA 2010-05-14 11:32:54 EDT
If multiple nodes are selected you'll see multiple values for the node parameter.  eg:

* node=123
* node=456

We have no way of knowing if the install is not possible due to conflicts between the selected items or because only one of them fails.  

Currently we send all of the available information to the server so that you can decide how best to deal with the information there.  This will allow you to modify your error reporting policies after MPC is widely deployed.
Comment 9 Nathan Gervais CLA 2010-05-26 12:56:06 EDT
I've added the error handler to the site.

Please use this url.  http://marketplace.eclipse.org/install/error/report.  The Post variable names you've suggested in Comment 5 were all used.
Comment 10 David Green CLA 2010-05-28 12:06:43 EDT
URL needs to be changed
Comment 11 David Green CLA 2010-05-28 19:30:48 EDT
URL changed
Comment 12 Nathan Gervais CLA 2010-06-10 13:56:30 EDT
(In reply to comment #11)
> URL changed

What build did this URL change go into.

I'm worried because Marketplace is not receiving any error reports at all.

Could you also explain when this is triggered?
Comment 13 Nathan Gervais CLA 2010-06-10 13:56:42 EDT
Forgot to Reopen.
Comment 14 David Green CLA 2010-06-10 22:15:44 EDT
Error reports are posted to http://marketplace.eclipse.org/install/error/report for the Eclipse marketplace.  I managed to cause one just now by selecting *Oracle Enterprise Pack for Eclipse - tech preview*.  The error text on my side was as follows:

pre. 
Cannot complete the install because one or more required items could not be found.
  Software being installed: Oracle Enterprise Pack for Eclipse 1.5.0.201003261013 (oracle.eclipse.tools.helios.oepe.product.feature.group 1.5.0.201003261013)
  Missing requirement: Oracle DB Tools UI 3.0.0.201003261013 (oracle.eclipse.tools.database.ui 3.0.0.201003261013) requires 'bundle org.eclipse.datatools.sqltools.data.ui [1.1.2,1.2.0)' but it could not be found
  Cannot satisfy dependency:
    From: Oracle Database Tools 1.5.0.201003261013 (oracle.eclipse.tools.helios.database.feature.group 1.5.0.201003261013)
    To: oracle.eclipse.tools.database.ui [3.0.0.201003261013]
  Cannot satisfy dependency:
    From: Oracle Enterprise Pack for Eclipse 1.5.0.201003261013 (oracle.eclipse.tools.helios.oepe.product.feature.group 1.5.0.201003261013)
    To: oracle.eclipse.tools.helios.database.feature.group [1.5.0.201003261013]
    
I stepped through the code and confirmed that the error report was submitted.  Please let me know if it didn't come through on your end.
Comment 15 Nathan Gervais CLA 2010-06-11 10:05:41 EDT
I'm getting error reports now but some of the fields arent coming through,  would you be able to capture the URL of one of the reports you are sending so i can debug it on my end
Comment 16 David Green CLA 2010-06-11 11:23:52 EDT
Nathan, parameters are passed as the body of the POST... so the URL is as provided in comment #14.  What parameters are you expecting bug not seeing?
Comment 17 Nathan Gervais CLA 2010-06-11 11:31:16 EDT
detailedMessage
iu
node

These fields are not being captured by my script.
Comment 18 Nathan Gervais CLA 2010-06-11 12:12:22 EDT
From a quick look it appears that the data is coming into the post variables.  Leaving this as Resolved.
Comment 19 Nathan Gervais CLA 2010-09-21 12:18:28 EDT
We've started doing a bit more with this data.

One thing that strikes me as odd tho is the @status@ info that comes through is _always_ 4.   What does this even mean?  Should we even bother sending / storing this data?