Cannot perform automount (systemctl) but mount manually working properly

What is the problem you are having with rclone?

Cannot perform automount (systemctl) but mount manually working properly

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

rclone v1.68.1

  • os/version: sles 15.5 (64 bit)
  • os/kernel: 5.14.21-150500.55.68-default (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.23.1
  • go/linking: static
  • go/tags: none

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

Onedrive

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

  • Automount Command (not working)
    systemctl start rclone-onedrive.service

  • "/etc/systemd/system/rclone-onedrive.service"
    [Unit]
    Description=RClone Service
    Wants=network-online.target
    After=network-online.target

[Service]
Type=notify
RestartSec=10

ExecStart=/usr/bin/rclone mount onedrive_qas: /IaaS/test --vfs-cache-mode full -vv
Restart=on-failure

[Install]
WantedBy=multi-user.target

Please run 'rclone config redacted' and share the full output. If you get command not

[onedrive]
type = onedrive
token = XXX
drive_id = XXX
drive_type = personal

[onedrive2]
type = onedrive
token = XXX
drive_id = XXX
drive_type = personal

[onedrive_qas]
type = onedrive
token = XXX
drive_id = XXX
drive_type = personal

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

  • Result from command journalctl -xeu rclone-onedrive.service (with systemctl command - not working)
    -- Defined-By: systemd
    -- Support: systemd-devel Info Page
    --
    -- Automatic restarting of the unit rclone-onedrive.service has been scheduled, as the result for
    -- the configured Restart= setting for the unit.
    Dec 13 08:10:59 systemd[1]: Stopped RClone Service.
    -- Subject: A stop job for unit rclone-onedrive.service has finished
    -- Defined-By: systemd
    -- Support: systemd-devel Info Page
    --
    -- A stop job for unit rclone-onedrive.service has finished.
    --
    -- The job identifier is 160672749 and the job result is done.
    Dec 13 08:10:59 systemd[1]: Starting RClone Service...
    -- Subject: A start job for unit rclone-onedrive.service has begun execution
    -- Defined-By: systemd
    -- Support: systemd-devel Info Page
    --
    -- A start job for unit rclone-onedrive.service has begun execution.
    --
    -- The job identifier is 160672749.
    Dec 13 08:10:59 rclone[26123]: 2024/12/13 08:10:59 DEBUG : Failed to find user cache dir, using temporary directory: neither $XDG_CACHE_HOME no>
    Dec 13 08:10:59 rclone[26123]: DEBUG : rclone: Version "v1.68.1" starting with parameters ["/usr/bin/rclone" "mount" "onedrive_qas:" "/IaaS/tes>
    Dec 13 08:10:59 rclone[26123]: DEBUG : rclone: systemd logging support activated
    Dec 13 08:10:59 rclone[26123]: DEBUG : Creating backend with remote "onedrive_qas:"
    Dec 13 08:10:59 rclone[26123]: DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
    Dec 13 08:11:59 rclone[26123]: DEBUG : pacer: low level retry 1/10 (error Get "https://graph.microsoft.com/v1.0/drives/ed56770142f669f4/root": >
    Dec 13 08:11:59 rclone[26123]: DEBUG : pacer: Rate limited, increasing sleep to 20ms
    Dec 13 08:12:29 systemd[1]: rclone-onedrive.service: start operation timed out. Terminating.
    Dec 13 08:12:29 systemd[1]: rclone-onedrive.service: Failed with result 'timeout'.
    -- Subject: Unit failed
    -- Defined-By: systemd
    -- Support: systemd-devel Info Page
    --
    -- The unit rclone-onedrive.service has entered the 'failed' state with result 'timeout'.
    Dec 13 08:12:29 systemd[1]: Failed to start RClone Service.
    -- Subject: A start job for unit rclone-onedrive.service has failed
    -- Defined-By: systemd
    -- Support: systemd-devel Info Page
    --
    -- A start job for unit rclone-onedrive.service has finished with a failure.
    --
    -- The job identifier is 160672749 and the job result is failed.

Could you spend a minute and format your post? As it is now makes reading painful for eyes:) which does not help with understanding what is going on.

Sorry about that. Now I adjusted the format again

Could you capture rclone log and post it here?

You have to add -vv --log-file=/path/to/rclone.log to your mount command.

Thank you for your help. I added option to mount command as below,

[Unit]
Description=RClone Service
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
RestartSec=10

ExecStart=/usr/bin/rclone mount onedrive_qas: /IaaS/test --vfs-cache-mode full -vv --log-file=/tmp/rclone.log
Restart=on-failure

[Install]
WantedBy=multi-user.target

==================================================================

And the log file shown as below.

2024/12/13 10:08:13 DEBUG : rclone: Version "v1.68.1" starting with parameters ["/usr/bin/rclone" "mount" "onedrive_qas:" "/IaaS/test" "--vfs-cache-mode" "full" "-vv" "--log-file=/tmp/rclone.log"]
2024/12/13 10:08:13 DEBUG : Creating backend with remote "onedrive_qas:"
2024/12/13 10:08:13 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2024/12/13 10:09:13 DEBUG : pacer: low level retry 1/10 (error Get "https://graph.microsoft.com/v1.0/drives/ed56770142f669f4/root": dial tcp 40.126.35.88:443: i/o timeout)
2024/12/13 10:09:13 DEBUG : pacer: Rate limited, increasing sleep to 20ms

can you please run the mount and post the debug output?

It looks like you have network access problems when running rclone from systemd.

rclone mount works from cmd, when run from systemd it can find config and attempts to start mount but error message clearly indicates that it can not connect to MS server.

Maybe your Suse Enterprise is configured in some special way? I have never experienced any systemd issues with Tumbleweed but have zero knowledge of Enterprise.

Please kindly find the result for manual mount

rclone mount --vfs-cache-mode full onedrive_qas: /IaaS/test -vv

2024/12/16 07:37:08 DEBUG : rclone: Version "v1.68.1" starting with parameters ["rclone" "mount" "--vfs-cache-mode" "full" "onedrive_qas:" "/IaaS/test" "-vv"]
2024/12/16 07:37:08 DEBUG : Creating backend with remote "onedrive_qas:"
2024/12/16 07:37:08 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2024/12/16 07:37:09 DEBUG : OneDrive root '': Next delta token is: aTE09NjM4Njk0MTI3MDc5MDM7SUQ9RUQ1Njc3MDE0MkY2NjlGNCExMDE7TFI9NjM4Njk5MzE0Mjk1MzA7RVA9MjA7U0k9MjtETEVQPTA7U0c9MTtTTz02O1BJPTM
2024/12/16 07:37:09 DEBUG : vfs cache: root is "/root/.cache/rclone"
2024/12/16 07:37:09 DEBUG : vfs cache: data root is "/root/.cache/rclone/vfs/onedrive_qas"
2024/12/16 07:37:09 DEBUG : vfs cache: metadata root is "/root/.cache/rclone/vfsMeta/onedrive_qas"
2024/12/16 07:37:09 DEBUG : Creating backend with remote ":local,encoding='Slash,Dot':/root/.cache/rclone/vfs/onedrive_qas/"
2024/12/16 07:37:09 DEBUG : :local: detected overridden config - adding "{bxYPm}" suffix to name
2024/12/16 07:37:09 DEBUG : fs cache: renaming cache item ":local,encoding='Slash,Dot':/root/.cache/rclone/vfs/onedrive_qas/" to be canonical ":local{bxYPm}:/root/.cache/rclone/vfs/onedrive_qas"
2024/12/16 07:37:09 DEBUG : Creating backend with remote ":local,encoding='Slash,Dot':/root/.cache/rclone/vfsMeta/onedrive_qas/"
2024/12/16 07:37:09 DEBUG : :local: detected overridden config - adding "{bxYPm}" suffix to name
2024/12/16 07:37:09 DEBUG : fs cache: renaming cache item ":local,encoding='Slash,Dot':/root/.cache/rclone/vfsMeta/onedrive_qas/" to be canonical ":local{bxYPm}:/root/.cache/rclone/vfsMeta/onedrive_qas"
2024/12/16 07:37:09 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2024/12/16 07:37:09 DEBUG : OneDrive root '': Mounting on "/IaaS/test"
2024/12/16 07:37:09 DEBUG : : Root:
2024/12/16 07:37:09 DEBUG : : >Root: node=/, err=

Thank you for your help.

Anyway, how can I check for the kind of issue? I check with the curl command.

Command:
"curl https://graph.microsoft.com -v"

Result:
< HTTP/1.1 200 Connection established

But when we execute the command below.

Command:
curl https://graph.microsoft.com/v1.0/drives/ed56770142f669f4/root
{"error":{"code":"InvalidAuthenticationToken","message":"Access token is empty.","innerError":{"date":"2024-12-16T07:42:29","request-id":"470a5eae-9605-470e-a175-89a1b18ab958","client-request-id":"470a5eae-9605-470e-a175-89a1b18ab958"}}}

Result:
{"error":{"code":"InvalidAuthenticationToken","message":"Access token is empty.","innerError":{"date":"2024-12-16T07:42:29","request-id":"470a5eae-9605-470e-a175-89a1b18ab958","client-request-id":"470a5eae-9605-470e-a175-89a1b18ab958"}}}