Linux Client - BTRFS - No permission to stat

Hi,

I’m having issues with backup of and ubuntu linux client. I am using BTRFS and making snapshots with prefilebackup and removing snapshots with postfilebackup. I installed the client with the following guide http://www.urbackup.org/client_debian_ubuntu_install.html.

Here is from the urbackup_client.log:
root@mail:~# tail -f /var/log/urbackup_client.log
2015-11-13 12:10:47: ERROR: No permission to stat “/mnt/snap_root/usr/share/man/man1/db_printlog.1.gz”
2015-11-13 12:10:47: ERROR: No permission to stat “/mnt/snap_root/usr/share/man/man1/db_verify.1.gz”
2015-11-13 12:10:47: ERROR: No permission to stat “/mnt/snap_root/usr/share/man/man1/db_upgrade.1.gz”
2015-11-13 12:10:47: ERROR: No permission to stat “/mnt/snap_root/usr/share/man/man1/db_checkpoint.1.gz”
2015-11-13 12:10:47: ERROR: No permission to stat “/mnt/snap_root/usr/share/man/man1/db_codegen.1.gz”
2015-11-13 12:10:47: ERROR: No permission to stat “/mnt/snap_root/usr/share/reportbug/php5/script”
2015-11-13 12:10:47: ERROR: No permission to stat “/mnt/snap_root/usr/share/zarafa-webapp/plugins/clockwidget/config.php”
2015-11-13 12:10:47: ERROR: No permission to stat “/mnt/snap_root/usr/share/zarafa-webapp/plugins/folderwidgets/config.php”
2015-11-13 12:10:47: ERROR: No permission to stat “/mnt/snap_root/usr/share/zarafa-webapp/plugins/quickitems/config.php”

Here is my client settings:
root@mail:~# cat /usr/local/var/urbackup/data/settings.cfg
update_freq_incr_def=18000
update_freq_full_def=2592000
update_freq_image_full_def=-5184000
update_freq_image_incr_def=-604800
max_file_incr_def=100
min_file_incr_def=40
max_file_full_def=10
min_file_full_def=2
min_image_incr_def=4
max_image_incr_def=30
min_image_full_def=2
max_image_full_def=5
startup_backup_delay_def=0
backup_window_incr_file_def=1-7/0-24
backup_window_full_file_def=1-7/0-24
backup_window_incr_image_def=1-7/0-24
backup_window_full_image_def=1-7/0-24
exclude_files_def=
include_files_def=
computername_def=
default_dirs_def=/mnt/snap_root
allow_config_paths_def=true
allow_starting_full_file_backups_def=true
allow_starting_incr_file_backups_def=true
allow_starting_full_image_backups_def=true
allow_starting_incr_image_backups_def=true
allow_pause_def=true
allow_log_view_def=true
allow_overwrite_def=true
allow_tray_exit_def=true
image_letters_def=ALL_NONUSB
internet_server_def=
internet_server_port_def=55415
internet_authkey_def=1x8Rjz3qfE
internet_speed_def=-1
local_speed_def=-1
internet_image_backups_def=false
internet_full_file_backups_def=false
internet_encrypt_def=true
internet_compress_def=true
internet_mode_enabled_def=false
silent_update_def=false
client_quota_def=100%
local_full_file_transfer_mode_def=hashed
internet_full_file_transfer_mode_def=hashed
local_incr_file_transfer_mode_def=hashed
internet_incr_file_transfer_mode_def=blockhash
local_image_transfer_mode_def=hashed
internet_image_transfer_mode_def=hashed
file_hash_collect_amount_def=1000
file_hash_collect_timeout_def=10000
file_hash_collect_cachesize_def=40960
end_to_end_file_backup_verification_def=false
internet_calculate_filehashes_on_client_def=true
image_file_format_def=vhdz
internet_connect_always_def=false
verify_using_client_hashes_def=false
internet_readd_file_entries_def=true
background_backups_def=true
follow_symlinks_def=false

As you see in settings I have disabled symlinks but still I have the error with no permission to stat.

I don’t really know why this is happening, I mean the urbackup client is running as root so there shouldn’t be any permissions issues.

Thanks!

Regards,
Seventh

Sorry. This could be a red herring. Can you try again with this patch: https://github.com/uroni/urbackup_backend/commit/6a695a3d6acdf140d63ec6013202e3412371a29e.patch ?

I applied the patch and reinstalled the client and now there is another error in the log, “Cannot stat” instead of “No permission to stat”.

Pasting the last lines of the log:

2015-11-14 21:30:35: ERROR: Cannot stat “/mnt/snap_root/usr/share/reportbug/php5/script”: No such file or directory (2)
2015-11-14 21:30:35: ERROR: Cannot stat “/mnt/snap_root/usr/share/zarafa-webapp/plugins/clockwidget/config.php”: No such file or directory (2)
2015-11-14 21:30:35: ERROR: Cannot stat “/mnt/snap_root/usr/share/zarafa-webapp/plugins/folderwidgets/config.php”: No such file or directory (2)
2015-11-14 21:30:35: ERROR: Cannot stat “/mnt/snap_root/usr/share/zarafa-webapp/plugins/quickitems/config.php”: No such file or directory (2)
2015-11-14 21:30:36: ERROR: Cannot stat “/mnt/snap_root/var/run/ldapi”: No such file or directory (2)
2015-11-14 21:30:36: ERROR: Cannot stat “/mnt/snap_root/var/run/udev/watch/41”: No such file or directory (2)
2015-11-14 21:30:36: ERROR: Cannot stat “/mnt/snap_root/var/run/udev/watch/40”: No such file or directory (2)
2015-11-14 21:30:36: ERROR: Cannot stat “/mnt/snap_root/var/run/udev/watch/39”: No such file or directory (2)
2015-11-14 21:30:36: ERROR: Cannot stat “/mnt/snap_root/var/run/udev/watch/38”: No such file or directory (2)
2015-11-14 21:30:36: ERROR: Cannot stat “/mnt/snap_root/var/run/udev/watch/37”: No such file or directory (2)
2015-11-14 21:30:36: ERROR: Cannot stat “/mnt/snap_root/var/run/udev/watch/36”: No such file or directory (2)
2015-11-14 21:30:36: ERROR: Cannot stat “/mnt/snap_root/var/run/udev/watch/35”: No such file or directory (2)
2015-11-14 21:30:36: ERROR: Cannot stat “/mnt/snap_root/var/run/udev/watch/34”: No such file or directory (2)
2015-11-14 21:30:36: ERROR: Cannot stat “/mnt/snap_root/var/run/udev/watch/33”: No such file or directory (2)
2015-11-14 21:30:36: ERROR: Cannot stat “/mnt/snap_root/var/run/udev/watch/32”: No such file or directory (2)
2015-11-14 21:30:36: ERROR: Cannot stat “/mnt/snap_root/var/run/udev/watch/31”: No such file or directory (2)
2015-11-14 21:30:36: ERROR: Cannot stat “/mnt/snap_root/var/run/udev/watch/30”: No such file or directory (2)
2015-11-14 21:30:36: ERROR: Cannot stat “/mnt/snap_root/var/run/udev/watch/27”: No such file or directory (2)
2015-11-14 21:30:36: ERROR: Cannot stat “/mnt/snap_root/var/run/udev/watch/29”: No such file or directory (2)
2015-11-14 21:30:36: ERROR: Error listing files in directory “/mnt/snap_root/var/run/udev/watch”: No such file or directory (2)
2015-11-14 21:30:36: ERROR: Error while getting files in folder “/mnt/snap_root/var/run/udev/watch”. User may not have permissions to access this folder. Errorno is 2

Those are probably broken symlinks. Here is a patch to silently ignore them: https://github.com/uroni/urbackup_backend/commit/95f98b10200717728bfd38db7ea424e83e90478b

I am kind of conflicted about that (to warn or not to warn), also regarding the next version with improved symlink handling. A lot of the symlinks are also probably absolute, and point outside of your snapshot.

I applied your latest patch and unfortunately I still get the same errors “Cannot stat”…

I forgot to tell you that i converted the filesystem from ext4 to btrfs on this client, do you think this can have an impact on the snapshot process? Sorry for not telling you earlier.

Before continue to solve, try to upgrade your kernel to 4.1, 4.2 or even 4.3. New kernels improves the btrfs performance and correct some hidden caveats.

After thar, that to to open modifying to “dumb” permissions on the mounted filesystem. Something like:

chmod 777 /mnt/snap_root -R

This will assure that permission issues are not cheating you.

Also, if you can change the distribution, try Manjaro Linux.

Thank you Marcelo! I will try and update the kernel.
The permissions I’ve already tried and that didn’t work…

This patch should remove the error message if there is a single broken link in a directory or the broken link is the last file in the directory: