zmanda / amanda

Amanda Network Backup
https://www.zmanda.com/downloads/
Other
227 stars 108 forks source link

NT_STATUS_ACCESS_DENIED causes amdump to fail #77

Open nslay opened 7 years ago

nslay commented 7 years ago

When backing up a Windows (an actual Windows server) share //server/share, command_estimate() will fail when smbclient's "du" reports NT_STATUS_ACCESS_DENIED to \System Volume Information and \$RECYCLE.BIN\folder which can never be accessed. Currently, it does not appear to be possible to backup entire Windows shares with amsamba.

smbclient 4.x has been known to have a bug where it stops recursing after encountering NT_STATUS_ACCESS_DENIED, but I have manually verified that smbclient 4.3 continues to properly recurse even in the presence of NT_STATUS_ACCESS_DENIED. It reports the total bytes and exits as expected by amsamba. However, amsamba/sendsize seem to treat anything printed to stderr as fatal even though it could get the estimate.

There is no apparent workaround. There is no way to exclude files/folders in recursions performed by smbclient du. There does not appear to be an option to silence such errors in smbclient either.

amsamba needs to discard NT_STATUS_ACCESS_DENIED messages for low level system/file system information like System Volume Information and $RECYCLE.BIN. It might also discard these errors for matching entries in the exclude list/files.

delton137 commented 5 years ago

I am having a similar problem with amdump-3.5.1 and smbclient 4.7.6 - the estimation of required space performs correctly but then I get NT_STATUS_ACCESS_DENIED errors during the backup - so backing up a Windows client doesn't work at all.

As a side note, there are tons of error messages being reported in /var/amanda (such as regarding $RECYCLE.BIN and the NT_STATUS_ACCESS_DENIED message). Some of the error log files were taking up gigabytes of space and there doesn't seem to be any mechanism to automatically flush large log files or suppress repeated error messages.

stefangweichinger commented 5 years ago

stuff like that:

 ? smbclient: cli_setatr failed: NT_STATUS_ACCESS_DENIED

This might be catched by another line like in

https://github.com/zmanda/amanda/pull/111/files

.. if someone wants to try that ;-)