Named Pipes Provider error 40 connecting to localhost SQL Server (tried all standard resolutions)

Thomas Simon 61 Reputation points
2021-01-25T01:37:46.97+00:00

I am attempting to create the reporting services database for usage in MECM. The reporting services installed fine (install only), but once I get to the Database tab and try to connect to the database server to create the database, it fails by timing out when trying to connect (see dialog). I am using Authentication Type: Current User - Integrated Security (domain user account loaded with permissions on that server - used by several other SQL apps).

Full text of error message:
Could not connect to server: 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: 50 - Could not open a connection to the SQL Server)

59890-image.png

We are using two named instances, so the ports are dynamic. I have made sure all ports are active (netstat).

I also made sure of the following:

  • all SQL services are running
  • firewall is disabled (all profiles) - shouldn't matter, because we are running setup locally
  • remote connections are enabled in SSMS (again, shouldn't matter)
  • named pipes is enabled (as are TCP/IP and Shared Memory); also re-ordered protocols while testing
  • tried service accounts using virtual service account, local system, network service and known-good domain SQL service account
  • varied Server Name by using machine name, FQDN, local IP, loopback (127.0.0.1) and LOCALHOST
  • I can ping the server and access IPC$ (as you would expect on the localhost)
  • I am inside of the SQL Server 2016 Reporting Services Configuration Manager and logged into the SQL Server on the correct instance and the Report Server is showing as Started. I can also user the Web Service URL (although it obviously gives me a DB error).

I have checked the Application Event log and SQL/Reporting Server logs without any hints of the problem.

What could be causing this issue? I have spent hours troubleshooting something that should be so easy.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,690 questions
SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,798 questions
0 comments No comments
{count} votes

Accepted answer
  1. Martin Cairney 2,241 Reputation points
    2021-01-25T03:18:18.293+00:00

    You mention more than 1 instance is on the server - have you specified the Instance Name when selecting the SQL Server?

    Also, is the SQL Browser service running - if not you may not be able to identify the correct ports to connect on.


3 additional answers

Sort by: Most helpful
  1. Thomas Simon 61 Reputation points
    2021-01-25T06:08:12.113+00:00

    Yes, the instance is embedded from the Reporting Server installation.

    As mentioned in the OP, all services are running.

    Thanks.

    0 comments No comments

  2. ZoeHui-MSFT 32,586 Reputation points
    2021-01-25T06:36:17.347+00:00

    Hi @Thomas Simon ,

    Please make sure you are using the correct instance name.

    When you connect to a default instance, machinename is the best representative for the instance name.

    When you connect to a named instance such as sqlnewname, you need to specify the instancename as follows: machinename\instancename where you enter in the SSRS server name.

    Also go to the task manager--services--restart your MSSQLSERVER service.

    More details, please also refer this.

    Regards,

    Zoe


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    Hot issues October


  3. Tom Phillips 17,716 Reputation points
    2021-01-25T14:36:28.173+00:00

    The error you are receiving is a generic "cannot connect to server" message. It does not help in any way diagnose the issue.

    Have you installed a SQL Server "Database Engine"? It sounds like you have not, you have only installed SSRS. The screen print is the SSRS Instance Name, not the SQL Server DATABASE ENGINE instance name.

    Please verify you have a SQL Server Database Engine installed.