Team Foundation Server Power Tools which user need access to network share for backup

Locked Team Foundation Server Power Tools which user need access to network share for backup

  • Wednesday, October 26, 2011 1:35 PM
     
     

    I want to use the power tools' backup but I can't find out which user needs which rights on the network share where the backup should be put on.

    There is one domain user that is running the main sql server services and this is also the user account that is used inside the backup plan and as I could see that user is also used inside the task that is created by the backup plan. That user already has write and change permission on the network share (sharing and security tab).
    If I create a full backup manually from TFS Administration Console there are no problems.
    If I run an automatic backup from the same sql server (for logs and "ignored" dbs) to the same network share there are also no problems.

    Even if I start the scheduled task that is created by the backup plan manually, it works.

    But I think it has to be a permission issue because if I give everyone the read and change permission on that network share then it works.

    Error in the log:
    Taking full backup of database Tfs_Configuration
    Microsoft.SqlServer.Management.Smo.FailedOperationException: Backup failed for Server 'serverXXX'.  ---> Microsoft.SqlServer.Management.Smo.SmoException: System.Data.SqlClient.SqlError: Write on "\\server\YYY\TfsPowerToolsBackup\Tfs_Configuration_20111026020026F.bak" failed: 64(The specified network name is no longer available.)

    Could anybody tell me what is missing? Thank you!

    • Moved by Andrew.Wu Thursday, October 27, 2011 2:55 AM (From:Visual Studio Setup and Installation)
    •  

All Replies

  • Thursday, October 27, 2011 2:51 AM
     
     

    Hi webjagger,

    I'm going to help move your post to the dedicated Team Foundation Server – Power Tools & Add-ons Forum for better support.

    Thanks for your understanding.

    Best Regards,


    Andrew Wu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Friday, October 28, 2011 9:04 AM
    Moderator
     
     

    Hello webjagger,

    Thanks for your post.

    I think in order to back up TFS databases to one network path, you need to have the appropriate permission to that path first. And just the Read and Change permission is not enough, you need also to have the write permission.

    And with the write permission granted, you are allowed to create new files on that path. Otherwise you are not allowed to create or add new files.

    Thanks.


    Vicky Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Friday, October 28, 2011 9:49 AM
     
     

    Hello Vicky,

    Thank you for your help.

    I'm no longer sure if it really is a matter of rights.
    If I start the TfsFullBackup task manually it works. If the task is started time triggered in the morning, it does not work.
    But I think it should be always started with the given (in the task) user account, no?

    Regards,

    Alex

  • Monday, October 31, 2011 2:36 AM
    Moderator
     
     

    Hello Alex,

    Yes, you are correct that the TFS backup plan always starts with the given task account. And based on your description that you can work with manually backup but not with schedule backup, I agree with you that your issue may not be related to user’s permission.

    So, when you do not have your TFS schedule backup work, do you get some errors? And please also take a look at the event logs in the Event Viewer on the TFS AT machine, and post me the useful information.

    Thanks.


    Vicky Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Thursday, November 03, 2011 11:33 AM
     
     

    Hello Vicky,

    if the task is starting triggered by time during the night I get the error as I wrote in my first post.
    If I start the same task manually from the scheduled tasks window, I could not find any according error in the logs (TFS log files and event log).

    I would understand if there would only be a difference between the time triggered start of the scheduled taks and the manual start of the Manual backup from TFS Admin console. But I don't understand how there can be a difference between time triggered start and manual start of the same scheduled task.

    Sorry, I think I can not provide the info you mentioned.

    Thanks Alex

  • Friday, November 04, 2011 8:08 AM
     
     

    Yesterday I tried to let the scheduled task to start time triggered without beeing logged on to the TFS server (I just set the scheduled time a few minutes ahead) and tried changing the permissions of the network share.

    Then I watched at the server where the backup is put to with the filesvr.msc what happened during the backup, especially which users had sessions. Only the domain user that is used inside the backup scheduled task and the TFS server itself appeared.
    So I removed the write/change rights in sharing tab for "everyone" and tried again. That worked.

    But now during the night the backup failed again but the backup server has no downtime.
    It's giving the following error in the TFS backup log:

    [Info   @01:00:16.510] -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    [Info   @01:00:16.510] Taking full backup...
    [Info   @01:00:16.510] -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    [Info   @01:00:16.510] Addin Data Source=tfsserver;Initial Catalog=Tfs_DefaultCollectionMIS;Integrated Security=True
    [Info   @01:00:16.510] Taking full backup of database Tfs_Configuration
    [Error  @01:00:47.805] Microsoft.SqlServer.Management.Smo.FailedOperationException: Backup failed for Server 'tfsserver'.  ---> Microsoft.SqlServer.Management.Smo.SmoException: System.Data.SqlClient.SqlError: Write on "\\backupserver\TfsPowerToolsBackup\Tfs_Configuration_20111104020016F.bak" failed: 64(The specified network name is no longer available.)
       at Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQueryWithMessage(StringCollection queries, ServerMessageEventHandler dbccMessageHandler, Boolean errorsAsMessages)
       at Microsoft.SqlServer.Management.Smo.BackupRestoreBase.ExecuteSql(Server server, StringCollection queries)
       at Microsoft.SqlServer.Management.Smo.Backup.SqlBackup(Server srv)
       --- End of inner exception stack trace ---
       at Microsoft.SqlServer.Management.Smo.Backup.SqlBackup(Server srv)
       at Microsoft.TeamFoundation.PowerTools.Admin.Helpers.BackupFactory.BackupFullsUsingSMO(String serverName, String databaseName, String fullFileName, Int32 retentionDays, Int32 statementTimeout)
       at Microsoft.TeamFoundation.PowerTools.Admin.Helpers.BackupFactory.BackupUsingSMO(BackupSetType backupType, String serverName, String databaseName, String fileName, Int32 retentionDays, Int32 statementTimeout)
       at Microsoft.TeamFoundation.PowerTools.Admin.Apply.TakeFullBackup.Run()
    [Error  @01:00:47.805] Failed taking full backup.
    [Error  @01:00:47.805] Backup failed for Server 'tfsserver'.
    [Error  @01:00:47.805] !NODE Error!:
    [Error  @01:00:47.805] Backup failed for Server 'tfsserver'.
    [Info   @01:00:47.805] Microsoft.TeamFoundation.Admin.ConfigurationException: Backup failed for Server 'tfsserver'.

    The same error appears in the application event log of the TFS server, of course.
    And I can see success audits in the security event log of the backup server at that backup time for the used domain user and the TFS server.

    When I started the scheduled task time triggered a few minutes ago again, the whole thing worked again.

    I'm quite sure that it would work again during the night if I give "everyone" again full rights in sharing - but I can't understand why!


    • Edited by webjagger Friday, November 04, 2011 8:24 AM
    •  
  • Thursday, December 01, 2011 12:05 PM
     
     
    I solved the problem. I just shifted the task two hours later and now it works.
    I haven't found the reason yet, but both servers have no downtime during the night.