Named Pipes Provider, error: 40

kvagen's Avatar

kvagen

15 Jul, 2013 07:51 PM

I have followed the directions provided as closely as possible and I keep getting the same error after attempting to load the page:

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)

I am working on a remote Windows 7 32bit box with IIS7 installed. All of the searching I have done on the internet has yielded no helpful troubleshooting.

The description goes on:
"An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: 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)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below."

I have confirmed that remote access is allowed, the application pool is the folder I created 'Mercurial' with .NET Framework Version 4.0 and Pipeline mode:Integrated.

Any help would be greatly appreciated as this is now the third day that I have been working on this.

  1. 1 Posted by Slava Davydov on 16 Jul, 2013 04:40 AM

    Slava Davydov's Avatar

    Hi,
    I'm not the developer of this thing, but I've got the same errors during my first installs of this product.
    I got this issue when I had no connection to MSSQL database.
    The answers on following this could help you put HGLAB up:
    1) is the database in running state in 'SQL Server configuration Manager' ?
    2) What type of authentifation does your database instance has (AFAIK it should be 'Mixed' (both via Windows credentials and local users)) ?
    2.2) Could you login with the credentials in connectionString by 'SQL Server Managment Studio' ?
    3) could you auth the database via 'osql' tool (MS console client for MSSQL server)) ?
    4) What does 'osql -L' returns ?
    4) Event that MSSQL server locates on the same machine, in connectionString.config I have the connection string like 'datasource=HOSTNAME\SID;initial catalog=hglab; user id = hglab; password=***'
    BTW, the HOSTNAME is also present in the result list of 4th point.
    4.2) Does the default port is 1433? (Computer Management >> Service and Application >> SQL Server 20xx Configuration >> Network Configuration)
    5) this link would be helpful: http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
    Does it helped you?

    BTW,
    >> All of the searching I have done on the internet has yielded no helpful troubleshooting.
    I'm totally disagree with you. I found a lot of articles which describe the potentially problems and their solving (And I fix the like like you have by myself (In fact, I'm not .net developer :) ))

    Slava

  2. Support Staff 2 Posted by Anton Gogolev on 16 Jul, 2013 06:34 AM

    Anton Gogolev's Avatar

    Hello and sorry for the delay.

    Slava gave some sound advice, but if you want to, we can arrange a TeamViewer session (with all the NDAs required) so that I could diagnose the issue.

  3. 3 Posted by kvagen on 16 Jul, 2013 04:04 PM

    kvagen's Avatar

    Hello Slava,

    I appreciate the response. I will respond inline.

    1. Yes. I cannot, however, seem to start Server Agent.
    [cid:[email blocked]]
    2. The authentication was set to windows, I changed it to both.
    3. Yes.
    4. The final one listed is the environment I am working in.
    [cid:[email blocked]]
    5. This was my connectionStrings.config file:
    <connectionStrings>
      <add connectionString="Server=SQLEXPRESS;Database=hglab;User ID=hglab;Password=****" name="hglab" />
    </connectionStrings>

    I changed it to:
    <add connectionString= "Data Source=W0133394\SQLEXPRESS,8000;Initial Catalog=hglab;Integrated Security=False;User ID=hglab;Password=****;Connect Timeout=30" name="hglab" />

    I am making some progress here because now my error is
    A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)
    I am not sure where I am getting booted out. I know it has to do with the Windows Authentication and the SQL authentication ‘hglab’ somewhere, but I cannot find it in the Management Studio.

    Thank you for your help so far!
    Kevin Andrew Vågen
    Programmer Analyst
    Cancer Center Protocol Office
    Massachusetts General Hospital
    326 Cambridge Street
    Boston, Massachusetts 02114
    [email blocked]<mailto:[email blocked]>
    617 724 1268

  4. 4 Posted by kvagen on 16 Jul, 2013 08:03 PM

    kvagen's Avatar

    I have gotten the problem to Error 500.19 and error 0x80070005 which talks about Web.config and ApplicationHost.config. I configured IIS_IUSRS to Read and afterwards the page just continually stalls without timing out.
    I am wondering how the Hglab works with the ApplicationHost.config file. Should I create it? I cannot seem to find it- but I am working on the Web.config part.

    Kevin Andrew Vågen
    Programmer Analyst
    Cancer Center Protocol Office
    Massachusetts General Hospital
    326 Cambridge Street
    Boston, Massachusetts 02114
    [email blocked]<mailto:[email blocked]>
    617 724 1268

  5. Support Staff 5 Posted by Anton Gogolev on 17 Jul, 2013 06:45 AM

    Anton Gogolev's Avatar

    Kevin,

    Glad you apparently waded through SQL Server connection problems. With IIS, could you please send a screenshot (that blueish one) with the error message?

    And to remind you: I'm available for a TeamViewer session to help you out.

  6. 6 Posted by kvagen on 17 Jul, 2013 01:44 PM

    kvagen's Avatar

    I am wondering if this is an issue with the application pool.

    With the
    .Net Framework Version: 4.0
    Pipeline mode: Integrated

    I still have several choices for Application Pool, something which is not mentioned on your installation page. I can select:
    DefaultAppPool
    ASP.NET v4.0
    And the site I created (named ‘Mercurial’)

    How does this come into play? Could this affect the TCP connection?
    Kevin Andrew Vågen
    Programmer Analyst
    Cancer Center Protocol Office
    Massachusetts General Hospital
    326 Cambridge Street
    Boston, Massachusetts 02114
    [email blocked]<mailto:[email blocked]>
    617 724 1268

  7. 7 Posted by kvagen on 17 Jul, 2013 01:58 PM

    kvagen's Avatar

    I’d love to schedule a TeamViewer session, though I am inclined to believe that you are nowhere near my time zone (I received that at 2:46AM local time).

    Taking a look here we have three error codes thrown for the “forcibly closed”
    [SqlException (0x80131904)
    [HttpException (0x80004005)
    [HttpException (0x80004005)

    Each of these is a login issue. I imagine it has something to do with the way my Windows authentication is conflicting with the hglab (SQL Server) login. What was a Named Pipes Error is now a TCP error 0.

    [cid:[email blocked]]

    Kevin Andrew Vågen
    Programmer Analyst
    Cancer Center Protocol Office
    Massachusetts General Hospital
    326 Cambridge Street
    Boston, Massachusetts 02114
    [email blocked]<mailto:[email blocked]>
    617 724 1268

  8. 8 Posted by kvagen on 17 Jul, 2013 02:46 PM

    kvagen's Avatar

    I still think the issue is related to the connection string validating the hglab database, which is the vague part of your installation page. I agree that it is getting more difficult to diagnose, however I feel I am not far off.

    Kevin Andrew Vågen
    Programmer Analyst
    Cancer Center Protocol Office
    Massachusetts General Hospital
    326 Cambridge Street
    Boston, Massachusetts 02114
    [email blocked]<mailto:[email blocked]>
    617 724 1268

  9. 9 Posted by kvagen on 17 Jul, 2013 04:53 PM

    kvagen's Avatar

    I am now fully configured, thank you for your insight and help!

  10. 10 Posted by Slava Davydov on 17 Jul, 2013 05:51 PM

    Slava Davydov's Avatar

    @kvagen
    Could you describe what was the root of your issue and how it has been resolved (just for my insight) ?

    @Anton
    I believe, It would be great to include summary of this thread into 'Installing HgLab' article

    Slava

  11. 11 Posted by kvagen on 17 Jul, 2013 06:09 PM

    kvagen's Avatar

    Slava,

    I figured out how to create the proper connection string through the TestConnection.udl trick, http://blogs.msdn.com/b/farukcelik/archive/2007/12/31/basics-first-udl-test.aspx which got me 80% there. I created a blank textfile named such, then I configured the file through properties.
    Provider tab: select ‘SQL Server Native Client 11.0’ (may not be necessary)
    Connection tab:
    server name: ‘<servername>\SQLEXPRESS’
    use a specific user name and password
                    enter ‘hglab’
                    unclick ‘blank password’, enter <password>
    select the database: ‘hglab’

      I took the string contained in there from the notepad, past the Provider element. It gave me this:
    Integrated Security="";Persist Security Info=False;User ID=hglab;Initial Catalog=hglab;Data Source=<servername>\SQLEXPRESS;Initial File Name="";Server SPN=""

    I then had to troubleshoot the security, which was the big issue- I needed to turn the Integrated Security to false, and then add the hglab password. I deleted the ‘Initial File Name’ and ‘Server SPN’. The error message walked me through the syntax errors. I found a Microsoft article which broke down all the SQL Server connectionstring terms. I then had to put “name” element afterwards and then it worked.

    <add connectionString= "Integrated Security=false;Persist Security Info=False;User ID=hglab;Password=<password>;Initial Catalog=hglab;Data Source=<servername>\SQLEXPRESS;" name="hglab" />

    The site is configured in IIS7 as “DefaultAppPool” with the 4.0 and integrated pipeline from the tutorial.
    Kevin Andrew Vågen
    Programmer Analyst
    Cancer Center Protocol Office
    Massachusetts General Hospital
    326 Cambridge Street
    Boston, Massachusetts 02114
    [email blocked]<mailto:[email blocked]>
    617 724 1268

  12. 12 Posted by Slava Davydov on 17 Jul, 2013 06:13 PM

    Slava Davydov's Avatar

    thanks )

  13. Anton Gogolev closed this discussion on 22 Jul, 2013 01:54 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

19 Mar, 2021 06:13 PM
01 Mar, 2021 02:51 PM
01 Jan, 2021 02:19 AM
28 Aug, 2020 08:34 AM
23 Jun, 2020 08:29 AM

 

19 Dec, 2019 06:58 AM
21 Aug, 2019 09:07 AM
30 Jul, 2019 08:59 PM
31 May, 2019 02:29 PM
26 Nov, 2018 01:47 PM
16 Nov, 2018 07:51 PM