Master Data Services 2019 - Derived Hierarchy issue - sql-server

I've been facing an issue with a Master Data Services (MDS) derived hierarchies. At first the hierarchy worked fine but after some time (do not know how long) I am not able to load the MDS data via Excel with MDS 2019 Add-in. I am receiving an error "Exception from HRESULT: 0x800A03EC". If an attribute which is filtered by the derived hierarchy is excluded from the load, the data is loaded just fine.
I believe that that the issue will not be related to MDS since it's working fine via Web Application. Moreover, two of my colleagues does not have this issue.
I know that the error code is related to "NAME_NOT_FOUND" but I do not use any explicit formulas starting with "=". So I believe that Excel is not able to find some function/object of the MDS Add-in.
I tried to reinstall the whole Office 365 and MDS Add-in for Excel but the issue still persists. I've also compare app versions with my colleagues and the versions are the same.
I also tried to disable the error checking for formulas within Excel options: Options-->Formulas with no success.
App versions:
Microsoft SQL Server 2019 MDS Add-in for Excel 15.0.2000.5
Microsoft® Excel® for Microsoft 365 MSO (Version 2110 Build 16.0.14527.20234) 64-bit
MDS database located on Microsoft SQL Server 2016 (SP2-CU17) (KB5001092) - 13.0.5888.11 (X64) Enterprise - Server A
MDS 2019 service - Server B
Results from tracing:
MDS Warning and Error tracing on the server:
Time,CorrelationId,Operation,Level,Message
11/11/2021 16:42:18,00000000-0000-0000-0000-000000000000,Unknown,Start,"Service started successfully, Assembly version: 15.0.0.0, file version: 15.0.4178.1"
11/11/2021 16:42:18,00000000-0000-0000-0000-000000000000,Unknown,Error,"ApiContractVersion: 8000"
Excel Add-in MDS log:
2021-11-11T16:19:37.269 28856 EXCEL.EXE EXCEL.EXE Generic EventType: Error, Message: DataView.DoOperationAsync failed. Exception: 'System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
at Microsoft.MasterDataServices.ExcelAddInCore.DataView.<>c__DisplayClass84_0.<LoadData>b__4(IAsyncResult ar)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)'
2021-11-11T16:19:37.270 28856 EXCEL.EXE EXCEL.EXE Generic EventType: Error, Message: DataView.LoadData failed. Exception: 'System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
at Microsoft.MasterDataServices.ExcelAddInCore.DataView.<>c__DisplayClass84_0.<LoadData>b__4(IAsyncResult ar)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)'.
2021-11-11T16:19:37.356 2444 EXCEL.EXE EXCEL.EXE Generic EventType: Error, Message: ExceptionMessageBoxShown#Exception from HRESULT: 0x800A03EC
2021-11-11T16:19:37.356 2444 Unknown Unknown Generic EventType: Information, Message: System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
at Microsoft.MasterDataServices.ExcelAddInCore.DataView.<>c__DisplayClass84_0.<LoadData>b__4(IAsyncResult ar)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
2021-11-11T16:19:38.724 2444 EXCEL.EXE EXCEL.EXE Generic EventType: Information, Message: ExceptionMessageBoxClosed#Exception from HRESULT: 0x800A03EC
2021-11-11T16:19:40.343 28856 EXCEL.EXE EXCEL.EXE Generic EventType: Information, Message: Operation BeginInternalLoadData ended at: 11/11/2021 16:19:40. Duration = 00:00:03.8691037
I would be grateful for your opinion and potential solution.

Related

Error when importing snapshot to SQL Server 2019

There is an Error when I want to import data from a snapshot(bacpac) file into SQL Server 2019.
It has occur twice on my two different PC.
Please help me if there is any solution about that.
Thank you very much!
Error :
Error Details :
Here are the error details:
===================================
Object reference not set to an instance of an object. (Microsoft.Data.Tools.Schema.Sql)
Program Location:
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentPlanGenerator.DeploymentScriptDomGenerator.GenerateFragment(Int32 operation, IModelElement element)
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentPlanGenerator.DeploymentScriptDomGenerator.GenerateSteps(Int32 operation, IModelElement element)
at Microsoft.Data.Tools.Schema.Sql.Deployment.OrderedStepGenerator.Add(DeploymentScriptDomGenerator scriptDom, IModelElement element, Int32 operation)
at Microsoft.Data.Tools.Schema.Sql.Deployment.Analyzers.PlanMediator.BuildDependencyOrderedSteps(Int32 operation, List1 classOrder, List1 operationOrder, Dictionary2 changes, Boolean preserveGraphs, Dictionary2& relating, Dictionary2& related)
at Microsoft.Data.Tools.Schema.Sql.Deployment.Analyzers.PlanMediator.BuildOperations()
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentPlanGenerator.OnGeneratePlan()
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentPlanGenerator.GeneratePlan(List1 drops)
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.BuildPlan()
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.Controller.CreatePlan()
at Microsoft.SqlServer.Dac.DeployOperation.<>c__DisplayClass3.<>c__DisplayClass5.b__1()
at Microsoft.Data.Tools.Schema.Sql.Dac.OperationLogger.Capture(Action action)
at Microsoft.SqlServer.Dac.DeployOperation.<>c__DisplayClass3.b__0(Object operation, CancellationToken token)
at Microsoft.SqlServer.Dac.Operation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
at Microsoft.SqlServer.Dac.ReportMessageOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
at Microsoft.SqlServer.Dac.OperationExtension.CompositeOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
at Microsoft.SqlServer.Dac.OperationExtension.CompositeOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
at Microsoft.SqlServer.Dac.DeployOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
at Microsoft.SqlServer.Dac.OperationExtension.Execute(IOperation operation, DacLoggingContext loggingContext, CancellationToken cancellationToken)
at Microsoft.SqlServer.Dac.DacServices.InternalDeploy(IPackageSource packageSource, Boolean isDacpac, String targetDatabaseName, DacDeployOptions options, CancellationToken cancellationToken, DacLoggingContext loggingContext, Action3 reportPlanOperation, Boolean executePlan)
at Microsoft.SqlServer.Dac.DacServices.ImportBacpac(BacPackage package, String targetDatabaseName, DacImportOptions importOptions, Nullable1 cancellationToken)
at Microsoft.SqlServer.Dac.DacServices.ImportBacpac(BacPackage package, String targetDatabaseName, DacAzureDatabaseSpecification creationDefaults, Nullable`1 cancellationToken)
at Microsoft.SqlServer.Management.Dac.DacWizard.ImportDatabase.DoWork()
at Microsoft.SqlServer.Management.TaskForms.SimpleWorkItem.Run()
I had the same issue and was able to resolve this with previous version of SSMS (SQL Server Management Studio) - not the SQL Server version. Previous SSMS versions can be downloaded here:
https://learn.microsoft.com/en-us/sql/ssms/release-notes-ssms?view=sql-server-ver15#1791
ATTOW, the current version is 18.5. It works for me at version 17.9.1 and 18.4.
This works for me on both SQL Server 2017 and 2019, it was the issue with SSMS, not the SQL Server version.
I also tried Azure Data Studio with SQL Dacpac extension (https://github.com/microsoft/azuredatastudio/tree/master/extensions/dacpac) and it failed with same error as latest SSMS version. There's an issue open for this: https://github.com/microsoft/azuredatastudio/issues/9522
Alternatively, instead of installing SSMS, install sqlpackage from https://learn.microsoft.com/en-us/sql/tools/release-notes-sqlpackage?view=sql-server-ver15#184-sqlpackage (version 18.4) and run the command manually. Something like:
sqlpackage.exe /a:Import /df:"import.log" /sf:"mybacpac-2020-04-26.bacpac" /tcs:"Server=.;Database=mybacpac;Integrated Security=true"
I ran into the exact same error message while attempting to import a BACPAC to my local SQL Server 2019. Exact same error on SQL Server 2017 through my testing. The import failed with the latest versions of SSMS and Azure Data Studio.
In my case the error was thrown due to the existence of an external contained user account in the database, principle type E. Type E is External user from Azure Active Directory.
You can check here for reference:
https://learn.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-database-principals-transact-sql?view=sql-server-ver15
After removing the user account from the database, I was able to import the database successfully.
Same error as well. I updated it to v18.9.2, instead of downgrading it and it resolved the issue

The path for 'ISServerExec.exe' cannot be found when deploying a project

I am working on jobs currently and when I want to deploy my project I am receiving the following error. I tried to check the DTSPath but I wasn't able to find it under the following path "go to regedit->HKEY_LOCAL_MACHINE->SOFTWARES and under Microsoft Sql Server in SSIS"
The path for 'ISServerExec.exe' cannot be found. The operation will
now exit. A .NET Framework error occurred during execution of
user-defined routine or aggregate "deploy_project_internal":
System.Data.SqlClient.SqlException: The path for 'ISServerExec.exe'
cannot be found. The operation will now exit.
System.Data.SqlClient.SqlException: at
System.Data.SqlClient.SqlConnection.OnError(SqlException exception,
Boolean breakConnection, Action`1 wrapCloseInAction) at
System.Data.SqlClient.SqlInternalConnectionSmi.EventSink.DispatchMessages(Boolean
ignoreNonFatalMessages) at
System.Data.SqlClient.SqlCommand.RunExecuteNonQuerySmi(Boolean
sendToPipe) at
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource
1 completion, String methodName, Boolean sendToPipe, Int32 timeout,
Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at
System.Data.SqlClient.SqlCommand.ExecuteToPipe(SmiContext pipeContext)
at Microsoft.SqlServer.Server.SqlPipe.ExecuteAndSend(SqlCommand
command) at
Microsoft.SqlServer.IntegrationServices.Server.ServerConnectionControl.RaiseError(SysMessageId
messageId, SysMessageSeverity severity, Object[] args) at
Microsoft.SqlServer.IntegrationServices.Server.ServerApi.DeployProjectInternal(SqlInt64
deployId, SqlInt64 versionId, SqlInt64 projectId, SqlString
projectName) . (Microsoft SQL Server, Error: 27108)
This solved my problem immediately:
http://thesqlgirl.com/2017/10/25/ssis-error-the-path-for-isserverexec-exe-cannot-be-found/
When I re-ran the SQL Installer and selected the instance I was having trouble with, I found that SSIS (Integration Services) wasn't installed, just like the article above suggested. Somehow, when I had removed a secondary instance of SQL that was running on same server, it affected other instances.
Not shocking for a Microsoft product.

Error While running DotNetNuke 9 on a server

Hi I get the following error while running DotNetNuke 9 on a server on Windows server 2012 r2 with iis
Could not find file D:\Inetpub\vhosts\accuratedatabases.in\*****\DotNetNuke.config
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not find file 'D:\Inetpub\vhosts\accuratedatabases.in\finance2.berozgaribhagao.com\DotNetNuke.config'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[FileNotFoundException: Could not find file 'D:\Inetpub\vhosts\accuratedatabases.in\finance2.berozgaribhagao.com\DotNetNuke.config'.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +11794191
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +1326
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +65
DotNetNuke.HttpModules.RequestFilter.RequestFilterSettings.GetSettings() in E:\Websites\Developing\DotNetNuke\DNN_Platform3\Dnn.Platform\DNN Platform\HttpModules\RequestFilter\Config\RequestFilterSettings.cs:78
DotNetNuke.HttpModules.RequestFilter.RequestFilterModule.FilterRequest(Object sender, EventArgs e) in E:\Websites\Developing\DotNetNuke\DNN_Platform3\Dnn.Platform\DNN Platform\HttpModules\RequestFilter\RequestFilterModule.cs:86
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
I searched on internet but could not find any solution. I tried hosting on both shared and dedicated windows server but the probelm is the same.
For your info I have the DotNetNuke.HttpModules.dll in my bin directory
I solved this by using the DotNetNuke_install package instead. I was previously opening it in Visual Studio 2015 and then trying to run locally. but now i deployed directly to iis and for edits i open as a website in visual studio

Does the WinForms ReportViewer have additional deployment dependencies in .NET 4.0?

I recently updated a WinForms app from .NET 3.5 to .NET 4.0 that contains local reports. I include the version 11.0 assemblies for Microsoft.ReportViewer.WinForms, Microsoft.ReportViewer.Common, and Microsoft.ReportViewer.ProcessingObjectModel in the application directory, which is all it took to deploy this app using .NET 3.5, but I get the following error on a target machine with .NET 4.0 but no VisualStudio or SQL Server:
TYPE: Microsoft.Reporting.WinForms.LocalProcessingException
MSG: An error occurred during local report processing.
SOURCE: Microsoft.ReportViewer.WinForms
SITE: EnsureExecutionSession
at Microsoft.Reporting.WinForms.LocalReport.EnsureExecutionSession()
at Microsoft.Reporting.WinForms.LocalReport.SetParameters(IEnumerable`1 parameters)
at Ceoimage.Basecamp.MaintainDocumentIntegrity.ReportContainer._SetReportParameters(String departmentName, String footer)
at Ceoimage.Basecamp.MaintainDocumentIntegrity.ReportContainer._RefreshReport(DataTable sourceTable, String sourceName, String reportResourceName, String departmentName, String footer)
at Ceoimage.Basecamp.MaintainDocumentIntegrity.ReportContainer.ShowMissingReport(MissingFilesDataTable missingTable, String departmentName, String footer)
at Ceoimage.Basecamp.MaintainDocumentIntegrity.DocumentIntegrityForm._HandleMissingComplete(Object sender, RunWorkerCompletedEventArgs e)
-- INNER EXCEPTION --
TYPE: Microsoft.Reporting.DefinitionInvalidException
MSG: The definition of the report '' is invalid.
SOURCE: Microsoft.ReportViewer.Common
SITE: CompileReport
at Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot)
at Microsoft.Reporting.LocalService.GetCompiledReport(PreviewItemContext itemContext, Boolean rebuild, ControlSnapshot& snapshot)
at Microsoft.Reporting.LocalService.CompileReport()
at Microsoft.Reporting.LocalService.Microsoft.Reporting.ILocalProcessingHost.CompileReport()
at Microsoft.Reporting.WinForms.LocalReport.EnsureExecutionSession()
-- INNER EXCEPTION --
TYPE: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException
MSG: An unexpected error occurred in Report Processing.
SOURCE: Microsoft.ReportViewer.Common
SITE: CreateIntermediateFormat
at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(PublishingContext reportPublishingContext, IDataProtection dataProtection)
at Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot)
-- INNER EXCEPTION --
TYPE: System.IO.FileNotFoundException
MSG: Could not load file or assembly 'Microsoft.SqlServer.Types, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
SOURCE: Microsoft.ReportViewer.Common
SITE: Write
FILE: Microsoft.SqlServer.Types, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91
at Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatWriter.Write(Object obj, Boolean verify, Boolean assertOnInvalidType)
at Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Serialize(IntermediateFormatWriter writer)
at Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatWriter.Write(IPersistable persistableObj, Boolean verify)
at Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatWriter.WriteVariantOrPersistable(Object obj)
at Microsoft.ReportingServices.ReportPublishing.ReportPublishing.CreateHashForCachedDataSets()
at Microsoft.ReportingServices.ReportPublishing.ReportPublishing.InternalCreateIntermediateFormat(Stream definitionStream, String& description, String& language, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash)
at Microsoft.ReportingServices.ReportPublishing.ReportPublishing.CreateIntermediateFormat(Byte[] definition, String& description, String& language, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash)
at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CompileOdpReport(PublishingContext reportPublishingContext, IDataProtection dataProtection, PublishingErrorContext errorContext, String& reportDescription, String& reportLanguage, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash)
at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(PublishingContext reportPublishingContext, IDataProtection dataProtection)
I tried running the Report Viewer 2012 Redistributable, but it too complains about Microsoft.SqlServer.Types. I do not understand why I have this new dependency even though this is a local report. The code does not use any advanced data types or anything beyond what it uses in the .NET 3.5 version that requires only those three Microsoft.ReportViewer.* assemblies. Can someone give me a finite list of requirements for deploying a .NET 4.0 app with Report Viewer?
The link you provided for the Report Viewer 2012 Redistributable has some information at the very bottom.
Additional information
Pre-requisites Microsoft SQL Server 2008 Reporting Services or higher for server processing mode. NET Framework 3.5 SP1 or .NET Framework 4.0 The SQL Server System CLR Types package
Looks like you are missing the SQL Server System CLR Types package. It can be downloaded from the SQL Server Feature Pack - here is a link to the latest list of installers of the feature pack.
http://www.microsoft.com/en-us/download/details.aspx?id=26728 You will see multiple listings depending on x86 etc.
Hopefully this will help.
The main reason for this error is that the project or setup file is not able to access report viewer dll, so add all of the following dll files relted to reportviewer manually
Microsoft.ReportViewer.Common
Microsoft.ReportViewer.ProcessingObjectModel
Microsoft.ReportViewer.WinForms
Microsoft.ReportViewer.DataVisualization
Now I Hope This Error Solve Easily .
In the Manage NuGet Packages add:
Microsoft.SqlServer.Types
Microsoft.ReportViewer.Window.

Issue with OleDbConnection.Open when Running as a Service

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!
I also had the "The .Net Framework Data Providers require Microsoft Data Access Components(MDAC). Please install Microsoft Data Access Components(MDAC) version 2.6 or later." error when trying to invoke my Windows program over ssh, but not when running the same program directly in a cygwin terminal on the server (Windows Server 2008 R2 Enterprise). I felt sure this could be made to work using openssh in cygwin. Eventually I found that it could be made to work if you sent the following environment variable in the ssh call:
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
So if you logged in like so:
$ ssh myuser#myserver -o SendEnv='CommonProgramFiles(x86)'
Then you should be able to run your program successfully. Note this assumes you have already configured sshd on the server to accept the environment variable. You can do that by adding the following line to /etc/sshd_config and then restarting sshd (net stop sshd followed by net start sshd):
AcceptEnv CommonProgramFiles(x86)
When AccessDatabaseEngine.exe (Microsoft Office Access database engine 2007) is installed (download it from http://www.microsoft.com/en-us/download/confirmation.aspx?id=23734) it puts some files under C:\Program Files (x86)\Common Files.
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!
Same issue on Windows 7 + OpenSSH (OpenSSH_6.5p1, OpenSSL 1.0.1f 6 Jan 2014) while running C# program connecting Access database.
I've added
export CommonProgramFiles="C:\Program Files\Common Files"
in /etc/profile file.
Hope this help.

Resources