"Communication with the underlying transaction manager has failed" error message - asp.net

A client of our has recently upgraded a ASP.NET 1.1 web application to ASP.NET that uses COM+ transaction processing and received the following exception while trying to process a transaction:
Exception Type:
System.Transactions.TransactionManagerCommunicationException
Message: Communication with the
underlying transaction manager has
failed.
Inner Exception Type:
System.Runtime.InteropServices.COMException
ErrorCode: -2147467259
Message: Error
HRESULT E_FAIL has been returned from
a call to a COM component.
Here are the following settings on MSDTC Security Settings:
-- Network DTC Access
-- Allow Inbound
-- Allow Outbound
-- Incoming Caller Authenication Required
A Windows XP SP3 workstation is trying to establish a connection to a Windows Server 2003 machine.
Has anyone else experienced this error and know how to resolve it.

You'll need to have network DTC access enabled on both your XP workstation and your windows 2003 machine. Also, if your application is only published internally, you can turn off incoming caller authentication and set it to "no authentication".

Add C:\Windows\msdtc.exe to the firewall exceptions on both the firewall and server. I spent ages monkeying around opening specific port numbers and ranges to no avail before I did this.

1)Disable authentication besides enabling the network access to "distributed transaction co-ordination " service
(mutual authentication doesn’t work as displayed in internet in xp sp3 machines)
2) enable network access in client ( web applicaton ) and server ( sql server ) machines for "distributed transaction co-ordination " service .

You'll also need to make sure your firewall is open for ports 135 and 5000-5020.
See these:
http://social.msdn.microsoft.com/forums/en-US/windowstransactionsprogramming/thread/71f7a219-c85d-4a04-973b-c73464f59606/
http://blogs.msdn.com/florinlazar/archive/2005/09/16/469064.aspx
http://social.msdn.microsoft.com/forums/en-US/architecturegeneral/thread/7731d7a7-a9ad-42e7-b0bb-f3656b870304/
http://support.microsoft.com/kb/154596/

In case you need help finding the MSDTC settings mentioned in the other answers (like I did), the following link explains how to configure MSDTC on server 2003.
http://itknowledgeexchange.techtarget.com/sql-server/how-to-configure-dtc-on-windows-2003/

Related

Why is IIS7 blocked from accessing my database when connecting to a website via a browser from a client machine?

When I access the website from the same machine IIS is running on I am able to connect to the database, but not if I try to access it remotely. The only way I've managed to get it to connect is when I specify Physical Path Credentials:
click to open image
This doesn't work for me because, I am using the username as a search criteria when querying the database and this way I always get the same username (the one I specified in the physical path credentials).
I am confused because, when accessing the website locally and remotely I use the same credentials and I get different results.
This is the exception that is thrown when trying to access the site remotely:
ByNadexLoginSystem.Exception: System.Exception:
'SelectDataObject()' failed --->
System.Data.SqlClient.SqlException: A network-related or
instance-specific error occurred while establishing a connection to
SQL Server. The server was not found or was not accessible. Verify
that the instance name is correct and that SQL Server is configured to
allow remote connections. (provider: Named Pipes Provider, error: 40 -
Could not open a connection to SQL Server) --->
System.ComponentModel.Win32Exception: Access is denied --- End of
inner exception stack trace
I have tried adding folder permissions as pointed out here:
ASP.NET Application page not working on clients computers with no success whatsoever.
The SQL server is configured to allow remote connections.
I am sure it is a permissions problem I just can't find where. Any ideas?
I found the solution to my problem, I want to give credit to Sean Lange. Thanks to his question it gave me a line of investigation to follow. While going through msdns documentation here https://msdn.microsoft.com/en-us/library/bsz5788z.aspx I found this:
If SQL Server is on a different computer than the Web server, the
Windows identity must be able to flow across the network to the remote
instance of SQL Server. (Windows networks that have been configured
appropriately with Kerberos authentication are able to do this.)
However, depending on the settings in the identity configuration
element, the Windows identity established on the operating system
thread for ASP.NET applications may not be able to flow properly to
the remote SQL Server.
In IIS, only Basic Authentication logs users on with a security token
that flows across the network to a remote SQL server. By default,
other IIS security modes used in conjunction with the identity
configuration element settings will not result in a token that can
authenticate to a remote SQL Server.
Enabling Impersonation and Basic Authentication ( disabled Windows Authentication ) solved it!

The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

Occasionally I get this error when working on remote computers. It's hit or miss on which computer I get it on. But I am able to ping the computer and test-connection pans out. For example, the computer I got this error on today I was able to get to yesterday. I know the computer is on because It's right next me.
Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
At line:1 char:14
+ get-wmiObject <<<< -Class win32_operatingsystem -ComputerName $current -Authentication 6 -credential $credential | Invoke-WMIMethod -name Win32Shutdown
+ CategoryInfo : InvalidOperation: (:) [Get-WmiObject], COMException
+ FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
Check to see if the Remote Procedure Call (RPC) service is running. If it is, then it's a firewall issue between your workstation and the server. You can test it by temporary disabling the firewall and retrying the command.
Edit after comment:
Ok, it's a firewall issue. You'll have to either limit the ports WMI/RPC work on, or open a lot of ports in the McAfee firewall.
Here are a few sites that explain this:
Microsoft KB for limiting ports
McAfee site talking about the same thing
You may get your answer here: Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
UPDATE
It might be due to various issues.I cant say which one is there in your case. It may be because:
DCOM is not enabled in host pc or target pc or on both
your firewall or even your antivirus is preventing the access
any WMI related service is disabled
Some WMI related services are:
Remote Access Auto Connection Manager
Remote Access Connection Manager
Remote Procedure Call (RPC)
Remote Procedure Call (RPC) Locator
Remote Registry
For DCOM settings refer to registry key HKLM\Software\Microsoft\OLE, value EnableDCOM. The value should be set to 'Y'.
My problem turned out to be blank spaces in the txt file that I was using to feed the WMI Powershell script.
I had the same problem when trying to run a PowerShell script that only looked at a remote server to read the size of a hard disk.
I turned off the Firewall (Domain networks, Private networks, and Guest or public network) on the remote server and the script worked.
I then turned the Firewall for Domain networks back on, and it worked.
I then turned the Firewall for Private network back on, and it also worked.
I then turned the Firewall for Guest or public networks, and it also worked.
Duting create cluster, my error was:
An error occurred while creating the cluster.
Could not determine Management Point Network Type.
The RPC server is unavailable
Solution:
Server Manager
Local Server
Click on one of the network adapter links, like "Ethernet".
Control Panel\Network and Internet\Network Connections
Right click on the first network adapter
Internet Protocol Version 4 (TCP/IPv4)
Properties
Advanced
DNS
Click radio button:
Append primary and connection specific DNS suffixes
If anyone else is reading this eons later. My problem was I deployed a GPO a few months ago that disables printer spooling via Windows Firewall rules. One of the rules is "File and printer sharing (Spooler Service - RPC-EPMAP)". This was set to deny.
This blocked the "RPC Endpoint Mapper" port range inbound and didn't specify a service. As a result this was blocking all traffic inbound on all RPC ports (tcp 1024-5000).
Disables the rule and this magically started working again.
TLDR; You need to allow the RPC Endpoint Mapper port range inbound on Windows firewall (tcp 1024-500) along with the WMI-In rule.

Connection to SQL server 2000 on a windows server 2003 domain controller

I am trying to connect an ASP.NET 2.0 application hosted on a client machine to an SQL server 2000 instance which is installed on a domain controller running windows server 2003 (I appreciate this is not best practise, but it is something I cannot change). I am using SQL server authentication, not Windows authentication.
During debugging, the following error is displayed at the point the 'connection' is attempted within the web application (not on running any object within Sql Server):
"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
I have done some research, and have checked a variety of things:
1) I am certain the conection string is correct - in fact I built a little Windows app that uses the same connection information and connection succeeds...
2) This is limited to the web application - a windows application running on the remote client machine connects just fine using the same connection string (see 1).
3) The firewall settings on both computers do not prevent the connection (see 1).
4) I can ping the windows 2003 server (see 1)
5) The SQL Server credentials definitely have the rights to the objects needed
6) If I (temporarily) put the web application on the windows server 2003 and run it, it loads and runs fine (using a browser on a separate machine, or on the client machine I am trying to connect) - suggesting this is only an issue with a remote connection, and confirming the connectivity between the machines again, and also confirming the necessary security right of the SQL Server user.
7) I can start query analyser on the client machine and using the same SQL server credentials, can run the same queries on the target database just fine.
Stumped. Please help!
You need to go into the SQL Server Configuration Manager and make sure the Named Pipes option is turned on. It is not turned on by default when you install SQL Server.
Because of the research I did in the original question covering the ability of a windows app to connect but not the ASP.NET app to connect from the same machine, and the confirmation the web app was working on the server itself, I was convinced SQL server was set up correctly, that connectivity and firewalls were not a problem - it must have been a difference in the security credentials of the windows app versus the web app.
The windows app runs in the security credentials of the logged on windows user and authenticates using that, whereas the webapp runs in a restricted account and does not pass these credentials over when connecting to SQL server by default. I simply added to web.config, which impersonates the user account within which the web app runs, and it all worked!
Problem solved.

Getting a sql connection error when trying to login

I have a login page that works in my local development environment. When I push the site onto the web server, i am getting this error when trying to login from the asp.net login control.
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
I cannot figure out why it does not work on the server. Do I need to add anything or change something in the web.config?
This support article may help. It may also be a firewall issue or an authentication issue on the new setup (but the error message makes that less likely).
For resolving error 26 in sql server you need to do the following steps.
At Server System
1. Under surface area configuration manager-Open up remote connections.
2. Add into firewall 1433 and 1434 port no as n exception.
3. Open port 1433 on router for WAN access.
4. Add client machine ip address as an exception to your antivirus or allow LAN settings in antivirus.
5. Now try to check if both client and server are connected to each other.
for this type "ping IP address of remote system" at run and if reply is obtained then do same for server machine.
If reply is obtained from both machines.
Open Sql server and try to connect to remote machine which allow remote connections using its ip address. U will surely get connected to server machine
See this video
Check to make sure TCP/IP is enabled on the SQL Server. For whatever reason, named pipes and TCP/IP is off by default. Also make sure you are trying to connect to the correct instance (maybe you are using ./SQLEXPRESS locally and on the server SQL is installed on the default instance). Lastly, make sure the database you are trying to connect to exists on the server.

MSDTC communication fails over VPN

I have an application that runs transactions spanning over multiple databases on the same server. Naturally this involves the Microsoft Distributed Transaction Coordinator and everything works like it is supposed to.
Howver, when I remotely connect to the network where the server is hosted via VPN and run the application on my local machine I receive the following error:
System.Transactions.TransactionManagerCommunicationException:
"Communication with the underlying transaction manager has failed."
Caused by:
System.Runtime.InteropServices.COMException:
Error HRESULT E_FAIL has been returned from a call to a COM component.
Here is the stack trace for the originating exception:
at System.Transactions.Oletx.IDtcProxyShimFactory.ReceiveTransaction(UInt32 propgationTokenSize, Byte[] propgationToken, IntPtr managedIdentifier, Guid& transactionIdentifier, OletxTransactionIsolationLevel& isolationLevel, ITransactionShim& transactionShim)
at System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(Byte[] propagationToken)
The problem arises only when I connect to the server through a VPN tunnel.
Note also that I have temporarly disabled Windows Firewall on my local machine, just to be sure it doesn't block the MSDTC.
Does anyone know of any issues when running MSDTC through VPN?
I suggest you run DTCPing (available from the Microsoft site somewhere) This is run at the same time on both machines and detects all manner of DTC problems.
Be careful I had great difficulties with this tool until I actually read the instructions and started both sides of the test up before I clicked the start test button.
Do you administer the VPN connection? There might be restricted ports on the VPN. Likewise, do you administer your servers? Your servers might only allow connections from IP addresses on the inside and not on the segment used for VPN service. If you are the administrator, perhaps saying which VPN software you are using will help.
I'm having the same problem using a Windows 7 x64 client and a Server 2003R2 server. I have been able to make it work (on the same vpn, same server) using XP, Vista x86, and Windows 7 x86. I have a support call with Microsoft open and they are looking into it. I'm curious - what operating system are you guys using on your client machines?

Resources