SocketException when creating a new Report Server Database

We had a customer call up that encountered a problem when trying to create a new database for their Report Server through the Reporting Services Configuration Manager.  This is what they saw:


When we clicked on the Error link, we saw the following details:

System.Net.Sockets.SocketException: No such host is known
   at System.Net.Dns.GetAddrInfo(String name)
   at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
   at System.Net.Dns.GetHostEntry(String hostNameOrAddress)
   at ReportServicesConfigUI.RSDatabase.IsLocalDbServer(String dbServer)
   at ReportServicesConfigUI.RSDatabase.GrantRSConnectionRights()
   at ReportServicesConfigUI.RSDatabase.CreateNewDatabase()

The server name that we had specified was in the format of SERVER,PORT.  The reason was because there was a firewall in between the Report Server and the Database server.  The Database server was a Named Instance and UDP 1434 was being blocked which is the port for SQL Browser.  We use SQL Browser to convert the Named Instance name to the actual Port number, or named pipe, of the Named Instance.  With SQL Browser not available, we have to specify the actual port number so that we can connect to the database.

From the screenshot above, it looks like we were able to connect to the database as “Running database script” was successful.  Also the “Test Connection” button on the Database Server part of the wizard connected successfully.  So, we got a dump of the error to see what was happening.

The first thing I did when I opened the dump was to load the .NET debugging extension that ships with the .NET Framework called SOS.

0:009> .loadby sos mscorwks

You’ll also notice that we are on Thread 9.  It put me to that thread automatically because it is a crash dump with a given exception.  This makes it easy to find a starting place in your dump.

Next, I wanted to see if the exception in this dump matches what we saw in the Configuration Manager. We can do this by calling !printexception which will print the exception on the given thread you are on.  You can also specify an address for the actual exception.

0:009> !printexception
Exception object: 02a12c44
Exception type: System.Net.Sockets.SocketException
Message: No such host is known
InnerException: <none>
StackTrace (generated):
StackTraceString: <none>
HResult: 80004005

So, this is our guy.  Our call stack at this point is pretty much what we saw in the Exception Details within the Configuration Manager.

0:009> !clrstack
OS Thread Id: 0x1548 (9)
ESP       EIP    
055bf90c 7d4e2366 [HelperMethodFrame: 055bf90c]
055bf9b0 7a580e88 System.Net.Dns.GetAddrInfo(System.String)
055bfa10 7a580bea System.Net.Dns.InternalGetHostByName(System.String, Boolean)
055bfa2c 7a580c7e System.Net.Dns.GetHostEntry(System.String)
055bfa44 06811255 ReportServicesConfigUI.RSDatabase.IsLocalDbServer(System.String)
055bfa58 068110b4 ReportServicesConfigUI.RSDatabase.GrantRSConnectionRights()
055bfa74 06810832 ReportServicesConfigUI.RSDatabase.ChangeRSDatabase()
055bfaa0 06810740 ReportServicesConfigUI.ProgressPanel.PerformWizardActionThread(System.Object)
055bfab4 792c9dff System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(System.Object)
055bfabc 792e019f System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
055bfad4 792ca363 System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(System.Threading._ThreadPoolWaitCallback)
055bfae8 792ca1f9 System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(System.Object)
055bfc78 79e71b4c [GCFrame: 055bfc78]

My thought here is that the IsLocalDbServer is being passed the raw string of my server address and not being parsed.  We can look at that by way of !dso (Dump Stack Objects).

0:009> !dso
OS Thread Id: 0x1548 (9)
ESP/REG  Object   Name
055bf8a0 02a12c44 System.Net.Sockets.SocketException
055bf8ec 02a12c44 System.Net.Sockets.SocketException
055bf900 02a12c44 System.Net.Sockets.SocketException
055bf904 02a12c18 System.Collections.ArrayList
055bf930 02a12c44 System.Net.Sockets.SocketException
055bf938 02a12c44 System.Net.Sockets.SocketException
055bf940 02a12c18 System.Collections.ArrayList
055bf960 02a12cdc System.Text.StringBuilder
055bf978 02a12cdc System.Text.StringBuilder
055bf98c 02a12c18 System.Collections.ArrayList
055bf994 02a12c44 System.Net.Sockets.SocketException
055bf9b8 02a12c18 System.Collections.ArrayList
055bf9bc 02923f58 System.String    myserver,1234
055bf9e4 02a12c30 System.Net.SafeFreeAddrInfo
055bf9fc 02923f58 System.String    myserver,1234
055bfa00 02923f58 System.String    myserver,1234
055bfa1c 02923f58 System.String    myserver,1234
055bfa20 028f3664 ReportServicesConfigUI.RSDatabase

We see RSDatabase at the bottom which matches my IsLocalDbServer method call.  We then see the raw string followed by the SocketException if we work our way up.  Reviewing the IsLocalDbServer method, it does indeed not parse the string for the server name/port. 

So, if you run into this exception, you may want to check what you are passing as your Server name.  You will not be able to specify a port.

Adam W. Saxton | Microsoft SQL Server Escalation Services

Comments (7)

  1. Sameer Surve says:

    Environment SQL backend, SSRS server: SQL 2008 SP1 SQL backend is behind the firewall with only specific

  2. Ricardo Sampei says:

    I run into this problem with a hidden instance but the installation worked because the Report Server and the Database Server were on the same server. I’m wondering what would happen if you try to create a farm with a hidden database instance; if I am not mistaken then the Reporting Services nodes on other servers would not be able to find the database. Is there a fix for this issue?

  3. Duane Lawrence says:

    Everyone says to use servername,port.  Well I had a stubborn one, not even the,1421 worked.  This does work.

    rsconfig -c -s,1421 -d reportserver -a Windows -u corpserviceaccount -p password

    Be sure to run as admin and change directory to

    c:program filesMSSQL (X86)100ToolsBinn

  4. Solution that worked for me says:

    see the following:

    1- Fire wall may prevent the RS report server access to machine containing the REPORT SERVER database.

    2- See if the report server reporting services machine is in the same DOMAIN/Network of the machine which contains the "Report Server" database.

    3- Report Server db and related temp database should be in the same database.

  5. Possible Solution Checklist says:

    see the following:

    1- Fire wall may prevent the RS report server access to machine containing the REPORT SERVER database.

    2- See if the report server reporting services machine is in the same DOMAIN/Network of the machine which contains the "Report Server" database.

    3- Report Server db and related temp database should be in the same database.

  6. Carlos Shepardos says:

    There is another reason for this error message:

    If you use a SQL alias to connect to the SQL Server server you have to ensure that the local computer is also able to resolve the SQL alias name via a DNS resolution request. If the local computer is not able to do this you get the error message shown above.

    The easiest way to ensure the SQL alias name is resolvable to the IP address of the SQL Server is to create an A record entry in DNS or add a line to the local hosts file.

    Regards Carlos

Skip to main content