How to determine identity of missing LocalDB instance? - visual-studio-2012

I have a small Web API app that runs fine under Visual Studio. When I try to deploy it under IIS, however, I get this:
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: 50 - Local Database Runtime error occurred.
The specified LocalDB instance does not exist. )
The app is using a sqllocaldb server, and the server is started and queries (via sqllocaldb info) as being alive and running. I have tried setting the app pool Identity to my userid vs using "ApplicationPoolIdentity", and have tried setting up and using a shared version of the server. Changing the userid produced a different but equally unhelpful message; using a shared server changed nothing.
I've also determined that I can provoke the same message running directly in VS if I use a bogus server instance name in the connection string.
It would be ever so slightly helpful if the error message positively identified which server instance it cannot find, but nowhere in the message (either in the browser or when examined by an attached Visual Studio session) does it name the missing server.
How can one identify the "does not exist" server?
Update:
A coworker solved my problem (without actually answering the above question). The solution was to open my applicationHost.config file (In Windows\System32\inetsrv\config) and edit the <system.applicationHost> <applicationPools> <add> item for the application pool containing my app and add (within the <processModel> element) loadUserProfile="true" setProfileEnvironment="true". Exactly what that hocus pocus does I don't know, but he found it here.

Related

SharePoint 2010-"Cannot connect to the configuration database"

I have TFS 2012 which integrated with SharePoint service, recently I duplicated the same machine for testing, and modified some parameters on the testing machine to avoid conflict due to they are in the same networking. They works well.
Today the production server's SharePoint site prompt "Cannot connect to the configuration database", but team foundation service works well, I doubt that something in the testing server cause this, and I shutdown testing server, the issue still exists.
Before I have experience for this issue, most of them are related with SQL server instance configuration like this "https://mikessharepoint.wordpress.com/2011/11/22/cannot-connect-to-the-configuration-database-error-of-central-administration/" or some authentications issue in the IIS application pool.
and here is the error event from event viewer:
"
Unknown SQL Exception 53 occurred. Additional error information from SQL Server is included below.
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 doubt that something (probably SQL server instance name) on production server change to testing servers by some action, but I don't know where and how.
And I doubt that the new server cause the error, the reason is I find something incorrect in wss_config database of production server, the "ServerName" filed in table TimerJobHistory, some value are new server, some value are old server. But even I update all the value to old server and restarted the production server, it does not work.
I check all things I can googled, but nothing works, is there anybody could provide any help on this, appreciate for any kindly help.
Finally, I find the root reason, there is a table named "Objects" in the "Wss_config" DB, I find the new testing server name in "Name" filed, so I update the value to old server name-->Restarted IIS and SharePoint service (not sure if required)-->Bingo!
But I still don't know why the new server cause this error, so I have not power on the new server for now. Will update if any new detection.
Thanks all for your kindly help.

Unable to Add Azure DB Firewall Rule to Allow Build Server to Run Tests

We use a Visual Studio Online-hosted build server to automate our build process. As part of this I'm looking into adding unit and integration tests into this process.
These tests require access to our SQL Azure DBs (2 of them, both on the same server), which in turn requires access through the DB server's firewall.
I have a PowerShell script which uses New-AzureRmSqlServerFirewallRule to add IP addresses to the DB server, and these firewall rules are successfully showing up in the Azure portal.
Specifically, the script adds firewall rules for:
All IPv4 addresses* on the build server (as returned by Get-NetIPAddress)
Build server's external IP address (as returned by https://api.ipify.org)
In conjunction, it appears that the pre-defined AllowAllAzureIPs and AllowAllWindowsAzureIps rules are automatically added.
However, the tests subsequently fail with the exception:
System.Data.SqlClient.SqlException:
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)
I'm unsure why the build server is unable to reach the DB server - could it be that the host of the test processes is using yet a different IP address?
Update
As has been pointed out, the exception message mentions "Named Pipes Provider" which suggests that the DB connection is using a named pipe instead of an IP/TCP connection. To test this I changed the local app.config to contain an unknown/random/inaccessible IP and ran the tests locally (they otherwise run successfully locally): I received exactly the same exception message mentioning "Named Pipes Provider". Perhaps at some level the ReliableSqlConnection class resolves to a named pipe but my point is that I can induce this very same exception by changing to an unknown or inaccessible IP address in my DB connection string.
Furthermore, the DB connection string starts with tcp: which, as per this blog post, explicitly tells the connection to use TCP/IP and not named pipes.
I have also modified the firewall rule to permit all IP addresses (0.0.0.0 to 255.255.255.255) but the same exception is still thrown. This suggests that the SQL Azure firewall rule is not the cause of the 'blockage'.
My suspicion therefore turns to network access being blocked (though a whitelist is probably present to permit the build server to reach the code repository). I added a very simple PowerShell script to the start of the build process:
Test-Connection "172.217.18.100" #resolves to www.google.com
This results in
Testing connection to computer '172.217.18.100' failed: Error due to lack of resources
Have the build servers disabled ping/ICMP or is all outgoing traffic blocked?
* The script only considers IPv4 addresses because I haven't had any success in passing IPv6 addresses to New-AzureRmSqlServerFirewallRule.
We finally solved the issue. The problem had nothing to do with Firewalls. The issue was that the app.config files in our unit test didn't go through the transformation step that our web.config files did. So all the settings were from our local development and therefore wrong.
More about this here:
Connect to external services inside Visual Studio Online build/test task
What connection string are you using? Your error seems to indicate that this is not truly a firewall issue, but rather a connection is being attempted to a server that doesn't exist.
My * incorrect * hypothesis right now is that your connection string contains only the server name, without .database.windows.net suffix which causes the client driver to look for server on local network. The error presented appears to not be a firewall related issue.
( Edited to reflect author feedback. )
If you're connecting over TCP, then why is your error message saying Named Pipes?
[...]
(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
I'd look into this paradox first.
The firewall test is very simple, allow 0.0.0.0 to 255.255.255.255 or 0.0.0.0/0 and re-test. My money is on the same error message.

IISWMSVC_STARTUP_UNABLE_TO_ACTIVATE_HWC

We've been able to successfully, automatically, deploy our MVC and WebApi to IIS7.5 on Win2008 R2, for some time now. Just this week the MSDeploy stopped working. The System event log shows this error when attempting to restart the Web Management Service on the targeted Win200 R2 server:
The Web Management Service service terminated with service-specific
error %%-2147483640.
The Application log shows this error at the same exact time the above error occurs.
IISWMSVC_STARTUP_UNABLE_TO_ACTIVATE_HWC
Failed to activate the Hostable Web Core (HWC). Web Management Service startup failed. Please reference the Win32 error in this
event for further information.
Exception:System.Runtime.InteropServices.COMException (0x8007007F):
The specified procedure could not be found. (Exception from HRESULT:
0x8007007F) at
System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32
errorCode, IntPtr errorInfo) at
Microsoft.Web.Management.Server.WebServer.Microsoft.Web.Management.Server.Interop.IWebServer.Start()
Process:WMSvc User=NT AUTHORITY\LOCAL SERVICE
The above error is preceded by this warning:
A listener channel for protocol 'http' in worker process '7164' serving application pool 'WMSvcAppPool' reported a listener channel
failure. The data field contains the error number.
Which is preceded by this error:
Failed to find the RegisterModule entrypoint in the module DLL C:\Windows\Microsoft.NET\Framework64\v4.0.30319\webengine.dll. The
data is the error.
We've attempted to reach the target server using https://ourservername:8172/MsDeploy.axd. The response is:
Error 102 (net::ERR_CONNECTION_REFUSED): The server refused the
connection
Is this occurring because the port is blocked or because the Web Management Service is not running? (The Windows Firewall with Advanced Security dialog says the "Windows Firewall is off" and there are no entries in the firewall log (C:\Windows\System32\LogFiles\Firewall).
We've seen some posts that indicate the certificate may be the issue. Not sure how to actually tell if this is the case though. The CERT we have says it is valid thru 2029.
I resolved the problem on a cloned Win2012 VM by changing the SSL certificate which was set to the original host. I used the self-cert.
I've put this here as a potential answer as I didn't read the question far enough to see the SSL comment at the end ;) and although the fix took 30 seconds we spent at least 2 days trying everything else.

CruiseControl.NET multiple build servers authentication

I have CCNET 1.8.5.0 installed on two build servers and I configured WebDashboard on one server to monitor both of them. But it leads to such bug: when user logs in to one of the servers, webdashboard shows him as being authorized on other server too (Logout button is showed instead of Login). But when it tries to access project on second server he gets usual error:
Request processing has failed on the remote server: Permission to execute 'ViewProject' has been denied.
How could I force webdashboard to separate authorization on every server?
this seems to be a bug :-(
there is no configuration to my knowledge that would bypass this problem for the moment.

Pre-Login Handshake Error Connecting to SQL Server 2012 through VS 2012

So I'm simply trying to connect to a SQL Server 2012 instance running on a local server running Windows Server 2012 through Visual Studio 2012's SQL Server Object Explorer. I can connect to it through other computers, locally and remotely, perfectly fine, but for some reason my desktop gives me this lovely error:
"A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The wait operation timed out.) (Microsoft SQL Server, Error: 258) - The wait operation timed out."
I'm using SQL Server Authentication in SS2012, unencrypted, etc. I'm really not sure what information to include, I'm sure it's some stupid issue, but for the life of me I can't find a solution. All searches give me a bunch of old as hell results.
Have you tried Fully qualified domain name?
Looks like a DNS issue

Resources