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

Bug 164052

Summary: jira AuthenticationException when synchronizing tasks
Product: z_Archived Reporter: Eugene Kuleshov <ekuleshov>
Component: MylynAssignee: Mik Kersten <mik.kersten>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: simcoen
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Eugene Kuleshov CLA 2006-11-09 21:03:03 EST
This must be a duplicate of another report I filled while back, but I can't find it now. This happens when I tried to open Jira editor for some issue. 
It disappear after I opened repository properties and kicked verify.

-- Error Log --
Date: Thu Nov 09 18:04:58 PST 2006
Message: Could not download report
Severity: Error
Plugin ID: org.eclipse.mylar.core
Stack Trace:
org.tigris.jira.core.service.exceptions.AuthenticationException
at org.tigris.jira.internal.core.service.soap.SoapJiraService.getProjects(SoapJiraService.java:190)
at org.tigris.jira.core.service.CachedRpcJiraServer.initializeProjects(CachedRpcJiraServer.java:192)
at org.tigris.jira.core.service.CachedRpcJiraServer.refreshDetails(CachedRpcJiraServer.java:117)
at org.eclipse.mylar.internal.jira.JiraServerFacade.refreshServerSettings(JiraServerFacade.java:113)
at org.eclipse.mylar.internal.jira.JiraRepositoryConnector.updateAttributes(JiraRepositoryConnector.java:325)
at org.eclipse.mylar.internal.jira.JiraOfflineTaskHandler.downloadTaskData(JiraOfflineTaskHandler.java:75)
at org.eclipse.mylar.tasks.ui.SynchronizeTaskJob.run(SynchronizeTaskJob.java:102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Comment 1 Mik Kersten CLA 2006-11-16 01:23:40 EST
Any ideas as to why we're losing the connection?
Comment 2 Eugene Kuleshov CLA 2006-11-17 19:14:37 EST
Probably login token is expired or something like that...
Comment 3 Mik Kersten CLA 2006-11-22 16:05:11 EST
Also occurrs as: 

org.tigris.jira.core.service.exceptions.AuthenticationException
at org.tigris.jira.internal.core.service.soap.SoapJiraService.getProjectsNoSchemes(SoapJiraService.java:204)
at org.tigris.jira.core.service.CachedRpcJiraServer.initializeProjects(CachedRpcJiraServer.java:193)
at org.tigris.jira.core.service.CachedRpcJiraServer.refreshDetails(CachedRpcJiraServer.java:117)
at org.eclipse.mylar.internal.jira.JiraServerFacade.refreshServerSettings(JiraServerFacade.java:113)
at org.eclipse.mylar.internal.jira.JiraRepositoryConnector.updateAttributes(JiraRepositoryConnector.java:331)
at org.eclipse.mylar.internal.tasks.ui.ScheduledTaskListSynchJob.run(ScheduledTaskListSynchJob.java:99)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Comment 4 Mik Kersten CLA 2006-11-22 16:05:44 EST
*** Bug 165509 has been marked as a duplicate of this bug. ***
Comment 5 Joseph Marques CLA 2006-11-22 16:36:25 EST
This just happened to me for the second time today.
Comment 6 Joseph Marques CLA 2006-11-22 17:15:47 EST
Just an FYI, when this happens you can't click on queries that access that repository anymore.  When you do, you get the AuthenticationException (reported by org.eclipse.mylar.core) put in the error log.

Then, when I right-click on the query and choose synchronize, it doesn't do anything.  It will start the synch, and put a process in the progress view, but when it completes the task list doesn't update and nothing is printed to the error log.

I went to the task repository view and tried to update the properties from the repo, but that resulted in the same AuthenticationException (exception this time reported by org.eclipse.core.jobs).  So I opened the repository and followed the same steps I outlined here - bug#164549 - to "refresh" the credentials.  This seemed to once again do the trick.  Afterwards, I could safely (without error) synchronize the query as well as update the properties.

So, it seems I can pretty consistently recover from this issue by manually re-validating my credentials.  Since Mylar already has my credentials saved, would it be possible to catch these two exceptions, execute the logic behind the "Validate Settings" button, and retry the original action?  If the original action still fails, then there are other problems - but I figure since this strategy has helped me on more than one occassion, maybe it could be leveraged to automatically recover as well.
Comment 7 Joseph Marques CLA 2006-11-23 13:53:23 EST
I let Eclipse run overnight and, as expected, I got the Authentication exception again.

For this test, I had my auto-synch policy set to 15 minutes.  So, give or take a min, this happened very consistently every 11 intervals.  Here are the actual times:

Nov 22 9:44:02
Nov 23 1:28:21
Nov 23 4:13:22
Nov 23 6:58:22
Nov 23 9:43:23
Nov 23 12:28:24

Now, as I mentioned above, I don't think it's odd that I got this error - it was quite expected.  What pertrubs me is the fact that I got it several times without intervening.  So, I can only presume that the connection must have somehow been re-established.  But I can't tell from my rather sparse error log when that reconnection occurs.

Could this be an issue with the underlying Jira Core Services?  I'm running the more recent 0.9.2 version.  I can't recall precisely, but when I started using Mylar I think I was only running 0.9.1 - so unless someone has already pinpointed the issue and is working on it, I'll try reverting back to an older version and see what happens over the next several hours.
Comment 8 Mik Kersten CLA 2006-11-23 20:24:02 EST
That's correct--you should not have an alternate JIRA Core Services installed.  A dev build with 0.9.2 will be available later this evening, and it would be great if you could try it out and post results here.

I have done some additional fixes for this.  If the connection gets dropped you will see a log message in the log, but these should either be rare or never occur.  Let me know how it goes and I'll leave this bug open for the time being.
Comment 9 Mik Kersten CLA 2006-11-23 23:44:10 EST
*** Bug 165733 has been marked as a duplicate of this bug. ***
Comment 10 Mik Kersten CLA 2006-11-24 17:03:11 EST
I'm not seeing this an anymore with the latest dev build, but don't have too many queries.  If anyone else is please post.
Comment 11 Joseph Marques CLA 2006-11-25 21:44:53 EST
I won't get back to my environment until tomorrow.  I'll do additional testing with the latest dev build then, and post my results here.
Comment 12 Joseph Marques CLA 2006-11-27 02:04:06 EST
I've been running the latest fix for a few hours now...so far without issue.  However, I want to go day just to make sure.  If results are still positive by then, I'll post back and this case can be closed.
Comment 13 Joseph Marques CLA 2006-11-27 02:10:32 EST
By the way, for anyone curious (or stupid) enough to revert the Jira Core Services from 0.9.2 to 0.9.1 - don't.  My entire task list was lost.  The eclipse error log had one message for each type of loss, for every loss:

org.eclipse.mylar.core: Tasks may have been lost from JiraIssue <stack trace>
org.eclipse.mylar.core: Tasks may have been lost from BugzillaReport <stack trace>
org.eclipse.mylar.core: Tasks may have been lost from BugzillaQuery <stack trace>
org.eclipse.mylar.core: Tasks may have been lost from JiraJiraCustomQuery <stack trace>
etc...

So, I re-reverted to 0.9.2 and restored my task list from a backup.  
Comment 14 Mik Kersten CLA 2006-11-27 14:08:24 EST
I'm not seeing this with latest dev build.  If others are please comment.

http://www.eclipse.org/mylar/dl.php
Comment 15 Mik Kersten CLA 2006-12-05 12:13:05 EST
Marking resolved, if any of us see this again let's reopen.