Team Foundation Server suddenly failing to connect (Error: TF400324) - sql-server

After using Team Foundation Server (TFS) for years, we suddenly lost the ability to connect either through Visual Studio (VS) or via URL. To the best of my knowledge, no changes were made to the virtual server that supports TFS.
In VS the error is:
TF400324: TF services are not available from server... Unable to connect to the remote server...
If I use the {server}:8080/tfs or localhost:8080/tfs url in a browser it tells me the connection was refused.
In the SQL Management Studio both the Tfs_Configuration and Tfs_DefaultCollection databases appear to be connected, and show a "Ready" status. In the TFS Administration Console the DefaultCollection state is "Online".
Perhaps the best clue is that if I use netstat to see which ports are in use on the server, port 8080 is not listed at all. Is there a listener service that needs to be started?
I see that the following services are currently disabled: UPnP Device Host, SSDP Discovery, Internet Connection Sharing, SSDP Discovery, Internet Connection Sharing, Smart Card, Routing and Remote Access, Net.Tcp Port Sharing Service, and Computer Browser.
Of course, we have tried a reboot to no avail.
Any troubleshooting suggestions will be much appreciated, as this has begun to impact our productivity. Thanks in advance!
Edition: TFS 2015
Version: 14.114.28805.0 (Update 4.2)
Update:
I should mention that the firewall has been disabled in attempting to diagnose the issue.
Also, there are errors associated with TFS in the Even Viewer, but they are not at all clear. Here are is a snippet:
VssRequestContext.HostManagement.Microsoft.TeamFoundation.JobService.Extensions.Core.IdentitySyncJobExtension.Run:1
Registry.TeamFoundationRegistryService.Write:1
Default.SqlResourceComponent.Execute prc_UpdateRegistry ds:LT-TFS2
db:Tfs_Configuration:2 Default.SqlResourceComponent.Execute:-3
Registry.TeamFoundationRegistryService.Write:-3
GroupComponent.SqlResourceComponent.GetGroupsToSync:3
GroupComponent.SqlResourceComponent.Execute prc_GetGroupsToSync
ds:LT-TFS2 db:Tfs_Configuration:3
GroupComponent.SqlResourceComponent.Execute:-4
GroupComponent.SqlResourceComponent.GetGroupsToSync:-4
GroupComponent.SqlResourceComponent.ReadGroups:4
GroupComponent.SqlResourceComponent.Execute prc_ReadGroups ds:LT-TFS2
db:Tfs_Configuration:4 GroupComponent.SqlResourceComponent.Execute:-5

SOLVED!
I found that the TFS site was disabled within the IIS Manager. When I tried to enable it, it reported that the World Wide Web Publishing Service was disabled. Enabling both resolved the issue.

This error is usually related to TFS cache. You could give a try following below steps:
Close all instances of Visual Studio
Open the Task Manager and check if any TFS Services are running. Select each of them and click on End Process Tree
Browse to the folder %LocalAppData%\Microsoft\Team Foundation\ and then select the folder with your TFS version and go inside
the Cache folder. for example, the path was
%LocalAppData%\Microsoft\Team Foundation\x.0\Cache and it should be
the same on your machine with the difference of the TFS version folder
name.
Delete everything in that Cache folder.
Start Visual Studio and run it with Admin mode.
Besides, in case of your TFS is configured with self-signed TLS/SSL certificate.
If this is the case, you need install that certificate to the Trusted Root Certification Authorities store on the client machine, where you have VS.
For this scenario, you could refer this answer.
Moreover, please also check if there are any errors in the event viewer in your TFS server. This may help to narrow down the issue.

Related

ConnectionToTheDatabaseFailed after Upgrade to dnn 9.3.2

DNN Upgrade error from 9.1 to 9.3.2 : After upgrade we observe that if we reboot server and immediately try to access the web site then we get error like 'Connection To The Database Failed'.This is happen only first time after server reboot. once we start receiving this error after then we continue receive this error irrespective of how many times we hit website. It is exists till we do IIS Restart or Application pool recyle manually.
Because of this issue we have paused server reboot schedule as well.
Please guide how to overcome from this.
Just a guess, but is it possible that SQL Server starts up slowly after the reboot.
Try waiting 5 minutes before going to the website.
I'm actually a bit surprised that you have this on a DNN 9 installation. I haven't seen it myself as of DNN 8.
I recall solving that by changing the startup type for IIS (in the services MMC) from "Automatic" to "Automatic (Delayed)". That should give SQL Server a decent chance to be started before IIS is.
You could also try to configure the IIS service being dependent on SQL Server (if both IIS and SQL Server are installed on the same machine):
sc config W3SVC depend=MSSQLSERVER
Take care, if you are using a named instance as in the SQL Server Express standard installation, the name could be MSSQL$SQLEXPRESS or whatever instead of MSSQLSERVER. Have a look at the properties of the service to find out.

SqlFileStream error after SQL Server 2016 (SP2-CU3) upgrade (the device is not ready

We've had this .NET component (.exe) running to migrate documents between 2 databases for almost a year. Console app is using the System.Data.SqlTypes.SqlFileStream .NET class to read/write from file system.
After a recent upgrade of SQL Server to SQL Server 2016 (SP2-CU3) (KB4458871) - 13.0.5216.0 (X64) - the console app has stopped working and throws the following error when trying to open specific document for read operation:
System.ComponentModel.Win32Exception (0x80004005): The device is not ready
We double-checked FILESTREAM properties on both databases to make sure they are enabled (just in case they were removed somehow during the upgrade) and we confirmed they are configured as needed.
We are running out of troubleshooting options as we don't know what to check for. All ports seem to be open between the app server where this tool runs and the database servers (same as before).
Let me know if anybody has any idea what could have changed after recent SQL Server upgrade.
just in case someone faces the same issue... we were able to resolve this by actually disabling FILESTREAM, rebooting servers, enabling FILESTREAM back on.
Issue was related to some un-mapped path of physical drives for SQL (sorry i cant provide more details)

SQL Server Configuration Manager is not in my PC

This may look like a repeat of an already existing question but it isn't.
I am trying to work with an Azure-SQL database. I attempted to log in both from Visual Studio and SQL Server Management Studio and I get the following error:
Now, after some basic troubleshooting I made sure that the firewall in the server had my IP recorded, so that isn't the issue here.
Also, just for trying I did a mobile hotspot from my phone and it logged in with no issues. So for some reason my home network isn't letting me work this.
Now before I reached out to my ISP (which would be hell on earth) I did some more digging and found this: https://stackoverflow.com/a/38641107/6461236
That users suggests that the solution is to go into "SQL Server Configuration Manager" and modify port permissions. But when I attempt to find this, it's not in my PC. I have a Windows 10 PC and I have searched everywhere and I just can't find this SQL Server Configuration Manager. Check out what I get on my Computer Management window:
So the bottom line is that I have installed both Visual Studio 2017 and SQL Server Management Studio 2017 and my computer doesn't have a SQL Server Configuration Manager. After researching a bit more all that I have found is that it should be there.
What did I miss? How can I solve this pesky problem? Thanks in advance!
EDIT: Since I could log in with no issues with my phone as a hotspot and the issues only present themselves when using my home WiFi it seems that this is a problem with my home network and not with my PC or Azure. Any tips? Should a phone call to my ISP solve this?
The issue was that my network firewall was set to "max" and was therefore blocking any outbound traffic on port 1433 (which is necessary to connect to SQL Azure). The solution was to modify the router firewall to allow for communication on this port to be outbound.

A whole storm of unknown errors while rebooting my Sharepoint Server 2010?

Okay, these are the errors I can't backtrace at all. So I was hoping you had any idea.
When I recently rebooted my server (The server is a home computer, and just runs Windows 7 as a development machine) with Sharepoint 2010, a whole list of problems occurred.
The major error was that when I deployed my Visual Studio 2010 project, it couldn't activate my Feature. This happens more often, because I sometimes mess up in my Feature Activation event handler. But, when that happens, I can access the site, and debug the error while activating the feature manually.
However, this time, things were different. My site didn't even want to start up? So I checked IIS Manager, and it said that the site was stopped. Manually starting it resulted in the following error:
The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)
I have no clue what that could mean? What file? The web.config? I really don't know.
But I saw that the Sharepoint Central Administration was running, so I decided to check there. However, this resulted in even more errors, well, there was one, but it really frightened me:
Cannot connect to the configuration database.
So, not only my Web server is having errors, but also my database server. Time to check the event logs is what I thought.
And there I'm a bit stunned. There are so many errors, I don't even know where to start. I'm just going to copy the ones which I think are important.
Unknown SQL Exception -1 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Sharepoint Foundation seems to give me that one.
The World Wide Web Publishing Service (WWW Service) did not register the URL prefix http://*:80/ for site 908852174. The site has been disabled. The data field contains the error number.
IIS-W3SVC seems to give me that one.
I.. really have no clue what could be the case. Since I cannot acces Central Administration, I can't check for any health issues either.
Anyone has even the slightest idea? I didn't do anything funny I believe. I was thinking that it could've been the updates that were installed, but the only updates installed were:
Security Update for Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package (KB973923)
Definition Update for Microsoft Security Essentials - KB972696 (Definition 1.93.855.0)
Definition Update for Microsoft Security Essentials - KB972696 (Definition 1.93.1040.0)
Definition Update for Microsoft Security Essentials - KB972696 (Definition 1.93.1148.0)
So, it really couldn't have been that. I'm out of ideas, and I really would like to solve this.
Thanks,
Mats
EDIT: Okay, manually started up the SQL Service, and now Central Administration works. But, The Health reporting site started scaring me. There's a list of 8 items requiring my attention.
NT AUTHORITY\NETWORK SERVICE, the account used for the SharePoint timer service and the central administration site, is highly privileged and should not be used for any other services on any machines in the server farm. The following services were found to use this account: SharePoint - 80 (Application Pool)
SPUserCodeV4(Windows Service)
OSearch14(Windows Service)
Web Analytics Data Processing Service(Windows Service)
All required products must be installed on all servers in the farm, and all products should have the same patching and upgrade level across the farm.
Upgrade is required on server MATS-PC. Without the upgrade, the server is not in a supported state.
The following databases have versions that are older than the current SharePoint software, but are within the backwards compatible range:
SharePoint_Config_c5681991-3bec-45b3-9376-ea8c19c51b6a,
SharePoint_AdminContent_39d0c8e9-214e-42b9-909e-ffbe4147208b,
WSS_Content,
WSS_Search_MATS-PC,
WSS_Logging.
Those seemed to be the most relevant. Hm. I have no clue? Especially about the upgrading? I didn't upgrade anything recently.
Especially about the upgrading? I didn't upgrade anything recently.
This sounds a lot like a Microsoft Update. Service packs for SQL Server come through Microsoft Update, and if you applied those without checking carefully, some of them produce similar symptoms to what you're describing. SQL Server can take longer to start up, and when that happens, sometimes antivirus software grabs the MDF/LDF files for scanning. That will cause the databases to be unavailable, and other services will then fail on startup.
When you started SQL manually, things started working again, but now you've got version dependency problems. You're lucky SQL even starts, though - I've had clients with issues where SQL won't start after careless SP applications if they had changed the SA login, for example.
The errors you got while doing the reboot where just because the SQL Service did not startup. No database = no SharePoint. This happens to me all the time.
The other messages in Central Administration are nothing to do with your SQL startup and chances are they have been there for some time.
As any other developer on a single box hosting SharePoint, you have permissioned stuff with a single powerful account. Central Admin now detects this and gives you the warning.
It looks like the SharePoint versions of one or more of your server databases are out of sync with the version of 2010? Not exactly sure how it got into this state, but for a dev box I would not be completely stressed. An upgrade to the new service pack hopefully would sort this out.

SQL Server Browser showing only hostname, not instance name

I just setup a new Windows Server 2008 machine with an instance of SQL Server 2008 Express. The SQL Browser service does not appear to be working correctly. In Management Studio, browsing for servers shows the hostname of the new server, but not the instance name. When you choose the hostname form the list it doesn't connect. But I can connect manually by typing the hostname\instancename combination.
update 1:
The browser service is running, and I have tried it with several different accounts, including domain administrator which is a bad practice, but I tried anyway for troubleshooting purposes.
I have tried punching the appropriate holes in the firewall, and also completely turning the firewall off.
This is running on a Hyper-V, Windows Server 2008 32 bit guest, which is on a Windows Server 2008 64-bit host. I have done this before (without issues) on this same host, but with SQL 2008 Standard instead of Express.
When I browse for the server in SSMS(Express) on the SQL Server machine, it works fine and shows the whole instance name. When I browse for it on a remote machine (on the same intranet) with SSMS (standard) it just shows the host name.
update 2:
Followed the packets as suggested and found the following
The client sent the broadcast as expected and received correct responses from other SQL Servers on the same network.
The server received the broadcast but did not send a response.
Considering these results, I wonder why the host name ever appears in the client list in the first place. It shouldn't show up at all, right?
update 3:
Spent an hour and a half on the phone with Microsoft support. I learned a few things, but the problem is not yet solved. It was suggested that I try installing an instance of SQL Standard on the same machine. I did that and the new instance exhibits all the same symptoms. The hostname shows up in the browse list only once, not once for each instance.
update 4:
Stackoverflow chose an answer for me thanks to the bounty system, but this question is not answered. Today I tried moving the whole VM to a different host server - everything is exactly the same. The hostname still appears in the browse list, without the instance name.
update 5:
Confirmed that Hyper-V Integration Services are installed on the guest (SQL) server.
check that the browser service is running, it's not turned on by default.
UPDATE1: See if you can install Network Monitor/Wireshark to do a network trace on the SQL Server to see if it's receiving the broadcasts and sending responses. I think this is your best option in troubleshooting this issue. According to MSDN the service uses UDP port 1434, so this is the traffic to watch.
UPDATE2: Does the server have multiple IP's? according to this MSDN article the Windows Server 2008 firewall has issues responding to SQL Browser service broadcasts, even with rules allowing packets through.
I tend not to rely on browsing. You'll get inconsistent results because browsing sends out a broadcast udp/1434 packet and waits for responses back. However, since you are able to connect remotely via SERVERNAME\INSTANCENAME, that aspect of the SQL Browser service is working. If it wasn't, you wouldn't have been able to connect. With that said, to troubleshoot the browsing portion:
Have you tried stopping and restarting the SQL Browser Service?
Have you tried stopping and restarting the instance if that didn't work?
To completely troubleshoot this, unfortunately, you'd have to do packet traces.
Sounds like the browsing service is messed up somehow...
I don't know if you can temporarily take this SQL Server down temporarily. But if so, you may want to try this:
Uninstall all SQL\instances completely.
Run the install of SQL Express 2008
Create a default instance during install (Not a named instance)
Run the installer again and create the default named instance (SQLExpress)
Try connecting to the named instance again. If it works, you can remove the default instance.
I had the same issue in a VM. After shutting down the Firewall it worked.
I just had this same issue. I was not able to see Instance Names in the SSMS Network Servers tab. It turned out that I had set up Hyper-V and created an Internal Network on my local machine. That network was identified as a Public/Guest Network and the Windows Firewall was ENABLED for it, even though my Domain setting has the Firewall DISABLED. Once I disabled that guest network on my computer I could see all the instances.
Machines:
Physical SQL Server 2014 Ent
Windows 8.1 laptop running Hyper-V

Resources