Assertion failed on job for rclone.service

What is the problem you are having with rclone?

I am having issues getting systemd to mount my encrypted Google Drive to /mnt/google-drive.

What is your rclone version (output from rclone version)

rclone v1.56.0

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Debian 10 x64

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

Google Drive

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

My rclone.service is as follows:

[Unit]
Description=rclone Google Drive (Encrypted)
AssertPathIsDirectory=/mnt/google-drive
After=lighttpd.service

[Service]
Type=simple
ExecStart=/usr/bin/rclone mount google-drive-encrypted: /mnt/google-drive \
--config=/home/user/.config/rclone/rclone.conf \
--allow-other \
--buffer-size 256M \
--cache-tmp-upload-path=/tmp/rclone/upload \
--cache-chunk-path=/tmp/rclone/chunks \
--cache-workers=8 \
--cache-writes \
--cache-dir=/tmp/rclone/vfs \
--cache-db-path=/tmp/rclone/cache \
--no-modtime \
--drive-use-trash \
--stats=0 \
--checkers=16 \
--bwlimit=40M \
--dir-cache-time=60m \
--cache-info-age=60m
ExecStop=/bin/fusermount -u /mnt/google-drive
Restart=on-failure
RestartSec=10
User=user
Group=user

[Install]
WantedBy=default.target

The rclone config contents with secrets removed.

[google-drive]
type = drive
client_id = ID REDACTED
client_secret = SECRET REDACTED
scope = drive
token = {"TOKEN REDACTED"}
team_drive = 

[google-drive-encrypted]
type = crypt
remote = google-drive:encrypted
password = PASSWORD REDACTED
password2 = PASSWORD REDACTED

A log from the command with the -vv flag

The following is the output of sudo systemctl status rclone:

$ sudo systemctl status rclone.service
● rclone.service - rclone Google Drive (Encrypted)
     Loaded: loaded (/etc/systemd/system/rclone.service; disabled; vendor preset: disabled)
     Active: inactive (dead)

Aug 15 14:24:49 systemd[1]: /etc/systemd/system/rclone.service:16: Unknown key name '--cache-dir' in section 'Service', ignoring.
Aug 15 14:24:49 systemd[1]: /etc/systemd/system/rclone.service:17: Unknown key name '--cache-db-path' in section 'Service', ignoring.
Aug 15 14:24:49 systemd[1]: /etc/systemd/system/rclone.service:18: Missing '=', ignoring line.
Aug 15 14:24:49 systemd[1]: /etc/systemd/system/rclone.service:20: Unknown key name '--drive-use-trash  --stats' in section 'Service', ignoring.
Aug 15 14:24:49 systemd[1]: /etc/systemd/system/rclone.service:21: Unknown key name '--checkers' in section 'Service', ignoring.
Aug 15 14:24:49 systemd[1]: /etc/systemd/system/rclone.service:22: Unknown key name '--bwlimit' in section 'Service', ignoring.
Aug 15 14:24:49 systemd[1]: /etc/systemd/system/rclone.service:23: Unknown key name '--dir-cache-time' in section 'Service', ignoring.
Aug 15 14:24:49 systemd[1]: /etc/systemd/system/rclone.service:24: Unknown key name '--cache-info-age' in section 'Service', ignoring.
Aug 15 14:31:16 systemd[1]: rclone.service: Starting requested but asserts failed.
Aug 15 14:31:16 systemd[1]: Assertion failed for rclone Google Drive (Encrypted).

I am not sure what's wrong, as I've based my rclone.service from several people's configs and chose the appropriate settings? I just didn't create /tmp/rclone/ and the /mnt/google-drive folders, but the issue doesn't seem to be caused by that?

You have all cache info flags and no cache backend. You'd want to remove them.

What do you mean?

All those flags with cache are for the cache backend and you aren't using it.

https://rclone.org/cache/

You need to remove them.

Even with that applied, the issue persists:

[Unit]
Description=rclone Google Drive (Encrypted)
AssertPathIsDirectory=/mnt/google-drive
After=lighttpd.service

[Service]
Type=simple
ExecStart=/usr/bin/rclone mount google-drive-encrypted: /mnt/google-drive \
--config=/home/user/.config/rclone/rclone.conf \
--allow-other \
--buffer-size 256M \
--cache-workers=8 \
--cache-writes \
--no-modtime \
--drive-use-trash \
--stats=0 \
--checkers=16 \
--bwlimit=40M \
--dir-cache-time=60m \
--cache-info-age=60m
ExecStop=/bin/fusermount -u /mnt/google-drive
Restart=on-failure
RestartSec=10
User=user
Group=user

[Install]
WantedBy=default.target
$ sudo systemctl status rclone.service
● rclone.service - rclone Google Drive (Encrypted)
     Loaded: loaded (/etc/systemd/system/rclone.service; disabled; vendor preset: disabled)
     Active: inactive (dead)

Aug 15 14:24:49 systemd[1]: /etc/systemd/system/rclone.service:18: Missing '=', ignoring line.
Aug 15 14:24:49 systemd[1]: /etc/systemd/system/rclone.service:20: Unknown key name '--drive-use-trash  --stats' in section 'Service', ignoring.
Aug 15 14:24:49 systemd[1]: /etc/systemd/system/rclone.service:21: Unknown key name '--checkers' in section 'Service', ignoring.
Aug 15 14:24:49 systemd[1]: /etc/systemd/system/rclone.service:22: Unknown key name '--bwlimit' in section 'Service', ignoring.
Aug 15 14:24:49 systemd[1]: /etc/systemd/system/rclone.service:23: Unknown key name '--dir-cache-time' in section 'Service', ignoring.
Aug 15 14:24:49 systemd[1]: /etc/systemd/system/rclone.service:24: Unknown key name '--cache-info-age' in section 'Service', ignoring.
Aug 15 14:31:16 systemd[1]: rclone.service: Starting requested but asserts failed.
Aug 15 14:31:16 systemd[1]: Assertion failed for rclone Google Drive (Encrypted).
Aug 15 16:08:03 systemd[1]: rclone.service: Starting requested but asserts failed.
Aug 15 16:08:03 systemd[1]: Assertion failed for rclone Google Drive (Encrypted).

You still have cache- items in your service file.

You need to remove them.

Apologies, missed those 4 lines. After fixing it, the issue still persists:

[Unit]
Description=rclone Google Drive (Encrypted)
AssertPathIsDirectory=/mnt/google-drive
After=lighttpd.service

[Service]
Type=simple
ExecStart=/usr/bin/rclone mount google-drive-encrypted: /mnt/google-drive \
--config=/home/user/.config/rclone/rclone.conf \
--allow-other \
--buffer-size 256M \
--no-modtime \
--drive-use-trash \
--checkers=16 \
--bwlimit=40M
ExecStop=/bin/fusermount -u /mnt/google-drive
Restart=on-failure
RestartSec=10
User=user
Group=user

[Install]
WantedBy=default.target

You didn't share any error output :frowning:

journalctl -xe output:

Aug 15 16:16:40 sudo[6727]: user : TTY=pts/2 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/systemctl start rclone.service
Aug 15 16:16:40 sudo[6727]: pam_unix(sudo:session): session opened for user root(uid=0) by user(uid=1000)
Aug 15 16:16:40 systemd[1]: rclone.service: Starting requested but asserts failed.
Aug 15 16:16:40 systemd[1]: Assertion failed for rclone Google Drive (Encrypted).
░░ Subject: A start job for unit rclone.service has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ A start job for unit rclone.service has finished with a failure.
░░ 
░░ The job identifier is 2144 and the job result is assert.
Aug 15 16:16:40 sudo[6727]: pam_unix(sudo:session): session closed for user root
Aug 15 16:16:42 sudo[6733]: user : TTY=pts/2 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/journalctl -xe
Aug 15 16:16:42 sudo[6733]: pam_unix(sudo:session): session opened for user root(uid=0) by user(uid=1000)

systemctl status rclone:

● rclone.service - rclone Google Drive (Encrypted)
     Loaded: loaded (/etc/systemd/system/rclone.service; disabled; vendor preset: disabled)
     Active: inactive (dead)

Aug 15 16:11:32 systemd[1]: rclone.service: Starting requested but asserts failed.
Aug 15 16:11:32 systemd[1]: Assertion failed for rclone Google Drive (Encrypted).
Aug 15 16:14:05 systemd[1]: rclone.service: Starting requested but asserts failed.
Aug 15 16:14:05 systemd[1]: Assertion failed for rclone Google Drive (Encrypted).
Aug 15 16:15:57 systemd[1]: rclone.service: Starting requested but asserts failed.
Aug 15 16:15:57 systemd[1]: Assertion failed for rclone Google Drive (Encrypted).
Aug 15 16:16:40 systemd[1]: rclone.service: Starting requested but asserts failed.
Aug 15 16:16:40 systemd[1]: Assertion failed for rclone Google Drive (Encrypted).
Aug 15 16:17:16 systemd[1]: rclone.service: Starting requested but asserts failed.
Aug 15 16:17:16 systemd[1]: Assertion failed for rclone Google Drive (Encrypted).

Does that work from the command line? You can add --log-file /tmp/rclone.log to your service file to get an error log to see what the error is if there are not any errors in the actual service file.

This should be notify and not simple.

So the folder (/mnt/google-drive) wouldn't be created automatically. I created the folder, set chown to my user and chmod to 755. Afterwards, I changed simple to notify.

That fixed it!

Thanks a lot man!

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