views:

34

answers:

1

We have an Nant build script that we are running through SSH (Cygwin & Open SSH) to remotely upgrade our databases. When the Nant script is launched through an SSH session, the following error is thrown when it attempts to make a database connection. However, if I log in to the server directly (using the same account as the service) and run the Nant scripts by hand, the script executes successfully.

Error Message:

System.InvalidOperationException: The .Net Framework Data Providers require Microsoft Data Access Components(MDAC). Please install Microsoft Data Access Components(MDAC) version 2.6 or later. ---> System.IO.FileNotFoundException: Retrieving the COM class factory for component with CLSID {2206CDB2-19C1-11D1-89E0-00C04FD7A829} failed due to the following error: 8007007e.

Stack Trace:

System.InvalidOperationException: The .Net Framework Data Providers require Microsoft Data Access Components(MDAC). Please install Microsoft Data Access Components(MDAC) version 2.6 or later.
---> System.IO.FileNotFoundException: Retrieving the COM class factory for component with CLSID {2206CDB2-19C1-11D1-89E0-00C04FD7A829} failed due to the following error: 8007007e.
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Data.OleDb.OleDbConnectionInternal.CreateInstanceDataLinks()
at System.Data.OleDb.OleDbConnectionInternal.GetObjectPool()
--- End of inner exception stack trace ---
at System.Data.OleDb.OleDbConnectionInternal.GetObjectPool()
at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()
at UpgradeDatabases.UpgradeDatabase.Execute()

After spending lots of time trying to track down the cause, I am stuck. Here are some observations I have made:

  • The script runs perfectly when I run it manually on the same machine (without SSH). I can even run the script manually, with the same user that the SSH service is running under.
  • Since the Nant script is running under the context of a service, the issue seems to be related to the User Profile.
  • The script is executing on a Windows 2008 Server with .NET 3.5 installed. I wouldn't assume that MDAC would be a problem here as the exception indicates
  • One site states that it might be related to UPHClean (which is a part of the User Profile Service in Windows Server 2008). I haven't been able to confirm that this is actually the problem. I looked in the Event Viewer for Event ID 1530 and there are a few occurrences, but they don't correlate with each execution of the build script.
  • I installed the native OleDb providers for SQL Server 2008 and the same error occurs.

Does anyone have any advice on how I can track down the root cause of this issue? It really seems to be related to the fact that the code is running under the context of a service. I've used Procmon to try to trace through the execution, but I haven't had any luck finding the culprit. Thanks in advance!

A: 

The problem was definitely related to Cygwin + OpenSSH. I ended up installing WinSSHD and my issue was resolved. So for future reference, be wary of Cygwin + OpenSSH running on Windows Server 2008. I hope this helps!

Page Brooks