Rclone mount --daemon exits successfully even when mount fails

What is the problem you are having with rclone?

My understanding is that mount with --daemon should exit with a non-zero code if the initial mount was unsuccessful within the timeout, regardless of reason. In my case I'm running this on a MacOS machine via a script intended to be cross-platform, and the MacOS machine lacks osxfuse, but rclone mount --daemon exits successfully nonetheless.

Without --daemon, the command fails instantly.

Run the command 'rclone version' and share the full output of the command.

rclone 1.65.0
- os/version: darwin 14.1.1 (64 bit)
- os/kernel: 23.1.0 (arm64)
- os/type: darwin
- os/arch: arm64 (ARMv8 compatible)
- go/version: go1.21.4
- go/linking: dynamic
- go/tags: cmount

Which cloud storage system are you using? (eg Google Drive)

S3

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone --config /var/folders/hc/w17tmcyn47j16fs8h4rb3_6w0000gn/T/tmpab8dp9xg mount --daemon -vv --vfs-cache-mode minimal --log-file /tmp/mount.log filestore:foobar-london/input input

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[filestore]
type = s3
provider = AWS
access_key_id = *****
secret_access_key = ****
region = eu-west-2
acl = bucket-owner-full-control

(The config credentials are also incorrect, fwiw, as a further reason to expect failure.)

A log from the command that you were trying to run with the -vv flag

2023/11/28 17:45:04 DEBUG : rclone: Version "1.65.0" starting with parameters ["rclone" "--config" "/var/folders/hc/w17tmcyn47j16fs8h4rb3_6w0000gn/T/tmpab8dp9xg" "mount" "--daemon" "-vv" "--vfs-cache-mode" "minimal" "--log-file" "/tmp/mount.log" "filestore:foobar-london/input" "input"]
2023/11/28 17:45:04 DEBUG : Creating backend with remote "filestore:foobar-london/input"
2023/11/28 17:45:04 DEBUG : Using config file from "/var/folders/hc/w17tmcyn47j16fs8h4rb3_6w0000gn/T/tmpab8dp9xg"
2023/11/28 17:45:04 DEBUG : rclone: Version "1.65.0" starting with parameters ["/etc/profiles/per-user/steve/bin/rclone" "--config" "/var/folders/hc/w17tmcyn47j16fs8h4rb3_6w0000gn/T/tmpab8dp9xg" "mount" "--daemon" "-vv" "--vfs-cache-mode" "minimal" "--log-file" "/tmp/mount.log" "filestore:foobar-london/input" "input"]
2023/11/28 17:45:04 DEBUG : Creating backend with remote "filestore:foobar-london/input"
2023/11/28 17:45:04 DEBUG : Using config file from "/var/folders/hc/w17tmcyn47j16fs8h4rb3_6w0000gn/T/tmpab8dp9xg"
2023/11/28 17:45:04 INFO  : S3 bucket foobar-london path input: poll-interval is not supported by this remote
2023/11/28 17:45:04 DEBUG : vfs cache: root is "/Users/steve/Library/Caches/rclone"
2023/11/28 17:45:04 DEBUG : vfs cache: data root is "/Users/steve/Library/Caches/rclone/vfs/filestore/foobar-london/input"
2023/11/28 17:45:04 DEBUG : vfs cache: metadata root is "/Users/steve/Library/Caches/rclone/vfsMeta/filestore/foobar-london/input"
2023/11/28 17:45:04 DEBUG : Creating backend with remote "/Users/steve/Library/Caches/rclone/vfs/filestore/foobar-london/input"
2023/11/28 17:45:04 DEBUG : Creating backend with remote "/Users/steve/Library/Caches/rclone/vfsMeta/filestore/foobar-london/input"
2023/11/28 17:45:04 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2023/11/28 17:45:04 DEBUG : Mounting on "input" ("filestore foobar-london input")
2023/11/28 17:45:04 DEBUG : Adding "-o modules=iconv,from_code=UTF-8,to_code=UTF-8-MAC" for macOS
2023/11/28 17:45:04 DEBUG : S3 bucket foobar-london path input: Mounting with options: ["-o" "attr_timeout=1" "-o" "fsname=filestore:foobar-london/input" "-o" "subtype=rclone" "-o" "max_readahead=131072" "-o" "atomic_o_trunc" "-o" "daemon_timeout=600" "-o" "volname=filestore foobar-london input" "-o" "noappledouble" "-o" "modules=iconv,from_code=UTF-8,to_code=UTF-8-MAC"]
2023/11/28 17:45:04 Fatal error: failed to mount FUSE fs: mount stopped before calling Init: mount failed: cgofuse: cannot find FUSE
2023/11/28 17:45:09 DEBUG : rclone: Version "1.65.0" finishing with parameters ["/etc/profiles/per-user/steve/bin/rclone" "--config" "/var/folders/hc/w17tmcyn47j16fs8h4rb3_6w0000gn/T/tmpab8dp9xg" "mount" "--daemon" "-vv" "--vfs-cache-mode" "minimal" "--log-file" "/tmp/mount.log" "filestore:foobar-london/input" "input"]

This looks like a bug.

Unfortunately its quite difficult trying to track down bugs in the --daemon code as it has to re-execute rclone and test that it starts up properly.

It looks like the subprocess exited correctly with an error "Fatal error: failed to mount FUSE fs: ..." but the parent process didn't notice.

I've had a go at fixing this, can you give it a go? This gets the parent to check the child is alive.

v1.66.0-beta.7552.9bfbf2a4a.fix-mount-daemon-macos on branch fix-mount-daemon-macos (uploaded in 15-30 mins)

Thanks — I gave that a whirl, but the result is the same.

2023/11/29 09:57:42 DEBUG : rclone: Version "v1.66.0-beta.7552.9bfbf2a4a.fix-mount-daemon-macos" starting with parameters ["rclone" "--config" "/var/folders/hc/w17tmcyn47j16fs8h4rb3_6w0000gn/T/tmp97li1lz8" "mount" "--daemon" "-vv" "--vfs-cache-mode" "minimal" "--log-file" "/tmp/mount.log" "filestore:foobar-london/input" "input"]
2023/11/29 09:57:42 DEBUG : Creating backend with remote "filestore:foobar-london/input"
2023/11/29 09:57:42 DEBUG : Using config file from "/var/folders/hc/w17tmcyn47j16fs8h4rb3_6w0000gn/T/tmp97li1lz8"
2023/11/29 09:57:42 DEBUG : rclone: Version "v1.66.0-beta.7552.9bfbf2a4a.fix-mount-daemon-macos" starting with parameters ["/Users/steve/Desktop/rclone-v1.66.0-beta.7552.9bfbf2a4a.fix-mount-daemon-macos-osx-arm64/rclone" "--config" "/var/folders/hc/w17tmcyn47j16fs8h4rb3_6w0000gn/T/tmp97li1lz8" "mount" "--daemon" "-vv" "--vfs-cache-mode" "minimal" "--log-file" "/tmp/mount.log" "filestore:foobar-london/input" "input"]
2023/11/29 09:57:42 DEBUG : Creating backend with remote "filestore:foobar-london/input"
2023/11/29 09:57:42 DEBUG : Using config file from "/var/folders/hc/w17tmcyn47j16fs8h4rb3_6w0000gn/T/tmp97li1lz8"
2023/11/29 09:57:43 INFO  : S3 bucket foobar-london path input: poll-interval is not supported by this remote
2023/11/29 09:57:43 DEBUG : vfs cache: root is "/Users/steve/Library/Caches/rclone"
2023/11/29 09:57:43 DEBUG : vfs cache: data root is "/Users/steve/Library/Caches/rclone/vfs/filestore/foobar-london/input"
2023/11/29 09:57:43 DEBUG : vfs cache: metadata root is "/Users/steve/Library/Caches/rclone/vfsMeta/filestore/foobar-london/input"
2023/11/29 09:57:43 DEBUG : Creating backend with remote "/Users/steve/Library/Caches/rclone/vfs/filestore/foobar-london/input"
2023/11/29 09:57:43 DEBUG : Creating backend with remote "/Users/steve/Library/Caches/rclone/vfsMeta/filestore/foobar-london/input"
2023/11/29 09:57:43 DEBUG : Mounting on "input" ("filestore foobar-london input")
2023/11/29 09:57:43 DEBUG : Adding "-o modules=iconv,from_code=UTF-8,to_code=UTF-8-MAC" for macOS
2023/11/29 09:57:43 DEBUG : S3 bucket foobar-london path input: Mounting with options: ["-o" "attr_timeout=1" "-o" "fsname=filestore:foobar-london/input" "-o" "subtype=rclone" "-o" "max_readahead=131072" "-o" "atomic_o_trunc" "-o" "daemon_timeout=600" "-o" "volname=filestore foobar-london input" "-o" "noappledouble" "-o" "modules=iconv,from_code=UTF-8,to_code=UTF-8-MAC"]
2023/11/29 09:57:43 Fatal error: failed to mount FUSE fs: mount stopped before calling Init: mount failed: cgofuse: cannot find FUSE
2023/11/29 09:57:47 DEBUG : rclone: Version "v1.66.0-beta.7552.9bfbf2a4a.fix-mount-daemon-macos" finishing with parameters ["/Users/steve/Desktop/rclone-v1.66.0-beta.7552.9bfbf2a4a.fix-mount-daemon-macos-osx-arm64/rclone" "--config" "/var/folders/hc/w17tmcyn47j16fs8h4rb3_6w0000gn/T/tmp97li1lz8" "mount" "--daemon" "-vv" "--vfs-cache-mode" "minimal" "--log-file" "/tmp/mount.log" "filestore:foobar-london/input" "input"]

This is harder than I thought!

I've re-written the mount startup to poll the daemon to see if it is alive and it should notice it is dead quicker and give an error - please give this a go!

v1.66.0-beta.7554.fd1cea900.fix-macos-mount on branch fix-macos-mount (uploaded in 15-30 mins)

Yes! That seems to have done it: exited with 0 (edit: 1!). Log as follows:

2023/11/29 16:47:03 DEBUG : rclone: Version "v1.66.0-beta.7554.fd1cea900.fix-macos-mount" starting with parameters ["rclone" "--config" "/var/folders/hc/w17tmcyn47j16fs8h4rb3_6w0000gn/T/tmpnm4oxy_a" "mount" "--daemon" "-vv" "--vfs-cache-mode" "minimal" "--log-file" "/tmp/mount.log" "filestore:foobar-london/input" "input"]
2023/11/29 16:47:03 DEBUG : Creating backend with remote "filestore:foobar-london/input"
2023/11/29 16:47:03 DEBUG : Using config file from "/var/folders/hc/w17tmcyn47j16fs8h4rb3_6w0000gn/T/tmpnm4oxy_a"
2023/11/29 16:47:03 DEBUG : rclone: Version "v1.66.0-beta.7554.fd1cea900.fix-macos-mount" starting with parameters ["/Users/steve/Desktop/rclone-v1.66.0-beta.7554.fd1cea900.fix-macos-mount-osx-arm64/rclone" "--config" "/var/folders/hc/w17tmcyn47j16fs8h4rb3_6w0000gn/T/tmpnm4oxy_a" "mount" "--daemon" "-vv" "--vfs-cache-mode" "minimal" "--log-file" "/tmp/mount.log" "filestore:foobar-london/input" "input"]
2023/11/29 16:47:03 DEBUG : Creating backend with remote "filestore:foobar-london/input"
2023/11/29 16:47:03 DEBUG : Using config file from "/var/folders/hc/w17tmcyn47j16fs8h4rb3_6w0000gn/T/tmpnm4oxy_a"
2023/11/29 16:47:03 INFO  : S3 bucket foobar-london path input: poll-interval is not supported by this remote
2023/11/29 16:47:03 DEBUG : vfs cache: root is "/Users/steve/Library/Caches/rclone"
2023/11/29 16:47:03 DEBUG : vfs cache: data root is "/Users/steve/Library/Caches/rclone/vfs/filestore/foobar-london/input"
2023/11/29 16:47:03 DEBUG : vfs cache: metadata root is "/Users/steve/Library/Caches/rclone/vfsMeta/filestore/foobar-london/input"
2023/11/29 16:47:03 DEBUG : Creating backend with remote "/Users/steve/Library/Caches/rclone/vfs/filestore/foobar-london/input"
2023/11/29 16:47:03 DEBUG : Creating backend with remote "/Users/steve/Library/Caches/rclone/vfsMeta/filestore/foobar-london/input"
2023/11/29 16:47:03 DEBUG : Mounting on "input" ("filestore foobar-london input")
2023/11/29 16:47:03 DEBUG : Adding "-o modules=iconv,from_code=UTF-8,to_code=UTF-8-MAC" for macOS
2023/11/29 16:47:03 DEBUG : S3 bucket foobar-london path input: Mounting with options: ["-o" "attr_timeout=1" "-o" "fsname=filestore:foobar-london/input" "-o" "subtype=rclone" "-o" "max_readahead=131072" "-o" "atomic_o_trunc" "-o" "daemon_timeout=600" "-o" "volname=filestore foobar-london input" "-o" "noappledouble" "-o" "modules=iconv,from_code=UTF-8,to_code=UTF-8-MAC"]
2023/11/29 16:47:03 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2023/11/29 16:47:03 Fatal error: failed to mount FUSE fs: mount stopped before calling Init: mount failed: cgofuse: cannot find FUSE
2023/11/29 16:47:03 ERROR : Daemon timed out. Failed to terminate daemon pid 41019: os: process already finished
2023/11/29 16:47:03 Fatal error: daemon exited with error code 1

Sorry, exited with 1, I should have written. So failing successfully. :joy:

Thanks for merging the fix. :pray:

Thank you for testing.

I've merged this to master now which means it will be in the latest beta in 15-30 minutes and released in v1.66

This fix is too big to go in the point release I think.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.