Can't seem to read /var dir on Ubuntu

Having issues trying to read anything other than /etc and /home directories with rclone.as root

I’d like to back up my /var/www up to ACD.

Error I’m getting…
using a simple test.txt file…

root@mail:/var# /snap/bin/rclone -v copy /var/test.txt ACD:LinuxServers/mailserver --dry-run
2017/04/20 14:08:11 INFO : amazon drive root ‘LinuxServers/mailserver’: Modify window not supported
2017/04/20 14:08:11 NOTICE: amazon drive root ‘LinuxServers/mailserver’: Not making directory as dry run is set
2017/04/20 14:08:12 INFO : amazon drive root ‘LinuxServers/mailserver’: Waiting for checks to finish
2017/04/20 14:08:12 INFO : amazon drive root ‘LinuxServers/mailserver’: Waiting for transfers to finish
2017/04/20 14:08:12 ERROR : Attempt 1/3 failed with 0 errors and: error reading source directory “”: directory not found
Failed to sync: error reading source directory “”: directory not found

Anyone? Am I the only person out there having this problem? Is there something I can check?

I’d run with with the debug output so add in “-vv” instead of just the one v.

Thanks for that suggestion. Not much more detail unfortunately…

root@mail:/home/ubuntu# /snap/bin/rclone -vv copy /var/vmail/ ACD:LinuxServers/mailserver/vmail --dry-run
2017/04/24 14:24:09 DEBUG : rclone: Version “v1.36” starting with parameters ["/snap/rclone/186/bin/rclone" “-vv” “copy” “/var/vmail/” “ACD:LinuxServers/mailserver/vmail” “–dry-run”]
2017/04/24 14:24:10 DEBUG : ACD: Saved new token in config file
2017/04/24 14:24:13 INFO : amazon drive root ‘LinuxServers/mailserver/vmail’: Modify window not supported
2017/04/24 14:24:13 NOTICE: amazon drive root ‘LinuxServers/mailserver/vmail’: Not making directory as dry run is set
2017/04/24 14:24:13 INFO : amazon drive root ‘LinuxServers/mailserver/vmail’: Waiting for checks to finish
2017/04/24 14:24:13 INFO : amazon drive root ‘LinuxServers/mailserver/vmail’: Waiting for transfers to finish
2017/04/24 14:24:13 ERROR : Attempt 1/3 failed with 0 errors and: error reading source directory “”: directory not found
2017/04/24 14:24:13 NOTICE: amazon drive root ‘LinuxServers/mailserver/vmail’: Not making directory as dry run is set
2017/04/24 14:24:14 INFO : amazon drive root ‘LinuxServers/mailserver/vmail’: Waiting for checks to finish
2017/04/24 14:24:14 INFO : amazon drive root ‘LinuxServers/mailserver/vmail’: Waiting for transfers to finish
2017/04/24 14:24:14 ERROR : Attempt 2/3 failed with 0 errors and: error reading source directory “”: directory not found
2017/04/24 14:24:14 NOTICE: amazon drive root ‘LinuxServers/mailserver/vmail’: Not making directory as dry run is set
2017/04/24 14:24:14 INFO : amazon drive root ‘LinuxServers/mailserver/vmail’: Waiting for checks to finish
2017/04/24 14:24:14 INFO : amazon drive root ‘LinuxServers/mailserver/vmail’: Waiting for transfers to finish
2017/04/24 14:24:14 ERROR : Attempt 3/3 failed with 0 errors and: error reading source directory “”: directory not found
2017/04/24 14:24:14 Failed to copy: error reading source directory “”: directory not found

I can’t recreate it. It works well here.

So weird this is happening on all my ubuntu installs, one at home and one hosted on AWS… What remote are you using? I’m on Amazon Cloud Drive.

I saw you used ACD so that is what I tested with.

Are you able to ls out your remote path?

rclone ls ACD:LinuxServers/mailserver/vmail

and does that return stuff? I wonder if you have some funky chars or something in there.

I would guess this is a dangling symlink. What does

ls -l /var/www/LinuxServers/mailserver/vmail

Say?

Thanks for the assist guys,

The vmail dir is not a symlink.
Output below of ls -al

total 1048644
drwxr-xr-x 16 root root 4096 Apr 20 13:59 .
drwxr-xr-x 24 root root 4096 Apr 25 08:56 …
drwxr-xr-x 2 root root 4096 Apr 25 08:54 backups
drwxr-xr-x 14 root root 4096 Aug 22 2016 cache
drwxrwxrwt 2 root root 4096 Mar 15 06:25 crash
drwxr-xr-x 73 root root 4096 Oct 27 15:59 lib
drwxrwsr-x 2 root staff 4096 Apr 10 2014 local
lrwxrwxrwx 1 root root 9 Jan 14 2016 lock -> /run/lock
drwxrwxr-x 16 root syslog 4096 Apr 25 06:25 log
drwxrwsr-x 2 root mail 4096 Jul 2 2016 mail
drwxr-xr-x 2 root root 4096 Jan 14 2016 opt
lrwxrwxrwx 1 root root 4 Jan 14 2016 run -> /run
drwxr-xr-x 2 root root 4096 Jul 25 2016 scripts
drwxr-xr-x 4 root root 4096 Apr 20 12:17 snap
drwxr-xr-x 5 root root 4096 Aug 22 2016 spool
-rw-r–r-- 1 root root 1073741824 Jul 2 2016 swap.1
-rw-r–r-- 1 root root 0 Apr 20 13:59 test.txt
drwxrwxrwt 4 root root 4096 Apr 25 08:56 tmp
drwxrwx— 5 vmail mail 4096 Jul 18 2016 vmail
drwxr-xr-x 9 root root 4096 Aug 9 2016 www

The output of the lsd command show the remote dir’s exist output below.
root@mail:/home/ubuntu# /snap/bin/rclone -vv copy /var/vmail/ ACD:LinuxServers/mailserver/vmail
2017/04/25 09:09:35 DEBUG : rclone: Version “v1.36” starting with parameters ["/snap/rclone/196/bin/rclone" “-vv” “copy” “/var/vmail/” “ACD:LinuxServers/mailserver/vmail”]
2017/04/25 09:09:35 DEBUG : ACD: Saved new token in config file
2017/04/25 09:09:37 INFO : amazon drive root ‘LinuxServers/mailserver/vmail’: Modify window not supported
2017/04/25 09:09:37 DEBUG : amazon drive root ‘LinuxServers/mailserver/vmail’: Reading “”
2017/04/25 09:09:38 DEBUG : amazon drive root ‘LinuxServers/mailserver/vmail’: Finished reading “”
2017/04/25 09:09:38 INFO : amazon drive root ‘LinuxServers/mailserver/vmail’: Waiting for checks to finish
2017/04/25 09:09:38 INFO : amazon drive root ‘LinuxServers/mailserver/vmail’: Waiting for transfers to finish
2017/04/25 09:09:38 ERROR : Attempt 1/3 failed with 0 errors and: error reading source directory “”: directory not found
2017/04/25 09:09:38 DEBUG : amazon drive root ‘LinuxServers/mailserver/vmail’: Reading “”
2017/04/25 09:09:38 DEBUG : amazon drive root ‘LinuxServers/mailserver/vmail’: Finished reading “”
2017/04/25 09:09:38 INFO : amazon drive root ‘LinuxServers/mailserver/vmail’: Waiting for checks to finish
2017/04/25 09:09:38 INFO : amazon drive root ‘LinuxServers/mailserver/vmail’: Waiting for transfers to finish
2017/04/25 09:09:38 ERROR : Attempt 2/3 failed with 0 errors and: error reading source directory “”: directory not found
2017/04/25 09:09:38 DEBUG : amazon drive root ‘LinuxServers/mailserver/vmail’: Reading “”
2017/04/25 09:09:38 DEBUG : amazon drive root ‘LinuxServers/mailserver/vmail’: Finished reading “”
2017/04/25 09:09:38 INFO : amazon drive root ‘LinuxServers/mailserver/vmail’: Waiting for checks to finish
2017/04/25 09:09:38 INFO : amazon drive root ‘LinuxServers/mailserver/vmail’: Waiting for transfers to finish
2017/04/25 09:09:38 ERROR : Attempt 3/3 failed with 0 errors and: error reading source directory “”: directory not found
2017/04/25 09:09:38 Failed to copy: error reading source directory “”: directory not found
root@mail:/home/ubuntu# /snap/bin/rclone -vv lsd ACD:
2017/04/25 09:09:53 DEBUG : rclone: Version “v1.36” starting with parameters ["/snap/rclone/196/bin/rclone" “-vv” “lsd” “ACD:”]
2017/04/25 09:09:53 INFO : amazon drive root ‘’: Modify window not supported
2017/04/25 09:09:53 DEBUG : amazon drive root ‘’: Reading “”
2017/04/25 09:09:54 DEBUG : amazon drive root ‘’: Finished reading “”
-1 2011-06-28 22:28:10 -1 Archived Music
-1 2011-06-28 22:28:10 -1 Videos
-1 2016-04-15 10:55:56 -1 My Send-to-Kindle Docs
-1 2011-06-28 22:28:10 -1 Documents
-1 2017-04-11 19:03:40 -1 LinuxServers
-1 2017-04-04 21:12:38 -1 ProfileBackups
-1 2017-04-20 15:58:09 -1 Comics
-1 2017-04-19 03:03:27 -1 SharedData
-1 2017-04-20 18:59:57 -1 Pictures
2017/04/25 09:09:54 DEBUG : Go routines at exit 5
2017/04/25 09:09:54 DEBUG : rclone: Version “v1.36” finishing with parameters ["/snap/rclone/196/bin/rclone" “-vv” “lsd” “ACD:”]
root@mail:/home/ubuntu# /snap/bin/rclone -vv lsd ACD:LinuxServers
2017/04/25 09:10:04 DEBUG : rclone: Version “v1.36” starting with parameters ["/snap/rclone/196/bin/rclone" “-vv” “lsd” “ACD:LinuxServers”]
2017/04/25 09:10:05 INFO : amazon drive root ‘LinuxServers’: Modify window not supported
2017/04/25 09:10:05 DEBUG : amazon drive root ‘LinuxServers’: Reading “”
2017/04/25 09:10:05 DEBUG : amazon drive root ‘LinuxServers’: Finished reading “”
-1 2017-04-12 18:52:50 -1 comicsserver
-1 2017-04-25 15:52:59 -1 mailserver
2017/04/25 09:10:05 DEBUG : Go routines at exit 5
2017/04/25 09:10:05 DEBUG : rclone: Version “v1.36” finishing with parameters ["/snap/rclone/196/bin/rclone" “-vv” “lsd” “ACD:LinuxServers”]
root@mail:/home/ubuntu# /snap/bin/rclone -vv lsd ACD:LinuxServers/mailserver
2017/04/25 09:10:16 DEBUG : rclone: Version “v1.36” starting with parameters ["/snap/rclone/196/bin/rclone" “-vv” “lsd” “ACD:LinuxServers/mailserver”]
2017/04/25 09:10:17 INFO : amazon drive root ‘LinuxServers/mailserver’: Modify window not supported
2017/04/25 09:10:17 DEBUG : amazon drive root ‘LinuxServers/mailserver’: Reading “”
2017/04/25 09:10:17 DEBUG : amazon drive root ‘LinuxServers/mailserver’: Finished reading “”
-1 2017-04-20 19:40:04 -1 etc
-1 2017-04-25 15:52:59 -1 vmail
2017/04/25 09:10:17 DEBUG : Go routines at exit 5
2017/04/25 09:10:17 DEBUG : rclone: Version “v1.36” finishing with parameters ["/snap/rclone/196/bin/rclone" “-vv” “lsd” “ACD:LinuxServers/mailserver”]
root@mail:/home/ubuntu# /snap/bin/rclone -vv lsd ACD:LinuxServers/mailserver/vmail
2017/04/25 09:10:23 DEBUG : rclone: Version “v1.36” starting with parameters ["/snap/rclone/196/bin/rclone" “-vv” “lsd” “ACD:LinuxServers/mailserver/vmail”]
2017/04/25 09:10:25 INFO : amazon drive root ‘LinuxServers/mailserver/vmail’: Modify window not supported
2017/04/25 09:10:25 DEBUG : amazon drive root ‘LinuxServers/mailserver/vmail’: Reading “”
2017/04/25 09:10:25 DEBUG : amazon drive root ‘LinuxServers/mailserver/vmail’: Finished reading “”
2017/04/25 09:10:25 DEBUG : Go routines at exit 5
2017/04/25 09:10:25 DEBUG : rclone: Version “v1.36” finishing with parameters ["/snap/rclone/196/bin/rclone" “-vv” “lsd” “ACD:LinuxServers/mailserver/vmail”]

So after some more testing on this I’ve found that the only directory readable with rclone is under /var is /var/lib for some odd reason?!? I can’t even list that /var/test.txt file. I even went as far as adding root to the group mail, but thats a reach.

Would there be a process blocking these directories? I’m at a loss here…

root@mail:/var# ls -ahl
total 1.1G
drwxr-xr-x 16 root  root   4.0K Apr 20 13:59 .
drwxr-xr-x 24 root  root   4.0K Apr 25 08:56 ..
drwxr-xr-x  2 root  root   4.0K Apr 26 06:25 backups
drwxr-xr-x 14 root  root   4.0K Aug 22  2016 cache
drwxrwxrwt  2 root  root   4.0K Mar 15 06:25 crash
drwxr-xr-x 73 root  root   4.0K Oct 27 15:59 lib
drwxrwsr-x  2 root  staff  4.0K Apr 10  2014 local
lrwxrwxrwx  1 root  root      9 Jan 14  2016 lock -> /run/lock 
drwxrwxr-x 16 root  syslog 4.0K Apr 26 06:25 log
drwxrwsr-x  2 root  mail   4.0K Jul  2  2016 mail
drwxr-xr-x  2 root  root   4.0K Jan 14  2016 opt
lrwxrwxrwx  1 root  root      4 Jan 14  2016 run -> /run
drwxr-xr-x  2 root  root   4.0K Jul 25  2016 scripts
drwxr-xr-x  4 root  root   4.0K Apr 20 12:17 snap
drwxr-xr-x  5 root  root   4.0K Aug 22  2016 spool
-rw-r--r--  1 root  root   1.0G Jul  2  2016 swap.1
-rwxrwxrwx  1 root  root      0 Apr 20 13:59 test.txt
drwxrwxrwt  4 root  root   4.0K Apr 25 08:56 tmp
drwxrwx---  5 vmail mail   4.0K Jul 18  2016 vmail
drwxr-xr-x  9 root  root   4.0K Aug  9  2016 www

Command examples with output. ls /var/vmail

root@mail:/home/ubuntu# /snap/bin/rclone -vv ls /var/vmail/ 
2017/04/26 10:00:18 DEBUG : rclone: Version "v1.36" starting with parameters ["/snap/rclone/196/bin/rclone" "-vv" 
"ls" "/var/vmail/"]
2017/04/26 10:00:18 INFO  : Local file system at /var/vmail: Modify window is 1ns
2017/04/26 10:00:18 Failed to ls: directory not found

wierd. Anything in dmesg? What kind of directory is /var and the subirectories.? Are they mounts to a separate disk? (mount -l) Could it be the way its mounted?

There does seem to be one trigger on apparmor on rclone (see below)

[    9.417412] audit: type=1400 audit(1493135805.344:23): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="snap.core.hook.configure" pid=1205 comm="apparmor_parser"
[    9.510965] audit: type=1400 audit(1493135805.436:24): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="snap.rclone.rclone" pid=1256 comm="apparmor_parser"

As for mount -l nothing fancy on the mounts…

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=487276k,nr_inodes=121819,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=101436k,mode=755)
/dev/xvda1 on / type ext4 (rw,relatime,discard,data=ordered) [cloudimg-rootfs]
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (rw,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup 
(rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset,clone_children)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/hugetlb type cgroup 
(rw,nosuid,nodev,noexec,relatime,hugetlb,release_agent=/run/cgmanager/agents/cgm-release-agent.hugetlb)
cgroup on /sys/fs/cgroup/pids type cgroup 
(rw,nosuid,nodev,noexec,relatime,pids,release_agent=/run/cgmanager/agents/cgm-release-agent.pids)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/perf_event type cgroup 
(rw,nosuid,nodev,noexec,relatime,perf_event,release_agent=/run/cgmanager/agents/cgm-release-agent.perf_event)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs 
(rw,relatime,fd=34,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/var/lib/snapd/snaps/rclone_193.snap on /snap/rclone/193 type squashfs (ro,relatime)
/var/lib/snapd/snaps/rclone_186.snap on /snap/rclone/186 type squashfs (ro,relatime)
/var/lib/snapd/snaps/rclone_196.snap on /snap/rclone/196 type squashfs (ro,nodev,relatime)
/var/lib/snapd/snaps/core_1577.snap on /snap/core/1577 type squashfs (ro,relatime)
lxcfs on /var/lib/lxcfs type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
cgmfs on /run/cgmanager/fs type tmpfs (rw,relatime,size=100k,mode=755)
tmpfs on /run/snapd/ns type tmpfs (rw,nosuid,noexec,relatime,size=101436k,mode=755)
nsfs on /run/snapd/ns/rclone.mnt type nsfs (rw)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=101436k,mode=700,uid=1000,gid=1000)

Are you able to just tar up the directory?

What does something like:

tar cvf /var/vmail show?

I don’t want to tar up the dir due to diskspace, but i tested with a simple txt file. Output below that works as expected.

root@mail:/home/ubuntu# tar cvf test.tar /var/test.txt
tar: Removing leading `/' from member names
/var/test.txt

Created the expected test.tar file in the /home/ubuntu dir.

Doing a simple copy of the same file to Amazon Cloud Drive results in the following,

root@mail:/home/ubuntu# /snap/bin/rclone -vv copy /var/test.txt ACD:LinuxServers/mailserver
2017/04/26 13:57:36 DEBUG : rclone: Version "v1.36" starting with parameters ["/snap/rclone/196/bin/rclone" "-vv" 
"copy" "/var/test.txt" "ACD:LinuxServers/mailserver"]
2017/04/26 13:57:38 INFO  : amazon drive root 'LinuxServers/mailserver': Modify window not supported
2017/04/26 13:57:38 DEBUG : amazon drive root 'LinuxServers/mailserver': Reading ""
2017/04/26 13:57:38 DEBUG : amazon drive root 'LinuxServers/mailserver': Finished reading ""
2017/04/26 13:57:38 INFO  : amazon drive root 'LinuxServers/mailserver': Waiting for checks to finish
2017/04/26 13:57:38 INFO  : amazon drive root 'LinuxServers/mailserver': Waiting for transfers to finish
2017/04/26 13:57:38 ERROR : Attempt 1/3 failed with 0 errors and: error reading source directory "": directory not found
2017/04/26 13:57:38 DEBUG : amazon drive root 'LinuxServers/mailserver': Reading ""
2017/04/26 13:57:38 DEBUG : amazon drive root 'LinuxServers/mailserver': Finished reading ""
2017/04/26 13:57:38 INFO  : amazon drive root 'LinuxServers/mailserver': Waiting for checks to finish
2017/04/26 13:57:38 INFO  : amazon drive root 'LinuxServers/mailserver': Waiting for transfers to finish
2017/04/26 13:57:38 ERROR : Attempt 2/3 failed with 0 errors and: error reading source directory "": directory not found
2017/04/26 13:57:38 DEBUG : amazon drive root 'LinuxServers/mailserver': Reading ""
2017/04/26 13:57:39 DEBUG : amazon drive root 'LinuxServers/mailserver': Finished reading ""
2017/04/26 13:57:39 INFO  : amazon drive root 'LinuxServers/mailserver': Waiting for checks to finish
2017/04/26 13:57:39 INFO  : amazon drive root 'LinuxServers/mailserver': Waiting for transfers to finish
2017/04/26 13:57:39 ERROR : Attempt 3/3 failed with 0 errors and: error reading source directory "": directory not found
2017/04/26 13:57:39 Failed to copy: error reading source directory "": directory not found

Go figure, so damn weird, I also stopped the apparmor service to make sure it was not interfering with rclone

What are all those snap / squashfs things?

I’m running Ubuntu 16.04 and I can’t reproduce any errors you are seeing, but those mounts look different than what I’ve seen before.

They showed up after the install of rclone via snap.

I’d say it was my installation of 16.04 (64bit) as well, but it’s happening on both my installs… One at home and one hosted on AWS…

I have another install for my plex server let me try that one out.

Nope, same result on that install with 16.04. Going to try and uninstall and try a precompiled library next.

Well would you look at that. Looks like the Snap installation has some issues… It works now, now to fix this on my other installations.

root@plexserver:~/rclone-v1.36-linux-amd64# rclone -vv copy /var/test.txt ACD:LinuxServers/mailserver
2017/04/26 14:56:58 DEBUG : rclone: Version "v1.36" starting with parameters ["rclone" "-vv" "copy" "/var/test.txt" "ACD:LinuxServers/mailserver"]
2017/04/26 14:56:59 INFO  : amazon drive root 'LinuxServers/mailserver': Modify window not supported
2017/04/26 14:56:59 INFO  : amazon drive root 'LinuxServers/mailserver': Waiting for checks to finish
2017/04/26 14:56:59 INFO  : amazon drive root 'LinuxServers/mailserver': Waiting for transfers to finish
2017/04/26 14:57:01 INFO  : test.txt: Copied (new)
2017/04/26 14:57:01 INFO  :
Transferred:      0 Bytes (0 Bytes/s)
Errors:                 0
Checks:                 0
Transferred:            1
Elapsed time:        3.2s
2017/04/26 14:57:01 DEBUG : Go routines at exit 11
2017/04/26 14:57:01 DEBUG : rclone: Version "v1.36" finishing with parameters ["rclone" "-vv" "copy" "/var/test.txt 
"ACD:LinuxServers/mailserver"]

Thank you all for your assistance on the thought process behind all of this. Everything is now working as expected!