Network share not accessible for xp_fileexist

  • Hi there,

    I'm using the backup solution from ola hallengren but I'm stuck using this script for backing up to a file share.

    I created the following code to execute the stored procedure:

    EXECUTE [dbo].[DatabaseBackup]

    @databases = 'USER_DATABASES'

    , @Directory = N'\\dfs\distribution$\BackupDFSsql\Backup_SQL\dbserver1'

    , @BackupType = 'FULL'

    , @verify = 'Y'

    , @CleanupTime = 24

    , @checksum = 'Y'

    , @LogToTable = 'Y'

    The SQL Server Service and the SQL Server Agent Service run under a domain account with modify rights in the root folder: \\dfs\distribution$\BackupDFSsql\Backup_SQL

    I even gave the service accounts full rights to do anything on the folder: \\dfs\distribution$\BackupDFSsql\Backup_SQL\dbserver1

    When I execute the stored procedure I get the following error message:

    Date and time: 2014-03-20 08:16:56

    Server: dbserver1

    Version: 11.0.3128.0

    Edition: Standard Edition (64-bit)

    Procedure: [DBA].[dbo].[DatabaseBackup]

    Parameters: @databases = 'USER_DATABASES', @Directory = '\\dfs\distribution$\BackupDFSsql\Backup_SQL\dbserver1', @BackupType = 'FULL', @verify = 'Y', @CleanupTime = 24, @Compress = NULL, @CopyOnly = 'N', @ChangeBackupType = 'N', @BackupSoftware = NULL, @checksum = 'Y', @BlockSize = NULL, @BufferCount = NULL, @MaxTransferSize = NULL, @NumberOfFiles = NULL, @CompressionLevel = NULL, @Description = NULL, @Threads = NULL, @Throttle = NULL, @Encrypt = 'N', @EncryptionAlgorithm = NULL, @EncryptionKey = NULL, @ReadWriteFileGroups = 'N', @OverrideBackupPreference = 'N', @LogToTable = 'Y', @Execute = 'Y'

    Source: http://ola.hallengren.com

    Msg 50000, Level 16, State 1, Procedure DatabaseBackup, Line 384

    The directory \\dfs\distribution$\BackupDFSsql\Backup_SQL\dbserver1 does not exist.

    I opened the stored procedure and noticed the xp_fileexists extended stored procedure was used.

    When I execute the xp_fileexists with the UNC path I get the following result:

    File ExistsFile is a DirectoryParent Directory Exists

    000

    I tested the same code with a local folder and that works fine.

    File ExistsFile is a DirectoryParent Directory Exists

    011

    I've searched for a long time but I can't seem to find an answer why the folder can't be found.

    I'm a 100% sure that the folder exists, that the rights for the services and my user are correct.

    Did I forget to configure something?

  • I finally found out what the problem was.

    The problem was that my serviceaccount for the SQL Server Agent had a length of more than 20 characters.

    This caused issues with the validation against several parts.

    To make matters worse why I just couldn't figure out what went wrong was that the replication of the domain controllers was really slow.

    It took more than 16 hours to let the changes in the security groups be replicated to all domain controllers.

    These two issues made this pretty hard to figure out what the problem was.

    Thank to Ola for replying to my post by email.

  • I was having the same issue. Service set to start with NT Service\MSSQL$MSSQL2012 and changed it to Network Service and it worked fine after that.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply