SSIS package from ASP.net does not work on client but does on server - iis

Description Of Environment
I have an SSIS task which executes from asp.net, the package gets data from excel files over UNC path and puts the data into a sql server databaase . I have deployed the SSIS to file system, it has windows authentication database connections and the IIS user has database access. I can log in as the AppPoolUser I have used to host the web application and open/modify the files in question so those basic permissions are there. Web App is compiled in x86.
When it works:
When run from web app in browser on server under my user or appPool user
When logged in as me on server running through BIDS
When logged in as AppPoolUser on server running through BIDS
When run from scheduled task on server using AppPoolUser
When it doesn't work:
When run from client browser i.e. not the machine that has IIS hosting the asp.net app
My Question
What is different about the client and server and how do I make it work? I was under the impression that when running the web app all connections go through the AppPool User so it should behave the same on any machine server included?
The Error returned to client browser
SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft Office Access Database Engine" Hresult: 0x80004005 Description: "The Microsoft Office Access database engine cannot open or write to the file '\\myserver\My folder\myfile.xlsx'. It is already opened exclusively by another user, or you need permission to view and write its data.". SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "MyExcelFileConnection" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed. component "Excel Source" (1) failed validation and returned error code 0xC020801C. One or more component failed validation. There were errors during task validation.
c# Code running SSIS Package
string pkgLocation;
Package pkg;
Application app;
DTSExecResult pkgResults;
string result = string.Empty;
string dtsErrors = string.Empty;
try
{
pkgLocation = packagePath;
app = new Application();
pkg = app.LoadPackage(pkgLocation, null);
pkgResults = pkg.Execute();
foreach (DtsError local_DtsError in pkg.Errors)
dtsErrors += " " + local_DtsError.Description;
result = pkgResults.ToString();
}
catch (Exception exception)
{
result = exception.Message;
}

Related

Installing Azure Backup Server Crash With Error 4387

I am trying to install azure backup server on windows server 2016 to backup local sql server
the installation wizard pass requirement check
but when i enter sql server instance name the wizard crash
i checked the error log and i found the error
but it is not usefull
* Exception : Invoking Watson with Exception: => System.Configuration.ConfigurationErrorsException: Unable to get machine name information
at Microsoft.Internal.EnterpriseStorage.Dls.Utils.FqMachineName.GetDpmMachineName()
at Microsoft.Internal.EnterpriseStorage.Dls.Setup.Inspect.InspectHelper.CheckIfLocalMachine(String sqlServerName)
at Microsoft.Internal.EnterpriseStorage.Dls.Setup.Wizard.VenusSQLInspectPage.sqlServerInstanceTextBox_LeavingBox(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnLeave(EventArgs e)
at System.Windows.Forms.ContainerControl.UpdateFocusedControl()
what could be possible problem?
the server is not domain controller and it is not a member of any domain ,
just a bare metal server somewhere in cloud

Data source name not found and no default driver specified". Failed to acquire connection "DestinationConnectionOLEDB"

I have created a SSIS package to import the excel to sql. I have set the connection string and excel file path by expression.
After that I'm trying to invoke package by c# WPF application by
Microsoft.SqlServer.Dts.Runtime.DTSExecResult and passing value of connection string and excel path. My code is as shown below
Application app = new Application();
Package package = null;
//Load the SSIS Package which will be executed
package = app.LoadPackage("D:\\EMS-Docs\\new\\SSIS\\SSISProject\\obj\\Development\\Package2.dtsx", null);
//Pass the varibles into SSIS Package
//Microsoft.SqlServer.Dts.Runtime.Variables myVars = package.Variables;
package.Variables["User::EXLPath"].Value = "D:\\EMS-Docs\\SSIS\\PRACTICAL_1901_LOT-2.xls";
package.Variables["User::SQLConn"].Value = GlobalClass.TransactionalDBConnectionString;
//Execute the SSIS Package and store the Execution Result
Microsoft.SqlServer.Dts.Runtime.DTSExecResult results = package.Execute();
The error
SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft OLE DB Provider for ODBC Drivers" Hresult: 0x80004005 Description: "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified".
Failed to acquire connection "DestinationConnectionOLEDB". Connection may not be configured correctly or you may not have the right permissions on this connection.
Error cause
The main error is:
"[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
Which means that the main problem is in the connection manager or the connection string.
Possible solutions
Make sure that you have set the connection manager and Data Flow Tasks Delay Validation property to True
Make sure that you are passing a valid connection string value by executing the package from visual studio with the same variable value.
Make sure that the application mode (32bit/64bit) is identical with the ODBC driver version. As example: if you have 32-bit ODBC driver installed, make sure that you are running the application in 32-bit mode
If you are connecting to SQL Server you can use SQL Native Client or Microsoft OLEDB Provider for SQL Server instead of ODBC provider
Additional Information
Also, you can refer to the following knowledge base article for more information about the error possible causes / solutions:
DATADIRECT "DATA SOURCE NAME NOT FOUND AND NO DEFAULT DRIVER SPECIFIED" ERROR

Can't Connect to IIS 7.5 from another 7.5

I am trying to execute this command from a web application on sourceServer:
var mgr = ServerManager.OpenRemote(destServer)
but I receive this error:
UnAuthorized access wth a detail error: "Retrieving the COM class factory for remote component with CLSID {2B72133B-3F5B-4602-8952-803546CE3344} from machine failed due to the following error: 80070005"
I have full administrative rights on both servers.
I can issue that command from a console application no problem, but when I try it from the web application, I get the error!
I have tried enabling the remote management checkbox and started teh remote access auto connection manager and also tried updating the load user profile on the applicaiton pool from false to true.
I have searched so much to the point that all of my links are pink in color!
Any input is greatly appreciated.
I've decided to ditch the use of ServerManager.OpenRemote() and use the DirectoryEntry way:
DirectoryEntry root = new DirectoryEntry("IIS://server/W3SVC", username, password)
it is much simpler and straightforward.

Selenium and TFS Test cases Datasource

I am usimg VS 2010 Professional.And want to connect the TFS Testcase datasource without using MTM(Microsofot Test Manager).Is it Possible to do so.
[DataSource("Microsoft.VisualStudio.TestTools.DataSource.TestCase",
"http://TFS URL", "27211",
DataAccessMethod.Sequential), TestMethod]
public void CheckUserLogin()
{
PageObjects.BrowserInvoke();
PageObjects.TextBox(UIMapRepository.userName, TestContext.DataRow["UserName"].ToString());
PageObjects.TextBox(UIMapRepository.passWord, TestContext.DataRow["Password"].ToString());
PageObjects.ButtonClick(UIMapRepository.loginButton);
Assert.AreEqual("Logout", PageObjects.CheckElementExist(UIMapRepository.logoutButton));
PageObjects.ButtonClick(UIMapRepository.logoutButton);
PageObjects.CloseBrowser();
}
When I run this I get
The unit test adapter failed to connect to the data source or to read the data. For more information on troubleshooting this error, see "Troubleshooting Data-Driven Unit Tests" (http://go.microsoft.com/fwlink/?LinkId=62412) in the MSDN Library.
Error details: TF30063: You are not authorized to access tfs.
The remote server returned an error: (401) Unauthorized.
Can not connect to Team Foundation Service data source for coded ui tests has a similar issue.
I suspect you'll need to pass the authentication credentials along with the URL in the TFS connection string.
How do you connect to a TFS server in C# using specific credentials? shows how to connect programmatically. You should be able to wrap that into a format that the DataSource attribute will accept.

IIS Application pool identity

I am attempting to obtain a data feed from yahoo finance. I am doing this with the following code:
System.Net.WebRequest request = System.Net.WebRequest.Create(http://download.finance.yahoo.com/download/quotes.csv?format=sl&ext=.csv&symbols=^ftse,^ftmc,^ftas,^ftt1x,^dJA);
request.UseDefaultCredentials = true;
// set properties of the request
using (System.Net.WebResponse response = request.GetResponse())
{
using (System.IO.StreamReader reader = new System.IO.StreamReader(response.GetResponseStream()))
{
return reader.ReadToEnd();
}
}
I have placed this code into a console application and, using Console.WriteLine on the output I receive the information I require. I have used the 'Run as..' command to execute this using a specific domain account.
When I use this code from within a Page load I receive the following error message "No connection could be made because the target machine actively refused it 76.13.114.90:80".
This seems to suggest that the call is reaching yahoo (is this true?) and that there is something missing.
This would suggest there is an identity difference in the calls between the console application and application pool.
Environment is: Windows Server 2003, IIS 6.0, .net 4.0
"Target machine actively refused it" indicates that the TCP connection itself is not succeeding. This could be due to the fact that the Proxy settings when run under IIS are not the same as those that apply when you run in the console.
You can fix this by setting a WebProxy on your request, that points to the proxy server being used in the environment.
Yes, an active refusal is indication that the target machine is receiving the request and the information in the headers is either incorrect or insufficient to process the request. It is entirely possible that if you had to run this call using a "run as" command in console that the application pool's identity user does not have the appropriate permission or username. You can attempt to change the identity user to this specific domain account to see if that alleviates the problem, but you may have to isolate this particular function into its own application pool in order to protect the rest of the website from having this specification.

Resources