TF270016: An error occurred publishing log files from - tfs

Team,
Its frustrating so far today with TFS 2012, I have been queuing a build and the build server is unable to copy/drop to the specified folder. I have installed TFS 2012 on Win Server 2008 R2. Basically the error says that the access to the destination folder is denied and so it is not able to copy. The TFS admin console shows the build service is running as LocalService. And I granted full control to the local Service account to the drop folder. I tried to even fiddle with Share tab in the properties of the folder. There is no network as such any way, only single machine with all the TFS services running on it. I even tried to put the drop folder on C drive itself without any success. Can some one please throw some light? What am I missing? Seems to be some thing trivial.
The following is the exception details.
Exception Message: TF270016: An error occurred publishing log files from 'C:\Builds\1\Tfs_TeamProjectTrail\Tfs_Trial1_CI\Sources\Main\Tfs_Trial1\Tfs_Trial1.log' to '\localhost\d$\VD\Tfs_Trial1_CI\Tfs_Trial1_CI_20130309.21\logs'. Details: Access to the path '\localhost\d$\VD\Tfs_Trial1_CI\Tfs_Trial1_CI_20130309.21\logs' is denied. (type PublishLogFileException)
Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Inner Exception Details:
Exception Message: Access to the path '\localhost\d$\VD\Tfs_Trial1_CI\Tfs_Trial1_CI_20130309.21\logs' is denied. (type UnauthorizedAccessException)
Exception Stack Trace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
at Microsoft.TeamFoundation.Common.FileSpec.CopyFile(String oldPath, String newPath, Boolean overwriteExisting)
at Microsoft.TeamFoundation.Build.Workflow.Activities.WindowsDropProvider.CopyDirectory(String sourceDirectory, String targetDirectory)
at Microsoft.TeamFoundation.Build.Workflow.Activities.WindowsDropProvider.CopyDirectory(String sourceDirectory, String targetDirectory, String[] renameIfExists)
at Microsoft.TeamFoundation.Build.Workflow.Activities.PublishLogFile.Execute(CodeActivityContext context)

This is just a permissions issue.
Start by running the build service as a local user / domain user (if applicable) and get that to work.
Create a proper share rather than using the default admin shares (d$)
Make sure that both sharing and security tab on the folder properties allow write permissions to that user.
The error log says "\localhost" the correct way to access this would be "\\localhost" (this could me a stackoverflow editor issue though and not relevant)
I don't currently have time to write a complete answer, but I can expand later.
ProcMon is also a great program to use when troubleshooting this kind of thing.
I think this is a good starting point.

Simply make sure Drop directory and Build service have full privilegies for "Local service" group.

Default account with which tfs build service is run is nt authority\network service. After compiling solution\project, it is this user which tries to copy bits to the build share.
So add permissions to this account on your build share.

[TFS2013] I had this error when I turned off the drop folder option, and removed the path. By specifying a drop folder again (UNC) for the output files in the build configuration solved the problem.
It seems TFS is twitchy if you don't have a drop folder at all, even though it gives you the option to not have one.

Related

BackupSets.xml locked by SYSTEM

I have an installation of TFS 2018 which is split over an app and database server. Both servers run Windows Server 2016. Frequently I get an error that the scheduled backup has failed because BackupSets.xml is locked.
Process Explorer shows that it is locked by SYSTEM. There is plenty of disk space on the backup disk (Currently 1.3TB and the full backup is 150GB).
The only way I have found to resolve this is to reboot both the app and database servers. This is not a viable long term solution to this.
Has anybody else encountered anything similar? Can you suggest a solution?
[23.03.2018 19:04:51] [Error]
Exception Message: The process cannot access the file
'\\DatabaseServer\TFSBackups\BackupSets.xml' because it is being used by
another process. (type IOException)
Exception Stack Trace: at System.IO.__Error.WinIOError(Int32 errorCode,
String maybeFullPath)
at System.IO.File.InternalDelete(String path, Boolean checkHost)
at Microsoft.TeamFoundation.Admin.BackupSets.Save(String folder)
at Microsoft.TeamFoundation.Admin.Jobs.DatabaseBackupJob.TakeTransactionalBackups (IVssRequestContext requestContext, BackupSettings settings, ITFLogger logger)
at Microsoft.TeamFoundation.Admin.Jobs.DatabaseBackupJob.RunBackupJob(IVssRequestContext requestContext, BackupJobType requestedJobType, String& resultMessage)
[23.03.2018 19:04:51] [Info] Backup Job Finished. Completed: Transactional. Result = Failed
First, suggest you to check the Event View on both server to see if there are more log info for troubleshooting. Also check the process especially for TFS related if some thing hangs on.
In this case you could try below solution:
Delete the Backupsets.xml file altogether
Reconfigured Backups using the wizard - Now that it didn't find the
xml file at all it created a new one.
Ran a full backup - which should be successfully.
Double check if the scheduled backups will now also work from now on.

No content nodes after Umbraco 6 upgrade

I asked this question in the Umbraco forum three days ago and haven't had a single answer. I have a website whose content I can no longer edit and I know the people at SO are the best, so here goes:
I just upgraded a site from Umbraco version 4.6.1 to 6.0.0 and now the only thing that displays in the content tab in the backend is a "Content" node. The whole tree has disappeared but the site actually still works it's just that I can't reach any of the content in the backend--Media, Settings, Developer, etc. tabs all appear to be working as normal.
If I right-click on the only visble node, "Content", I get "Create", "Sort", "Republish Entire Site" and "Reload nodes".
Create gives me the expected create dialog box but I don't want to try creating anything yet until I know what's wrong.
Sort throws the following error:
Server Error in '/' Application.
Object reference not set to an instance of an object.
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.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
umbraco.cms.businesslogic.CMSNode..ctor(IUmbracoEntity entity) +32
umbraco.cms.businesslogic.Content..ctor(IContentBase contentBase) +18
umbraco.cms.businesslogic.web.Document.<GetRootDocuments>b__1(IContent c) +38
System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +151
System.Linq.Buffer`1..ctor(IEnumerable`1 source) +325
System.Linq.Enumerable.ToArray(IEnumerable`1 source) +78
umbraco.cms.businesslogic.web.Document.GetRootDocuments() +123
umbraco.cms.presentation.sort.OnPreRender(EventArgs e) +813
System.Web.UI.Control.PreRenderRecursiveInternal() +103
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
Republish works without error re-creating the umbraco.config file in the App_Data folder.
Reload nodes appears to be trying to, well, reload the nodes, but nothing shows up in the end.
I'm using a MySql database and I'm happy to hack at it with a few sql commands to get things working again as I suspect that a few errant node ids are probably to blame but I don't know what tables to look at.
All help gratefully received.
PS: Umbraco "About" shows the following version information -- "Umbraco v6.0.0 (Assembly version: 1.0.4779.24222)"
I'd suggest that rather than troubleshooting the issue at this point, which is more like chasing a rabbit down a hole, that you take a copy of your backups and attempt the upgrade again. It's possible that you could have missed a step in the upgrade process. Pay special attention to the upgrade notes and the version specific upgrade notes (pretty much every version specific note can apply to you).
If you find that you still have problems after the second attempt, I'd suggest a more granular upgrade path, such as upgrading to highest version of 4.7, then to the highest 4.11, and then finally the highest of 6.0, again paying attention to the upgrade notes and checking after each upgrade that the site still works.
In either case make sure that you are running the installer at the end as this will allow umbraco to make some necessary changes to your database.

"Unable to open the database file" (warning: Wide error)

I cannot seem to get anything out of SQLite other than "Unable to open the database file" on IIS. I'm convinced SQLite's error messages are as brusque as Oracle's.
Pre-deployment in Visual Studio 2010/IIS Express I can both read and write to the file.
When I tried to read/write it with the same VS2010 project deployed to IIS7.5, all "create", "read" and "write" commands fail.
The same occurs when I deploy the database file through the project and try to read it.
I've given Full control access to App_Data and the database file to the following users: IIS_IUSRS, IUSRS, DefaultAppPool, and Everyone.
I've looked at:
SQLite problem "unable to open the database file" (The problem automatically went away for the user) and a number of other similar questions, most of which were solved by changing permissions, changing to a writable directory (App_Data should be writable, no?) or changing a relative path to an absolute one (which |DataDirectory| should resolve to).
<connectionStrings>
<add name="sqlite" connectionString="Data Source=|DataDirectory|\datatables.sqlite;Version=3;" />
</connectionStrings>
Have I missed anything?
<Error>
<Message>An error has occurred.</Message>
<ExceptionMessage>Unable to open the database file</ExceptionMessage>
<ExceptionType>System.Data.SQLite.SQLiteException</ExceptionType>
<StackTrace>
at System.Data.SQLite.SQLite3.Open(String strFilename, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, Int32 maxPoolSize, Boolean usePool) at System.Data.SQLite.SQLiteConnection.Open() at AjaxSource.Models.Database.query(String sql, Dictionary`2 parameters) in D:\Tools\Dropbox\Projects\myprojects\AjaxSource\AjaxSource\Models\Database.cs:line 48 at AjaxSource.Models.aaDataModel..ctor() in D:\Tools\Dropbox\Projects\myprojects\AjaxSource\AjaxSource\Models\aaDataModel.cs:line 18 at AjaxSource.Controllers.API.TableDataController.Get() in D:\Tools\Dropbox\Projects\myprojects\AjaxSource\AjaxSource\Controllers\API\TableDataController.cs:line 15 at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.<GetExecutor>b__c(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments) at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)
</StackTrace>
</Error>
I had a problem opening Sqlite database in IIS
(0x80004005): unable to open database file unable to open database
file
what helped me to solve the problem is changing the "Identity" of the application pool to "LocalSystem"
Application Pools -> DefaultAppPool (or another pool you are working with) -> Advanced Settings -> Identity -> LocalSystem
Hopefully it will save someone time...
We used to encounter this problem on the machines of our customers most often, and I have made a lot of investigation upon it and finally we've solved it.
First of all, you need to make sure that your application has read/write access to the database file as well as the folder containing the database file. In most situations, the check will fix the issue; but we are not among those fortunate ones.
In our case, where the application makes very highly concurrent access to the database, it's most probably related to the journal mode of the database, which usually is DELETE by default. That is to say, the rollback journal will be deleted once the corresponding transaction is committed or rolled back. On **nix systems, it's no error; but on Windows systems, it's another story, as can be seen below. On Windows systems, the problem could take place in the following scenario:
A journal file (say A) is created by a SQLite thread.
Another thread P tries to open A.
SQLite has finished its transaction and so deletes the journal file A.
But now thread P has handle for A, so SQLite enters the “Delete Pending” state.
SQLite starts another transaction and has to recreate the journal file (with the same name).
Windows reports ERROR_DELETE_PENDING error (see here for more information: http://blogs.msdn.com/b/oldnewthing/archive/2007/11/09/6001644.aspx)
SQLite report SQLITE_CANTOPEN error (that is, "Unable to open the database file").
P finally releases the file handle and A is deleted.
One solution is to use PERSIST or TRUNCATE journal mode instead of DELETE. See here for more details: http://www.sqlite.org/pragma.html#pragma_journal_mode
In this way, the rollback journal (.-journal) is not deleted at all, and thus we can get rid of the problem you said. I hope this helps.
Well I don't know if this will answer your question, but in my case I had a dummy error which is that I gave a wrong relatif URL to the database file when I copied my code from a commandline projet to the mvc one. Hope someone will find this useful.
It wasn't a permissions problem. The problem is that I didn't check that |DataDirectory| actually resolved to the AppData directory like it's supposed to.
On the IIS 7.5 server, |DataDirectory| resolves to C:\inetpub\wwwroot\AjaxSource\App_Data, but the actual AppData is directory is C:\inetpub\wwwroot\AjaxSource\bin\App_Data.
The errors I caught using Fiddler never mention any paths, but imply a permissions problem. I had one of my views display the resolved directory with:
<h1>#AppDomain.CurrentDomain.GetData("DataDirectory")</h1>
(Oddly, this isn't documented).

Access file from shared folder from Windows Service

I have a windows service on XP OS in .Net Framework 2.0 which access folder and reads file from it to load it in database.
Shared folder has permission for "Everyone" with full control with all subfolder. and service runs on "Local System Account". and currently system running with Administrator account.
The stack trace is :
Message : Error while searching for files in : \\nw1\data\nov2012
Access to the path '\\nw1\data\nov2012' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalGetFileDirectoryNames(String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, SearchOption searchOption)
at System.IO.DirectoryInfo.GetFiles(String searchPattern, SearchOption searchOption)
at System.IO.DirectoryInfo.GetFiles()
at MyWinApp.Winservice1.SearchFiles(String imp, FileFolder objFile)
Edit: I found on MSDN that "LocalSystem Account has extensive privileges on the local computer" but not sure why it is not able to access network shared folder
can anyone suggest sollution for this problem?
Thanks,
I searched on internet but everywhere i found that anyhow i have to provide username/password to provide proper permission to windows service to access network shared folder(directly to windows service property or in windows service code like given here, code in that thread is here). so to make it working it for now i set username/password manually to service property.
If you are running the service with a local account (I believe is windows what we are talking about) and that local account does not belong to the domain or a domain.
You can always create the local account on the computer that is running the services AND create the local account on the computer that is sharing the folder.
Same account name, same password. It will work

Unit Testing MVC Web Application in Visual Studio and Problem with QTAgent

I have been attempting to run a Unit Test in visual studio for an MVC Application and continuously getting the following error:
The URL specified ('http://localhost:21496/') does not correspond to a
valid directory. Tests configured to run in ASP.NET in IIS require a
valid directory to exist for the URL. The URL may be invalid or may
not point to a valid Web application.
The only advice around is to make sure you have a localhost address in the UrlToTest attribute like so:
[TestMethod()]
[HostType("ASP.NET")]
[UrlToTest("http://localhost:21496/")]
This however still doesn't run against IIS Express or IIS 7 on Windows 7 and when I delved into the event logs, found the following problem.
(QTAgent32.exe, PID 6976, Thread 15) WebSites.GetWebServer: failed to create AspNetHelper: Microsoft.VisualStudio.Enterprise.Common.AspNetHelperException: The website metabase contains unexpected information or you do not have permission to access the metabase. You must be a member of the Administrators group on the local computer to access the IIS metabase. Therefore, you cannot create or open a local IIS Web site. If you have Read, Write, and Modify Permissions for the folder where the files are located, you can create a file system web site that points to the folder in order to proceed. ---> System.Runtime.InteropServices.COMException: Unknown error (0x80005000)
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_IsContainer()
at System.DirectoryServices.DirectoryEntries.ChildEnumerator..ctor(DirectoryEntry container)
at Microsoft.VisualStudio.Enterprise.Common.IISHelper.GetWebServerOrdinal(Uri site)
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Enterprise.Common.IISHelper.GetWebServerOrdinal(Uri site)
at Microsoft.VisualStudio.Enterprise.Common.IISHelper.get_WebServerOrdinal()
at Microsoft.VisualStudio.Enterprise.Common.IISHelper.get_RootPath()
at Microsoft.VisualStudio.Enterprise.Common.IISHelper.get_PhysicalPath()
at Microsoft.VisualStudio.Enterprise.Common.AspNetHelperMan..ctor(Uri uri, BasicAuthCredential credential, Int32 frameworkMajorVersion)
at Microsoft.VisualStudio.TestTools.HostAdapters.WebSites.GetWebServer(String webServerName, WebServerType webServerType, String urlToTest, String pathToWeb, String webAppRoot, BasicAuthCredential credential, Context context, WebSiteConfigurationType webSiteConfigType, Origin origin)
The next step I took was to make sure the QTAgent32 always runs with administrative privileges, along with visual studio.
I am now at a loss and cannot think of anything else to try, so do hope someone can at least point me in some direction.
Thanks
The tests were created in a default ASP.NET environment. In order to test the controllers but without the need to run the web application, you must delete the following attributes before the test methods.
[HostType("ASP.NET")]
[UrlToTest("http://localhost:21496/")]
I ran into the same problem today (also at this thread). I had the same errors in my event log:
(QTAgent32.exe, PID 12348, Thread 61) WebSites.GetWebServer: failed to create AspNetHelper: Microsoft.VisualStudio.Enterprise.Common.AspNetHelperException: The website metabase contains unexpected information or you do not have permission to access the metabase. You must be a member of the Administrators group on the local computer to access the IIS metabase. Therefore, you cannot create or open a local IIS Web site. If you have Read, Write, and Modify Permissions for the folder where the files are located, you can create a file system web site that points to the folder in order to proceed. ---> System.Runtime.InteropServices.COMException: Unknown error (0x80005000)
That lead me to this blog post which seems to have resolved the issue.
I just needed to go to "Turn Windows features on or off" and add IIS 6 Management Compatibility and all four subcomponents. I'm running Windows 7 Home Premium which doesn't have the Windows Authentication option, but that didn't seem to be an issue. Give it a shot and see if that resolves the issue for you.

Resources