Wednesday, January 20, 2010

fatal error C1902: Program database manager mismatch; please check your installation

fatal error C1902: Program database manager mismatch; please check your installation

Build/Test automation of VC2005 project fails with the above error message in case automation scripts is having logic of *nix-win communication over ssh.

*nix ssh client connects to cygwin ssh server and executes make which uses CL(VC2005 compiler). Run fails with the error message in the subject line.
As evident from the link below.

Workaround at the link above made our day and solved the issue.
Workaround: Run cygwin ssh server with the same user as that of *nix user through which one is connecting over ssh.

In our case user in question was "build". So we ran cygwin ssh server with "build" user and had *nix user as "build" to connect over ssh for script run.

By default cygwin ssh server run with user as LocalSystem Account. To make it run with "build" user we followed the steps below.

Create a user "build" with Administrative privilege on cygwin box.

Steps to run cygwin ssh server with "build" user.

1. Change the login ID of the Cygwin sshd service.

- From the Windows Start menu, click Settings > Control Panel > Administrative Tools > Services.

- From the Services window, right-click CYGWIN sshd, and select Properties.

- From the Properties window, select the General tab, and click Stop to stop the sshd service.

Next, select the Log on tab, Under the Log on as section or prompt, clear the Local System account radio button, and select This account. Type .\build as the ID and type the password for the account. Click Apply.

2. Grant additional rights to the build account so that "build" user has required privileges in addition to membership to the Administrators group.

- From the Windows Start menu, click Settings > Control Panel > Administrative Tools > Local Security Policy.

- From the Local Security Settings window, expand Local Policies, and select User Rights Assignment.

- From the resulting page that appears on the right, verify that the root account has the following four rights:
* Adjust memory quotas for a process
* Create a token object
* Log on as a service
* Replace a process level token
If not, add "build" as a user with the four rights.

For Win2000, the first item in the list above is displayed as Increase quotas instead of Adjust memory quotas for a process.
* Close Local Security Settings window.

3. From a Cygwin console panel, change ownership of the following directories and files to build:

* $ chown build /var/log/sshd.log
* $ chown -R build /var/empty
* $ chown build /etc/ssh*

4. Restart the Cygwin sshd server.

- From the Properties page of the Cygwin sshd server, select the General tab, and click Start. Verify that Cygwin is now running under the build user account.

- OR From cygwin prompt say $net start sshd.

Thanks to the IBM Knowledge Base for the above solution.


Bill Lowrey said...

Thanks VERY much for posting this! I had the same problem, but with Visual Studio 2010. This solved the problem in that environment, too.

In addition, I also tried some advice I found for VS2005 and VS2008 with VS2010 and removed an extra (different) version of mspdb100.dll from VC/bin, but that did not solve the problem.

Anonymous said...

Really Gr8 ! Thanks For sharing..

Anonymous said...

Another thank you! This problem had me stuck for days. Best regards, and thanks again.

Anonymous said...

I was very happy to find someone else had run into this exact same issue and highly doubt I would have figured it out without much trial and tribulation if not for this post.


Beekeeper said...

You're Genius! Thanks you!


Anonymous said...

Thanks! I spent nearly a week chasing PATH and ENV differences with VS2010 on Windows 2008 server R2, only to conclude that the problem had to be something in the login session. Yours was the first hit once I knew what to look for, and it worked like a charm the first time :).

Tom Rushworth

Ariel Sommeria-Klein said...

great help still 2 years down the line :-) thanks