1

After stopping the browser service on a 2-node SQL Server failover cluster system, the Database Mail component stopped working. It fails and creates log entries as follows:

Microsoft.SqlServer.Management.SqlIMail.Server.Common.BaseException
Message: There was an error on the connection.
Reason: 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified), connection parameters:
Server Name: SQLCLNETWORK1\INSTANCE1,
Database Name: msdb
Source: DatabaseMailEngine

The instance behind "SqlClNetwork01" is running on non default Port. The SQL Server engine itself continued without any problems.

So my question is, why does the Mail Service have issues with the browser service stopped? Where is it trying to connect to the SQL Server engine without success?

1

It has issues because it would use the instance name rather than a port number, and the Browser service is required to do translation from instances to ports. Your other apps must be hardcoded to use the port numbers (or have aliases set in their SQL Client settings, or something similar).

Anyway when a mail is sent this triggers MSSQL\Binn\DatabaseMail.exe to run. I wasn't able to find out how it specifically works out what the default server name is, but you may be able to reconfigure it by creating an MSSQL\Binn\DatabaseMail.exe.config like this on each node, and including a port number:

<configuration>
    <appSettings>
        <add key="DatabaseServerName" value ="LocalServerName" />
        <add key="DatabaseName" value ="msdb" />
    </appSettings>
</configuration>
| improve this answer | |
  • The application's connection defenitely does not include a port, it just uses servername\instancename. Also, that specific node just held one single instance at the time the error occurred. So I wonder why this is a problem at all to stop the browser. The DatabaseMail.exe.config file does not exist. – Magier Apr 21 '16 at 10:00
  • If your apps use an instance name on a non-1433 port and Browser isn't running then it's impossible to connect. The only explanation is SQL Client aliases. Yes the config doesn't exist; I don't know where it gets that when it doesn't exist, but I read you can create it to override it. – Cody Konior Apr 21 '16 at 12:48
  • I thought the browser is necessary only in case there are running more than one instances on a server? – Magier Apr 21 '16 at 14:02
  • 1
    @Magier - Cody is correct - SQL Server Browser is required to allow translation of instance names to port numbers when SQL Server is using a non-standard port, or SQL Server was installed using an instance name. Whether there is 1 or 100 instances on the machine makes no difference. – Max Vernon Apr 21 '16 at 19:51
  • See msdn.microsoft.com/en-us/library/ms165724.aspx#Anchor_2 for details about the effects of turning off the SQL Server Browser service. – Max Vernon Apr 21 '16 at 20:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.