The server was not found or was not accessible - Server was lost for 6 hours - sql

First off, I only have a very basic understanding of SQL. I can create tables etc. but configuration is beyond me. I am running my web site with MVC3 ASP.Net on a windows 2008 server using SQL Express.
Everything works fine, my connection strings are correct, I can use the website and it reads and writes to the dB, I can also view the dB with management studio on the server.
Today I got the following error:
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)
When I tried to log on to the database in management studio on the server I get a similar error. the only fix I have found is for a server restart. The database was down for 6 hours before I noticed which is not good for a start up website.
Has any one seen this issue before? Is this an express issue? Any help or advice would be great.

Troubleshoot as you would any network error. Start with the server's event logs.
As for notification of downtime, there are a lot of web services that will monitor your web site and email or send you an SMS message if it's not responding. Two that I've used are uptimerobot.com and basicstate.com. There are dozens of others.
You could also rewrite your ASP.Net app to email or text you when certain kinds of errors happen.

Related

SQLExpress database file auto-creation error - after deploying to Azure

Was going about with our usual deployment of code (ASP.NET MVC solution) to Azure to a test instance as an App service. The solution works on local machine, but started throwing this exception in Azure.
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)"
Description: 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.
* SQLExpress database file auto-creation error: *
Unfortunately this seems to be happening even for other environments now. I haven't changed anything there except redeploying. This has nothing to do with connectionString, have triple checked it on the server itself. Basically the solution as it is works, and have been working for all this while, but since last week all new deployments are failing with this error. Even re-deploying the old code seems to fail. I am afraid to try it on any new environments.
No recent changes were made to web.config, all that was updated was some UI components. In any case, even the older code that is running on other environments are failing. Any ideas on why this could be happening?
SQLExpress only exists within Visual Studio. On something like Azure, you need a connection string that points to a real instance of a SQL Server database.

SQL Server connection failure (name pipes error 40)

I am having an issue at work that is driving me mad. I am new to SQL, and am finding my legs as a system administrator (trial by fire). We have a production server that runs a SQL database and I am trying to mimic the production server in a stand-alone (test) environment. My stand-alone server is of the exact hardware and I have ghosted the production server drives on to the test server (stand-alone) as well. Everything is identical. The only difference is my test server is not in a domain. Its only in a workgroup. My setup consists of one client machine (Windows 7) and the test server running Server 2008r2(SP2)+ SQL Server 2008r2.
We have applications that connect to the database and when I run the applications (connect to the database?), I get the following error.
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) (Microsoft SQL Server, Error: 5)
I have been researching this error for about 3 months now. I am at my wits end. I have tried all the solutions I could find. Most of the solutions I found here at this site. Enable remote connections-DONE, Firewall execptions-not necessary as I can disable the firewall since I'm on a standalone network, but I have been down that road before and it did not help. I don't think this is a network issue as I am using just a switch with the server and one client connected. I can ping back and forth between the systems.
I've tried so many other solutions that I cant even remember them all. Changed so many settings I've lost count. Thank goodness I can re-image the server back to normal if I feel I've gone to far and changed too many settings to where I can't remember what I've done.
As you can tell, I probably only make things worse the more I try to fix the error, but I have no choice. Everyone is looking at me to fix this and get the test server working, but I need some help. A huge thank you in advance to anyone that can help me solve this. It would be greatly appreciated!

Connecting to local server in SQL Server Management Studio

I have tried EVERY suggestion I have found so far in SE and nothing works. Let me explain what is going on.
I am a PHP developer and I am making a transition to ASP. So I am developing a website locally and I need a database going, also locally. But like I said, I can't add the NORTHWND database because I don't have the server up and running. I read through the tutorials and I seen to be missing a piece of every puzzle.
I have SQL Server 2008 running.
These guys Add Database say to attach the database via VS12. I have no such option to "Attach"
These guys here Connect to your server say to connect to the SQL server but I can't connect. When I try, I get an error that says:
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)
(.Net SqlClient Data Provider)
I also noticed there was a localdb with username LOTUSMS. I don't remember ever making a username for anything here. And I can't remove it or make one up. (Windows Authentication)
And then these guys Turn on your Server Service say the Server must be up and running and to log into the SQL server Configuration Manager and ensure the SQL services are running. Well, they are not. It says "the remote procedure call failed" and there is no other options to restart or edit or anything
So as you can see, I know my problems, but I can't find the solution to them. Anyone? I am not sure as to what logs or extra evidence you may need, so before I go adding unnecessary text and pics here, I'll leave it open and produce the evidence as requested.
Thanks in advance

Unable to connect SSMS, Microsoft SQL Server, Error: 53

SQL Server Management Studio is not connecting on my database server machine at production server.
Whereas production sites accessing database. When I tried to connect database from SSMS, I get this error:
Cannot connect to 111.11.11.11.
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)
(Microsoft SQL Server, Error: 53)
I was using this SSMS last couple of years,n this SSMS is running fine since more then year on production database server n i didn't closed ever, now when i connecting this SSMS but facing this issue, whereas my sites which accessing this database is working fine.
I also tried to access database from sqlcmd but no luck n facing facing this error:
HResult 0x35, Level 16, State 1
Named Pipes Provider: Could not open a connection to SQL Server [53].
Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : A network-related or instance-specific error has occurred while establishing a connection to SQL Server.
Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
I thinks we resolved the issues.
1. Active Directory server was not behaving, so
2. SQL server couldn't run without credentials and
3. they found another SQL server issue and fixed it.
We started looking into the SQL connections that my team had found and it lead us to find that the Active Directory server had basically crashed. It was allowing us to log in however it wasn't able to access the majority of the AD functionality. We ended up rebooting the AD server which corrected the issue however we were still seeing issues with the SQL cluster manager and SQL itself was rejecting connections on a somewhat regular basis.
After the AD server was rebooted we were able to log into the SQL cluster manager but with limited capabilities, since it had been erroring due to the AD issue we restarted the cluster service to see if this would correct the issue. This caused the SQL service to fail over to the passive server and caused SQL to start rejecting even more connections than it had been. The cluster service started working with this restart however the SQL connections were getting worse. We found that the IPv6 protocol was enabled for the SQL service which causes problems, like the ones we were seeing, in SQL clusters, to disable this we had to reboot the 2 SQL servers. We rebooted them one at a time and once they were back up everything was working properly.

Error 26 on SQL Server 2008

I have prepared a program with Visual Basic 2010 and I am using a SQL Server 2008 database. (service based database) it works properly. But sometimes (when I don't use computer for a period like 2 hours) I try to start my program on VB (F5), it waits, and then gives this error:
A network-related or instance-specific error occured while
establishing a connection to SQL Server. The server was not found or
is not accesible. Verify that the instance name is correct and that
SQL Server name is configured to allow remote connections. (provider:
SQL Network Interfaces, error: 26 - Error Locating Server/Instance
Specified.)
I have googled it, but nothing helps. I'm afraid this error will be a problem when the user uses the program. How might I solve this?
Probably the network connection turn off after some time. Check System Operating power setting's option
The same issue I faced and got resolved by trying this - in run type services.msc:
the services window will pop up
in that SQL Server(SQLEXPRESS) start this service.
make sure SQL Browser service is running.