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

Bug 269803

Summary: improve error message in case of missing Bugzilla_login cookie
Product: z_Archived Reporter: Daniel <daniel.brugger>
Component: MylynAssignee: Frank Becker <eclipse>
Status: RESOLVED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: steffen.pingel
Version: unspecified   
Target Milestone: 3.11   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 268207, 359210    
Attachments:
Description Flags
patch
none
mylyn/context/zip
none
next version
none
mylyn/context/zip
none
mylyn/context/zip
none
mylyn/context/zip
none
mylyn/context/zip
none
mylyn/context/zip
none
mylyn/context/zip none

Description Daniel CLA 2009-03-24 06:26:36 EDT
Build ID: M20090211-1700

Steps To Reproduce:
1. Setup an environment where Bugzilla server sits behind a Web Entry Server and the "Bugzilla_login" cookie does not reach the client (Eclipse). (Note: The setup can also be done by using 'Paros' proxy or similar, of course)
2. Eclipse: Try to setup a Task Repository: enter server URL and user credentials.
3. Click "Validate Settings".
4. An error appears "A repository error has occurred" but not telling what the cause of the problem is.


More information:
If a Web Entry Server acts as a cookie store, the Bugzilla cookies are not sent to the client (Eclipse). But Eclipse / Mylyn validates the Bugzilla session by the presence of the "Bugzilla_login" cookie. 

This bug just asks to improve the error message and to give more error details to the end user.
Comment 1 Frank Becker CLA 2009-03-24 18:25:28 EDT
Created attachment 129769 [details]
patch
Comment 2 Frank Becker CLA 2009-03-24 18:25:31 EDT
Created attachment 129770 [details]
mylyn/context/zip
Comment 3 Robert Elves CLA 2009-03-30 17:56:03 EDT
Since if a token isn't present this always represents a failure to log in (not an exceptional case)  we should test that the web page returned says we're logged in but we don't get a token.  I'd like to keep this simple though (i.e. maybe a global token received field combined with a test in the parse error method) thoughts?
Comment 4 Frank Becker CLA 2009-05-21 15:40:43 EDT
Created attachment 136711 [details]
next version

(In reply to comment #3)
> Since if a token isn't present this always represents a failure to log in (not
> an exceptional case)  we should test that the web page returned says we're
> logged in but we don't get a token.  I'd like to keep this simple though (i.e.
> maybe a global token received field combined with a test in the parse error
> method) thoughts?

Rob, what do you think about this way for fixing the problem.
Comment 5 Frank Becker CLA 2009-05-21 15:40:57 EDT
Created attachment 136712 [details]
mylyn/context/zip
Comment 6 Robert Elves CLA 2009-08-10 18:39:25 EDT
(In reply to comment #4)
> Rob, what do you think about this way for fixing the problem.
Frank this looks like the right idea.  What if instead of looking for the 'bugzilla main page' we test for absense of the GoAheadAndLogIn=1 text within the page? This way we might have less failures for customized bugzillas out of the box?  This might need to move out of the error parsing though.  Thoughts?

"You have been logged in but the cookie was not found. Please retry operation."    could read:   "An authentication cookie was not issued by repository. Check repository credentials and retry." 
Comment 7 Steffen Pingel CLA 2011-09-28 08:55:29 EDT
Frank, can you update the patch based on Rob's comment?
Comment 8 Frank Becker CLA 2012-03-02 14:07:38 EST
create http://review.mylyn.org/352
Comment 9 Frank Becker CLA 2012-03-02 14:07:42 EST
Created attachment 211997 [details]
mylyn/context/zip
Comment 10 Steffen Pingel CLA 2012-03-02 14:25:14 EST
This looks reasonable but I would like to keep the cookie check. We should only parse the page if the cookie is not found.
Comment 11 Frank Becker CLA 2012-03-02 15:47:08 EST
Steffe,

here is Patchset 4 http://review.mylyn.org/#change,352,patchset=4
Comment 12 Steffen Pingel CLA 2012-03-02 18:01:56 EST
That looks good. We would just need a test case to verify that the parsing works as expected.
Comment 13 Frank Becker CLA 2012-03-03 14:20:07 EST
(In reply to comment #12)
> That looks good. We would just need a test case to verify that the parsing works
> as expected.

I create a new review http://review.mylyn.org/#change,357 because I recreate the way to solve this during junit creation.
Comment 14 Frank Becker CLA 2012-03-03 14:20:09 EST
Created attachment 212033 [details]
mylyn/context/zip
Comment 15 Steffen Pingel CLA 2012-03-03 15:12:46 EST
Makes sense to do that as part of the standard parsing but this doesn't look right to me. It would seem perfectly valid that the GoAheadAndLogin token is part of the response in case of anonymous access for instance?
Comment 16 Frank Becker CLA 2012-03-04 01:49:00 EST
The changes are in parseRepositoryResponse and used in parseHtmlError (TaskID is null) and parsePostResponse (use TaskID).

parseRepositoryResponse use 
* Tag.TITLE 
* Tag.TD with id = error_msg
and now new
* Tag.A with attribute href contains GoAheadAndLogIn=1

So I did not see where we should use parseRepositoryResponse and did not use it.
Comment 17 Steffen Pingel CLA 2012-03-07 05:48:52 EST
I am worried that the code detects an error in a case where the GoAheadAndLogin tag is legitimate. Let's apply this to master and refactor the code so we can make the error parsing more flexible.
Comment 18 Frank Becker CLA 2012-03-10 12:29:00 EST
(In reply to comment #17)
> I am worried that the code detects an error in a case where the GoAheadAndLogin
> tag is legitimate. Let's apply this to master and refactor the code so we can
> make the error parsing more flexible.

Should we parse the whole response and build the result from all three cases
• Tag.TITLE
• Tag.TD with id = error_msg
• Tag.A with attribute href contains GoAheadAndLogIn=1

So we can build an priority in which order we report the errors

Thoughts?
Comment 19 Steffen Pingel CLA 2012-03-10 16:01:18 EST
Yes, that sounds like a good idea.
Comment 20 Frank Becker CLA 2012-03-18 10:37:11 EDT
(In reply to comment #19)
> Yes, that sounds like a good idea.

I create the review http://review.mylyn.org/#change,376 with the new implementation.
Comment 21 Frank Becker CLA 2012-03-18 10:37:16 EDT
Created attachment 212832 [details]
mylyn/context/zip
Comment 22 Frank Becker CLA 2012-05-12 09:14:38 EDT
Review is now  here. https://git.eclipse.org/r/5958
Comment 23 Frank Becker CLA 2013-05-09 16:15:25 EDT
create new patch set
Comment 24 Frank Becker CLA 2013-05-09 16:15:32 EDT
Created attachment 230752 [details]
mylyn/context/zip
Comment 25 Frank Becker CLA 2013-05-21 12:30:55 EDT
new patch set 4 created.
Comment 26 Frank Becker CLA 2013-05-21 12:31:01 EDT
Created attachment 231267 [details]
mylyn/context/zip
Comment 27 Frank Becker CLA 2013-10-11 05:53:47 EDT
move the target milestone to 3.11.

Need to recreate the patch after we have merged the review

 414360: add support for the new REST API (Bugzilla 5.0) create AbstractBugzillaClient (refactor) 
  (https://git.eclipse.org/r/#/c/17206/)
Comment 28 Sam Davis CLA 2014-02-05 14:57:33 EST
Should we move this to the backlog?
Comment 29 Steffen Pingel CLA 2014-02-05 16:58:43 EST
Maybe we could just close this and worry about about improved error handling as part of the REST connector design?
Comment 30 Frank Becker CLA 2014-02-06 13:41:49 EST
(In reply to Steffen Pingel from comment #29)
> Maybe we could just close this and worry about about improved error handling
> as part of the REST connector design?

We will address this in the REST implementation.