TFS - Build Service Starts and then throws a HTTP code 500: System.ServiceModel.ServiceActivationException - tfs

I have been working on restoring a build server (tfs 2012) from a backup and all manner of things got messed up (the tfsservice account password had been altered and I had to go to every service and app pool on the box and update it). Once sql was backup I was able to update the password via the TFS admin console app. Then I was able to re-register the build service and add a controller and a build agent. It starts briefly and shows green for a few seconds before stopping and a "details ..." button appears next to the Build Service. If I click the details button I see the following
"Please contact your administrator. There was an error contacting the server. Technical information (for administrator): HTTP code 500: System.ServiceModel.ServiceActivationException"
I have checked the http bindings in iis for the tfs site and there is only the one "*:8080"
I tried hardcoding it to the ip on the box and I still get the same error. If I go to one of the client machines and try and queue a build it shows the build server as being offline.
I have also checked for multiple host headers and the memory utilization which are the most common responses to this particular issue. Neither of them seem to be the cause or the solution.
Any ideas or suggestions are welcome I have run out of ideas to try here. Thanks in advance for any help you have to offer.
EDIT -- also found this in the log: Build machine MyMachine lost connectivity to message queue tfsmq://buildservicehost-25/.

Related

Error 500 when trying to connect to Team Foundation Server

I have installed and configured Team Foundation Server 2015 Update 3 in one of our server a few weeks ago.
All was going well until the pc unexpectedly was shut down due to electrical problem. After turning on again we now get:
Error 500 internal server error.
Tried to access the web server and got the HTTP Error
403.14 - Forbidden.
TFS administration console seems fine. I'm not sure where to look next. Help would be greatly appreciated.
First, please check your Event View on your TFS server machine to see if there are more detail info or error message for trouble shooting.
For Error 500 internal server error. There's no much value for now.
For 403.14-Forbidden error, this may related to IIS server. Suggest you try to restart the TFS applicaton on IIS. And also clean all cache of TFS server, located at%LOCALAPPDATA%\Microsoft\Team Foundation\7.0\Cache
To narrow down the issue, you could also use Visual Studio to connect TFS server. If this works, suggest you to clear IE cache and try again.
Besides, since the PC unexpectedly shut down, please also check if the related TFS service started properly, if not manually start them.
In case someone else runs across this issue, we had the same problem and it turned out to be the system time on our TFS SQL Server had gotten out of sync. It was off by a number of hours. When I reset the time to be correct, I was able to connect to the TFS instance again without issue.
I got this error when I was migrating from TFS 2013 to AzureDevops Server 2020 using XAML Build. The error on Event Viewer from Application Tier Server was "Exception Message: The protocol binding ':443:.domain.com.br' is not valid for 'https'. This might be because the port number is out of range. (type UriFormatException)". I adjusted on IIS the https bindings to accept requests from IP Server.
enter image description here

Error when trying to delete build definitions in TFS web interface

I'm getting a server error when I try to delete build definitions from a project on the Team Foundation Server 2015 web interface.
The error message that pops up is:
Error(s):
500: 500: error
TFS.WebApi.Exception: 500: error
at k (http://timeweb:8080/tfs/_static/tfs/Dev14.M102/_scripts/TFS/min/corejs?v=ITI0eYHCCehqqjk6JTyPaR5R793ETLoY2_Lqz191Pyo1:64:375)
at http://timeweb:8080/tfs/_static/tfs/Dev14.M102/_scripts/TFS/min/corejs?v=ITI0eYHCCehqqjk6JTyPaR5R793ETLoY2_Lqz191Pyo1:64:2955
at d (http://timeweb:8080/tfs/_static/tfs/Dev14.M102/_scripts/TFS/min/corejs?v=ITI0eYHCCehqqjk6JTyPaR5R793ETLoY2_Lqz191Pyo1:64:635)
at http://timeweb:8080/tfs/_static/tfs/Dev14.M102/_scripts/TFS/min/corejs?v=ITI0eYHCCehqqjk6JTyPaR5R793ETLoY2_Lqz191Pyo1:64:2888
at l (http://timeweb:8080/tfs/_static/tfs/Dev14.M102/_scripts/TFS/min/q.js:27:8122)
at http://timeweb:8080/tfs/_static/tfs/Dev14.M102/_scripts/TFS/min/q.js:27:8348
at t.when (http://timeweb:8080/tfs/_static/tfs/Dev14.M102/_scripts/TFS/min/q.js:27:3780)
at t.u.promiseDispatch (http://timeweb:8080/tfs/_static/tfs/Dev14.M102/_scripts/TFS/min/q.js:27:2824)
at http://timeweb:8080/tfs/_static/tfs/Dev14.M102/_scripts/TFS/min/q.js:27:1649
at MessagePort.t (http://timeweb:8080/tfs/_static/tfs/Dev14.M102/_scripts/TFS/min/q.js:27:5773)
I also get a similar error when I try to save changes to a build definition.
I'm doing everything with an administrator account on the server.
It's acting like the user has INSERT permission in the database but not DELETE or UPDATE, but I'm not sure if this is the cause and the permissions in the database seem OK (why would they be configured incorrectly after a fresh install?).
I'm using a local SQL Server Express instance. I'm using Windows Authentication for TFS, and I'm able to login with Windows Authentication and manually delete them from the database using SQL Server Management Studio.
I just did another uninstall/fresh install and I'm still seeing this error. Any insight into the cause or solution would be much appreciated.
UPDATE
A SQL Server trace isn't showing any relevant commands being received when I attempt the delete/edit, so it seems like the error is happening before it even reaches out to the database.
First, please make sure you have enough permission. Such as edit build definition . You can use tf permission command to list the realted permission info.
For example: tf permission /user:userID /collection:http://xxx:8080/tfs/defaultcollection
which will return the modified permission for that user under the collection path. Also work with server path.
Also add your user in Team Project Administrator Group and Build Administrator Group.
Try to clean browser cache and close the browser then try it again.

What reason and solution for WebConnector Error : "Update aborted. Company file is locked by another client ASP17"

I am using WebConnector version -2.1.0.30 with QuickBooks 2015 Enterprise.
WebConnector was working fine but all of a sudden when I run WebConnector and click on "Update Selected" button then it came up with this error (Note: by that time no one was logged on to QuickBooks).
Then as a quick fix I have deleted that QWC file and added a New one, that works fine.
Can any one please come up with a better solution and the reason behind this error.
Thanks in advance.
Chances are you're running QuickBooks on a shared Windows Server, or in a hosted scenario with someone like Right Networks, Intuit Cloud, Cloud9, etc.
If so, this error means that Windows Server auto-logged-out some user and closed QuickBooks for them, but is still holding the file lock on the QuickBooks company file. Windows will automatically release the file lock after a short amount of time (usually 30 minutes to an hour).
There is no "fix" outside of waiting for a while, and then trying again.

TFS 2012 continuous integration deployment fails - Directory not empty

Sporadically get the error
An error was encountered when processing operation 'Delete Directory'
on
'D:\xxx'. The error code was
0x80070091. The directory is not empty.
I'm using web deploy WMSVC and the user has full access to the root of the site (set up through IIS > Configure Web Deploy Publishing
EDIT
Or less frequently:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets (4377): Web deployment task failed. (Unable to perform the operation ("Delete File") for the specified directory ("D:\xxx\bin\Microsoft.Practices.ServiceLocation.dll"). This can occur if the server administrator has not authorized this operation for the user credentials you are using. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_INSUFFICIENT_ACCESS_TO_SITE_FOLDER.)
I follow the instructions for the user (a domain user) but it makes no difference. The publish settings that get saved have publishMethod="MSDeploy" instead of WMSVC.
Note, it deploys correctly 95% of the time.
I know this sounds stupid, but do you have those folders open (or children thereof) on any computer? Especially if you had a dead remote desktop session or someone accessing it over the network share it will get a denial to be able to delete the directory.
Burned me a number of times, you're issue may be different though. I realize this is a late response, but found it while searching for my own issue and though I cuold help.

TFS 2010 Build: Sporadic failure in the process

We have a situation where our builds have stopped executing in a stable manner.
At a rate of about one every three we receive either TF215096 or TF215097 errors & the Build fails.
If we then restart the Build controller, it works again - until next time.
The errors we get are:
TF215096: An error occurred while connecting to controller vstfs:///Build/Controller/1: There was no endpoint listening at ht*p://XXXX that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
TF215096: An error occurred while connecting to controller XXX - Controller: Could not connect to ht*p://XXX. TCP error code 10061: No connection could be made because the target machine actively refused it 192.168.XXX.XXX:XXX.
TF215097: An error occurred while initializing a build for build definition \XXX: Team Foundation services are not available from server ht*p://XXX. Technical information (for administrator): The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.
TF215097: An error occurred while initializing a build for build definition \YYY: An error occurred while receiving the HTTP response to ht*p://XXX. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.
Server logs provide with little info, at least we 've found nothing that helps us resolve the situation. Various searches in the Net were also not productive.
Does anybody had these/similar issues? Any ideas on how/where to look for a resolution?
Thank you very much in advance for any input!
Yeah it does sound like you have some connectivity issues. You can try enabling SOAP tracing on both the build machine and the server (if possible) to see if there is any error. If it still does not give you any new information, contact Microsoft by filing a Connect Bug to get help.
I am not sure if it will help you but I have ran into similar issues with build agents and ended up just deleting and re-creating the agent. You may try deleting your controller/agent and adding it back in. A brute-force solution but a good starting point. If that doesn't resolve the issue at least you can eliminate the controller/agent as the issue and take a look at network/server related issues.
Today is a happy day, since we managed to get to the bottom of the matter. Sorry #Duat that I'm taking away the 'answer' checkmark - but it turned out that the problem was quite different from what you (and anybody else) has predicted.
In my last update I was about to forward the matter to MS, when we realized that our Firewall was misbehaving in the name resolution. So we assumed this was the culprit & awaited for this to resolve. After this was resolved, we STILL had the same issues and we went again re-examining the situation.
We isolated the problem within our Build Process, more specific with a custom code activity included in our build solution.
I had implemented a code activity that would kick in at the final steps of every build. This activity was about gathering BuildDetails about the running build & add them as a new line in a 'BuildLog.xls'. Implementation made use of Microsoft.Office.Interop.Excel.This excel sheet resides in another server (NOT on the Servers where the controller/agents reside).
During development of this activity I was faced with issues like this, but after I was done no instances of EXCEL were left hanging. So I thought this was done & dealt with.
With try & error, we observed that when this activity wouldn't ran, no problems would occur.
With this activity running, the very first build after a build-controller reset would succeed, any next build had a certain chance to fail. Once any build failed, no other would succeed until another build-controller reset.
I have only a general understanding of what the problem was (Excel-call is DCOM, TFS services are WCF : How on earth would they interfere?! Why would this sometimes succeed and sometimes fail?! ).
The provided diagnostics were no help either, in fact they mislead us into a loop that continued for months.
If I ever find the time, I 'd like to cleanly reproduce the error & make a Server Fault question out of it...
After removal of this activity it works! I now searched in SO & found this, where J.Saunders comments: "In general, you should never use Office Interop from a server environment". It's ironic that once you get to the bottom of any difficult issue, the whole universe seems to have known about it except you...

Resources