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

Bug 332747

Summary: Repository keeps losing the password
Product: z_Archived Reporter: Andrew Gvozdev <angvoz.dev>
Component: MylynAssignee: Steffen Pingel <steffen.pingel>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bugs.eclipse.org, robert.elves, shawn.minto
Version: dev   
Target Milestone: 3.6.2   
Hardware: All   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
mylyn/context/zip none

Description Andrew Gvozdev CLA 2010-12-16 10:24:40 EST
I defined a bugzilla repository for eclipse.org and it keeps losing my credentials. I set  my user Id and Password in repository properties and have "Save Password" checked. Despite that, once in a while the credentials get lost. I normally keep eclipse always on and it can be on for a week. It never loses password while on. But sometimes I have to do an update of eclipse or reboot my laptop and in this case user id and password could get lost and I have to enter them again. It does not happen always. I had this problem today in the morning and then I tried to reproduce it again but couldn't. 

I don't know if it is related but I noticed that when it happens mylyn tasks lose domain part of user ids, i.e. "mylyn-inbox@eclipse.org" becomes plain "mylyn-inbox". If I synchronize the task it gets fixed.

I am using Windows 7 now and I was using Windows XP until recently and had the same problem. Also I had the same problem with our internal bugzilla repository in different workspace. It's been going on for a few months by now. I try to keep my Mylyn up to date and normally upgrade from nightly upgrade site once a week or two.
Comment 1 Steffen Pingel CLA 2010-12-16 11:02:33 EST
Shawn, what is the default location for the keystore on Windows?

Andrew, what you could try to do is explicitly specifying the keystore location either through the command line or eclipse.ini (arguments have to be on separate lines: -keystore c:\eclipse.keystore .
Comment 2 Shawn Minto CLA 2010-12-16 12:06:13 EST
The default location for the keystore is in the Eclipse configuration directory.  This means that if there is any reason that it is cleared or eclipse is unable to write to the directory, you can loose all of your passwords.  Using the -keystore is a great way to ensure that even when upgrading Eclipse versions that you do not need to re-enter passwords.
Comment 3 Andrew Gvozdev CLA 2010-12-16 15:48:04 EST
(In reply to comment #2)
> The default location for the keystore is in the Eclipse configuration directory.
> This means that if there is any reason that it is cleared or eclipse is unable
> to write to the directory, you can loose all of your passwords.  Using the
> -keystore is a great way to ensure that even when upgrading Eclipse versions
> that you do not need to re-enter passwords.
Hmm, I am also used to start eclipse with -clean option after PermGen crash or eGit hanging on my big repo. Wonder if that could clear the directory. It does not clean my other settings. If it does clean - it does not do it every time though. Let me try -keystore even if it does not sound that great to me . For my work I create and remove workspaces often and requiring to remember another switch rubs me the wrong way. Also, I don't understand why upgrading eclipse versions should require re-entering passwords by default.
Comment 4 Steffen Pingel CLA 2010-12-27 14:44:22 EST
Thanks for getting back. Please try the -keystore option. I'll mark this as resolved but feel free to reopen if the suggested solution does not address the described problem.
Comment 5 Andrew Gvozdev CLA 2010-12-27 15:22:12 EST
The -keystore option did not appear to have any observable effect. The directory where it points is empty. Could you refer to any doc how to use it? I don't see it in eclipse docs http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html.
Comment 6 Steffen Pingel CLA 2010-12-30 06:07:32 EST
It's a deprecated option but should still work. You have to point it to a file though and not a directory.
Comment 7 Andrew Gvozdev CLA 2010-12-30 15:15:26 EST
From my standpoint the suggested solution does not resolve the issue. The reported issue is that bugzilla repository keeps losing the password after default eclipse installation. My points are:
- Mainly - and this is the point of this bug - I think it should work out of the box normally without requiring any workaround.
- Secondly (and I emphasize that it is not the main point) the suggested workaround is frankly inadequate. You ask to use deprecated and undocumented option. The option -keystore does not work for me neither as a file nor directory and I cannot find any hints on google either. The best my guess at that point is that I need to generate the keystore by some third party tool first, is it so? This is way too cumbersome for the task IMO.

(In reply to comment #4)
> Thanks for getting back. Please try the -keystore option. I'll mark this as
> resolved but feel free to reopen if the suggested solution does not address the
> described problem.
I'd like to re-use this invitation to reopen the task hoping that this comment makes the complain more specific.
Comment 8 Andrew Gvozdev CLA 2011-01-21 11:07:56 EST
Had one more occurrence of losing credentials yesterday. Yesterday I updated egit, also egit crashed on me and some other possible factors. Tried today to reproduce it with another egit update, killing eclipse etc. but the password stays firm. Will try more on next occasion.
Comment 9 Andrew Gvozdev CLA 2011-06-28 13:44:24 EDT
Still happening to me. I noticed that it happens when I create a new workspace. So it goes:

1. Open eclipse and check Eclipse.org repository credentials. User ID and password are in place, "Validate Settings" is OK with the credentials.
2. Start another instance of eclipse and create a new workspace with the "Select a workspace" launch dialog.
3. Check Eclipse.org credentials in the first instance of eclipse. They are gone.

  Mylyn Commons	3.6.0.v20110608-1400	org.eclipse.mylyn.commons.feature.group	Eclipse Mylyn
Comment 10 Steffen Pingel CLA 2011-08-11 07:49:38 EDT
Thanks for the steps. I am tentatively putting this on for 3.6.2 to investigate further.
Comment 11 Steffen Pingel CLA 2011-08-27 19:21:57 EDT
I think I have found the problem. TasksUiPlug.loadTemplateRepositories() resets credentials when it creates pre-defined repositories that are configured for anonymous access (such as Eclipse.org) which explains the behavior described in comment 9:

	if (template.anonymous) {
		taskRepository.setCredentials(AuthenticationType.REPOSITORY, null, true);
	}

I have committed a fix to the master and e_3_7_m_3_7_x branch. This fix will be available in the 3.6.2 (Indigo SR1) release and next weekly build. 

As a work around you can configure a keyring per workspace. I accidentally suggested the wrong command line options in comment#1. The right ones are:

 -keyring <keyring file>
 -password <password>

Both have to be used together.
Comment 12 Steffen Pingel CLA 2011-08-27 19:22:01 EDT
Created attachment 202273 [details]
mylyn/context/zip
Comment 13 Andrew Gvozdev CLA 2011-09-01 14:25:51 EDT
Thanks, the fix seems to be working.