TFS 2013.2 Installation Error - tfs

Last night while attempting to upgrade from TFS 2013 RTM to TFS 2013.2 I received the following error. I ran the installation as administrator, I am the TFS Administrator for our organization and I ran the upgrade from TFS 2013 RTM to TFS 2013.2 in our staging environment without issue. The only difference in the two environments is the collection DBs are not exactly the same.
[Error #22:27:44.807]
Exception Message: TF255077: The access control list (ACL) could not be set on the following path: D:\TFS\CacheRoot . (type ConfigurationException)
Exception Stack Trace: at Microsoft.TeamFoundation.Admin.FileSystemHandler.SetAcls(String[] identities, String[] pathsForAccess, Boolean skipIfAclExists, ITFLogger logger)
at Microsoft.TeamFoundation.Admin.ConfigureSetAcls.Run(ActivityContext context)
Inner Exception Details:
Exception Message: Invalid name.
Parameter name: name (type ArgumentException)
Exception Stack Trace: at System.Security.AccessControl.NativeObjectSecurity.CreateInternal(ResourceType resourceType, Boolean isContainer, String name, SafeHandle handle, AccessControlSections includeSections, Boolean createByName, ExceptionFromErrorCode exceptionFromErrorCode, Object exceptionContext)
at System.Security.AccessControl.NativeObjectSecurity..ctor(Boolean isContainer, ResourceType resourceType, String name, AccessControlSections includeSections, ExceptionFromErrorCode exceptionFromErrorCode, Object exceptionContext)
at System.Security.AccessControl.DirectorySecurity..ctor(String name, AccessControlSections includeSections)
at System.IO.Directory.GetAccessControl(String path)
at Microsoft.TeamFoundation.Admin.FileSystemHandler.AddAccessToDirectory(String groupName, FileSystemRights rights, String path, Boolean skipIfAclExists, ITFLogger logger)
at Microsoft.TeamFoundation.Admin.FileSystemHandler.SetAcls(String[] identities, String[] pathsForAccess, Boolean skipIfAclExists, ITFLogger logger)
[Info #22:27:44.807] Node returned: Error
[Error #22:27:44.807] TF255077: The access control list (ACL) could not be set on the following path: D:\TFS\CacheRoot .
[Info #22:27:44.807] Completed SetApplicationACLs: Error
[Info #22:27:44.807] -----------------------------------------------------
[Info #22:27:44.808] Execution results:
[Info #22:27:44.808] Overall result: Failure

It was discovered that there were spaces on either end of the folder location entry in the web.config file in the following location; C:\Program Files\Microsoft Team Foundation Server 12.0\Application Tier\Web Services.
add key="dataDirectory" value=" D:\TFS\CacheRoot "
I removed the spaces and the installation worked perfectly. I have no idea how they got there but it is my assumption that the original TFS 2013 RTM installation may have done this as I pointed the installation to that folder when given the option during setup.

Related

Azure Functions Dependency Injection Failing Again

I have an Azure V2 application running in Azure. For about the 3rd time now over various releases my custom dependency Injection is failing again!
This time it is worse than ever as the issue only happens when it is deployed to Azure and the logging was a nightmare to find out what was happening.
Azure Functions is currently running as follows with the usual error that it is unable to index my Functions.
018-11-10T10:41:56.091 [Information] Host Status: {
"id": "ad-api-dev",
"state": "Default",
"version": "2.0.12165.0",
"versionDetails": "2.0.12165.0 Commit hash: f9d6c271296eaae48f933c67d1df796fd4ff2a94"
}
2018-11-10T10:41:57.607 [Information] Initializing Host.
2018-11-10T10:41:57.607 [Information] Host initialization: ConsecutiveErrors=0, StartupCount=1
2018-11-10T10:41:57.644 [Information] Starting JobHost
2018-11-10T10:41:57.655 [Information] Starting Host (HostId=ad-api-dev, InstanceId=387865be-cfdf-45ca-98ba-2e0091827461, Version=2.0.12165.0, ProcessId=5140, AppDomainId=1, InDebugMode=True, InDiagnosticMode=False, FunctionsExtensionVersion=~2)
2018-11-10T10:41:57.674 [Information] Loading functions metadata
2018-11-10T10:41:57.723 [Information] 15 functions loaded
2018-11-10T10:41:58.158 [Information] Generating 15 job function(s)
2018-11-10T10:41:58.237 [Error] Error indexing method 'CompleteSimulation.Run'
Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexingException : Error indexing method 'CompleteSimulation.Run' ---> System.InvalidOperationException : Cannot bind parameter 'executionService' to type IExecutionService. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
at async Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexer.IndexMethodAsyncCore(MethodInfo method,IFunctionIndexCollector index,CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Indexers\FunctionIndexer.cs : 277
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexer.IndexMethodAsync(MethodInfo method,IFunctionIndexCollector index,CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Indexers\FunctionIndexer.cs : 167
End of inner exception
at async Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexer.IndexMethodAsync(MethodInfo method,IFunctionIndexCollector index,CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Indexers\FunctionIndexer.cs : 175
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexer.IndexTypeAsync(Type type,IFunctionIndexCollector index,CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Indexers\FunctionIndexer.cs : 103
2018-11-10T10:41:58.574 [Warning] Function 'CompleteSimulation.Run' failed indexing and will be disabled.
My local version runs fine as below
Azure Functions Core Tools (2.2.32 Commit hash: c5476ae629a0a438d6850e58eae1f5203c896cd6)
Function Runtime Version: 2.0.12165.0
[10/11/2018 13:35:15] Building host: startup suppressed:False, configuration suppressed: False
[10/11/2018 13:35:15] Reading host configuration file 'Y:\src\modo.solutions\Modo.Esg.Api\ModoSol.Functions.Api\bin\Debug\netstandard2.0\host.json'
[10/11/2018 13:35:15] Host configuration file read:
[10/11/2018 13:35:15] {
[10/11/2018 13:35:15] "version": "2.0"
[10/11/2018 13:35:15] }
[10/11/2018 13:35:17] Initializing extension with the following settings: Initializing extension with the following settings:
You can see I am using the same runtime version locally as Azure, So if anyone knows why my Dependency Injection would work locally but not when deployed it would be appreciated.
I am using Autofac 4.8.1 as my dependency injection container.
Thanks in advance.
BTW If anyone else has that issue of not being able to see why their Functions host is not starting follow these instructions.
Go into the Portal for your Azure function and find and enable the Live Log Streaming.
While this window is open re-deploy/publish your app.
Once thats done go into cloud explorer (Visual Studio Windows only :/) and find the logs.
If you don't have the live log streaming window open while you deploy you don't get any logs!!!
Screen shot below.

Error during restore of TFS backup: TF400856: The following service is not registered in the database: IdentityManagement

I am running TFS 2018 Update2, and I am trying to attach a backup which has been made without detaching it first.
Resorting to "TFSConfig offlineDetach" on these databases results in the errormessage shown below:
[Info #09:30:57.248] [2018-07-12 09:30:57Z] Executing servicing step 'Copy identities to collection database'. (ServicingOperation: Snapshot; Step group: Snapshot.TfsIdentities)
[Info #09:30:57.248] Executing step: 'Copy identities to collection database' PlatformIdentity.SnapshotIdentities (17 of 17)
[Error #09:30:57.295] TF400856: The following service is not registered in the database: IdentityManagement.
[Info #09:30:57.295] Microsoft.TeamFoundation.Framework.Server.ServiceNotRegisteredException: TF400856: The following service is not registered in the database: IdentityManagement.
at Microsoft.TeamFoundation.Framework.Server.TeamFoundationResourceManagementService.DeploymentHostResourceManagementService.CreateDatabaseComponent[TComponent](IVssRequestContext deploymentRequestContext, Int32 databaseId, IVssRequestContext requestContext, String dataspaceCategory, Guid dataspaceIdentifier, DatabaseConnectionType connectionType, ITFLogger logger)
at Microsoft.TeamFoundation.Framework.Server.TeamFoundationResourceManagementService.CreateComponent[TComponent](IVssRequestContext requestContext, String dataspaceCategory, Nullable`1 dataspaceIdentifier, DatabaseConnectionType connectionType, ITFLogger logger)
at Microsoft.TeamFoundation.Framework.Server.TeamFoundationResourceManagementService.CreateComponent[TComponent](IVssRequestContext requestContext)
at Microsoft.VisualStudio.Services.Identity.IdentityDetachHandler.PreTransferSteps()
at Microsoft.VisualStudio.Services.Identity.IdentityTransferHandler`1.Execute()
at Microsoft.VisualStudio.Services.Identity.PlatformIdentityStepPerformer.SnapshotIdentities(IVssRequestContext requestContext, ServicingContext servicingContext)
at Microsoft.TeamFoundation.Framework.Server.TeamFoundationStepPerformerBase.PerformHostStep(String servicingOperation, ServicingOperationTarget target, IServicingStep servicingStep, String stepData, ServicingContext servicingContext)
at Microsoft.TeamFoundation.Framework.Server.TeamFoundationStepPerformerBase.PerformStep(String servicingOperation, ServicingOperationTarget target, String stepType, String stepData, ServicingContext servicingContext)
at Microsoft.TeamFoundation.Framework.Server.ServicingStepDriver.PerformServicingStep(ServicingStep step, ServicingContext servicingContext, ServicingStepGroup group, ServicingOperation servicingOperation, Int32 stepNumber, Int32 totalSteps)
[Info #09:30:57.295] [2018-07-12 09:30:57Z] Servicing step 'Copy identities to collection database' failed. (ServicingOperation: 'Snapshot'; Step group: 'Snapshot.TfsIdentities')
[Info #09:30:57.295] 0,040819
[Info #09:30:57.295] 0,0434132
[Info #09:30:57.295] 5,8540154
[Error #09:30:57.295] The error occurred while detaching the collection database 'TFS_before_projects' offline. See the log file for additional details.
[Error #09:30:57.310] TF400711: Error occurred while executing servicing step 'Copy identities to collection database' for component Snapshot.TfsIdentities during Snapshot: TF400856: The following service is not registered in the database: IdentityManagement.
[Info #09:30:57.310] Clearing dictionary, removing all items.
I've found similar issues at
TF400856: The following service is not registered in the database: IdentityManagement
and
https://social.msdn.microsoft.com/Forums/vstudio/en-US/e6ad3a1a-bfe0-44a9-a3e6-3442004c7687/tf400856-error-identity-management-is-not-registered-in-the-database?forum=tfsadmin
TFS is running perfectly with the current database. I am merely trying to restore a backup as a separate collection, both in the same SQL Server instance.
Any suggestions to actually restore this backup?

NuGet Push Failure in TFS build

Preface: I am running NuGet Server (2.11.3) on Windows 2012 R2 / IIS 8.5. The NuGet Server manages its packages folder in separated file server (shared folder).
Additionally I am running TFS build machine (agent from TFS 2015) that uses this nuget server for both restore and push activities. Naturally, each build, initially, reads the target solution >>> projects >>> packages.config files and restores the configured packages from the nuget server. On late step, the agent generates the required *.nupkg files and pushes them to the nuget endpoint of the same nuget server. Those are dependencies of other solutions.
Problem: the majority of the solutions running properly without any special issues. There are couple of solutions that only 1-3 projects within them, fail the TFS build with the following message:
Response status code does not indicate success: 500 (Internal Server Error).
Unexpected exit code 1 returned from tool NuGet.exe
The IIS logs on nuget server looks like the following:
2017-03-27 16:47:26 192.168.2.116 PUT /MainRepository/nuget/ - 80 - 192.168.1.30 NuGet+Command+Line/3.5.0+(Microsoft+Windows+NT+6.2.9200.0) - 500 0 0 15
2017-03-27 16:47:26 192.168.2.116 PUT /MainRepository/nuget/ - 80 - 192.168.1.30 NuGet+Command+Line/3.5.0+(Microsoft+Windows+NT+6.2.9200.0) - 500 0 0 15
2017-03-27 16:47:26 192.168.2.116 PUT /MainRepository/nuget/ - 80 - 192.168.1.30 NuGet+Command+Line/3.5.0+(Microsoft+Windows+NT+6.2.9200.0) - 500 0 0 31
The following event is logged (shown in the event viewer) in the nuget server:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 27/03/2017 10:40:17
Event time (UTC): 27/03/2017 07:40:17
Event ID: cb897ce6dc2f4e40a07c71a9160718f2
Event sequence: 2073
Event occurrence: 4
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1/ROOT/MainRepository-1-131350724531418170
Trust level: Full
Application Virtual Path: /MainRepository
Application Path: C:\inetpub\wwwroot\NugetServerInternal\
Machine name: NUGET-SRV
Process information:
Process ID: 2512
Process name: w3wp.exe
Account name: some.domain/some.user
Exception information:
Exception type: IndexOutOfRangeException
Exception message: Index was outside the bounds of the array.
at System.Web.HttpRawUploadedContent.get_Item(Int32 index)
at System.Web.HttpMultipartContentTemplateParser.GetNextLine()
at System.Web.HttpMultipartContentTemplateParser.ParseIntoElementList()
at System.Web.HttpMultipartContentTemplateParser.Parse(HttpRawUploadedContent data, Int32 length, Byte[] boundary, Encoding encoding)
at System.Web.HttpRequest.GetMultipartContent()
at System.Web.HttpRequest.FillInFilesCollection()
at System.Web.HttpRequest.EnsureFiles()
at System.Web.HttpRequest.get_Files()
at System.Web.HttpRequestWrapper.get_Files()
at NuGet.Server.Publishing.PackageService.CreatePackage(HttpContextBase context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Request information:
Request URL: http://nuget-srv/MainRepository/nuget/
Request path: /MainRepository/nuget/
User host address: 192.168.1.30
User:
Is authenticated: False
Authentication Type:
Thread account name: some.domain/some.user
Thread information:
Thread ID: 19
Thread account name: some.domain/some.user
Is impersonating: False
Stack trace: at System.Web.HttpRawUploadedContent.get_Item(Int32 index)
at System.Web.HttpMultipartContentTemplateParser.GetNextLine()
at System.Web.HttpMultipartContentTemplateParser.ParseIntoElementList()
at System.Web.HttpMultipartContentTemplateParser.Parse(HttpRawUploadedContent data, Int32 length, Byte[] boundary, Encoding encoding)
at System.Web.HttpRequest.GetMultipartContent()
at System.Web.HttpRequest.FillInFilesCollection()
at System.Web.HttpRequest.EnsureFiles()
at System.Web.HttpRequest.get_Files()
at System.Web.HttpRequestWrapper.get_Files()
at NuGet.Server.Publishing.PackageService.CreatePackage(HttpContextBase context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
NOTE: per my checking sometime the package is created in the packages folder and sometime is not.
NOTE: I am pretty sure that all configuration is in place (including API key etc..). Of course, will be glad to know what is missing though.
Will appreciate any advice on this one.
Many thanks in advance,
Ofer
Poor answer though, but still one that might help any potential issues you guys encounter :-).
I've realized that my "problematic" push requests had worked against newly created NuGet server. The new one was Windows Server 2012 R2 too. I've just raised it clean and added ONLY the necessary windows features to support the IIS/web operations against the Nuget server.
If I am not mistaken it was only ASP.NET 4.5.
Best regards,
Ofer

Why does adding System.Web.WebPages.dll cause "Illegal characters in path." crash?

Brief summary:
When I add System.Web.WebPages.dll to bin folder of my app, .NET framework in my web app starts producing "Illegal characters in path." crash on requests like this:
http://qa.postjobfree.com/autocompleteskills/%22myskill
When I remove System.Web.WebPages.dll from bin folder - the error is gone.
Why does it happen?
Below are clarifying details in Q&A form.
Q1: Why do you add System.Web.WebPages.dll to bin folder if System.Web.WebPages.dll is already part of .NET framework?
Because I want to add MVC to my existing Web Forms application.
Newest version MVC requires System.Web.WebPages.dll (and 5 more DLLs) to be added to bin folder.
Q2: Did you try setting relaxedUrlToFileSystemMapping flag?
Yes. Thanks to Scott Hanselman and multiple answers on Stack overflow, I added this configuration to my Web.Config:
<system.web>
<httpRuntime requestValidationMode="2.0" relaxedUrlToFileSystemMapping="true" requestPathInvalidCharacters="" maxRequestLength="8192" />
</system.web>
I added it several years ago and it fixed "Illegal characters in path." crash.
Now when I'm adding System.Web.WebPages.dll to web app bin folder - Hanselman's solution does not help anymore and I'm getting that crash again.
Here's possible hint to solving the problem: requestPathInvalidCharacters flags were not supported prior to .NET 4.0 (circa 2010).
Q3: Does that "Illegal characters in path." crash happen on all computers?
No.
Unfortunately it crashes in production, but does not crash on my dev machine.
Q4: What's the difference between your production machine and your dev machine?
Production machine has Windows Server 2012 R2
Microsoft Windows [Version 6.3.9600]
Development machine has Windows 7
Microsoft Windows [Version 6.1.7601]
Development machine has Microsoft Visual Studio 2013 installed.
Production only has .NET Framework 4.5.1 (the same as development).
But the most relevant difference between production and development machines is in System.Web.WebPages.dll version that is installed to GAC.
In my research I discovered 3 different versions of System.Web.WebPages.dll:
v1
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.WebPages\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.dll
Size: 136,552 bytes
File version: 1.0.20105.407
Product version: 1.0.20105.407
v2
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.WebPages\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.dll
Size: 204,480 bytes
File version: 2.0.20710.0
Product version: 2.0.20710.0
v3
C:\dennis\projects\ijs\PostJobFreeWeb\bin\System.Web.WebPages.dll
Size: 211,664 bytes
File version: 3.0.20129.0
Product version: 3.0.1-20129
I have v1 in GAC on my production machine.
I have v2 in GAC on my development machine.
I got v3 from MVC nuget package and put it into bin folder of my web app.
Q5: Did you try putting different versions of DLLs into bin folder?
Yes I did.
I found out that putting v1 into bin folder on production machine does NOT cause "Illegal characters in path." crash.
I found out that putting either v2 or v3 into bin folder causes "Illegal characters in path." crash.
So, basically, if dll in bin folder matches with dll in GAC - there is no problem.
But if there is a mismatch - then web project misbehaves.
I also tried to put v1 dll into bin folder on my development machine (dev machine has v2 in GAC). That did NOT cause any problems.
Q6: Error Stack trace?
Message:
Illegal characters in path.
Type: System.ArgumentException
Stack:
at System.IO.Path.Combine(String path1, String path2)
at System.Web.Compilation.DiskBuildResultCache.GetBuildResult(String cacheKey, VirtualPath virtualPath, Int64 hashCode, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetBuildResultFromCacheInternal(String cacheKey, Boolean keyFromVPP, VirtualPath virtualPath, Int64 hashCode, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResultFromCacheInternal(VirtualPath virtualPath, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
at System.Web.WebPages.BuildManagerWrapper.ExistsInPrecompiledSite(String virtualPath)
at System.Web.WebPages.VirtualPathFactoryManager.Exists(String virtualPath)
at System.Web.WebPages.DefaultDisplayMode.GetDisplayInfo(HttpContextBase httpContext, String virtualPath, Func`2 virtualPathExists)
at System.Web.WebPages.DisplayModeProvider.GetDisplayInfoForVirtualPath(String virtualPath, HttpContextBase httpContext, Func`2 virtualPathExists, IDisplayMode currentDisplayMode, Boolean requireConsistentDisplayMode)
at System.Web.WebPages.WebPageRoute.GetRouteLevelMatch(String pathValue, String[] supportedExtensions, Func`2 virtualPathExists, HttpContextBase context, DisplayModeProvider displayModeProvider)
at System.Web.WebPages.WebPageRoute.MatchRequest(String pathValue, String[] supportedExtensions, Func`2 virtualPathExists, HttpContextBase context, DisplayModeProvider displayModes)
at System.Web.WebPages.WebPageRoute.DoPostResolveRequestCache(HttpContextBase context)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

ActiveMQ as a service start errors

I installed ActiveMQ as a service on a Windows 2008 64bit server using commons-deamon.
When I try to start the service I get this error:
ACTIVEMQ_HOME: C:\apache-activemq-5.7.0
ACTIVEMQ_BASE: C:\apache-activemq-5.7.0
ACTIVEMQ_CONF: C:\apache-activemq-5.7.0\conf
ACTIVEMQ_DATA: C:\apache-activemq-5.7.0\data
Loading message broker from: xbean:activemq.xml
INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1#17494c8: startup date [Wed Jan 09 16:45:52 IST 2013]; root of context hierarchy
ERROR | Failed to load: class path resource [activemq.xml], reason: Could not load properties; nested exception is java.io.FileNotFoundException: ${activemq.conf}\credentials.properties (The system cannot find the path specified)
org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: ${activemq.conf} \credentials.properties (The system cannot find the path specified)
It's like it can't find the file
ACTIVEMQ_HOME\conf\credentials.properties
but the file does exist in my folder.
Do I need to manually define environment variables or something of that sort?
Thanks!
There are some files that are missing in the v5.7.0 archive. You can simply copy them over from the older versions. See: Jira issue for this problem

Resources