The script does not mount, fuse device is not found

I am solving the problem of binding the SFTPGo server,
to the resources of NextCloud users.
The script uses Rclone, it must connect via WebDAV
mount the user folder in /mnt/sftpgo/$USERNAME

If the script starts the SFTPGo server - mounting does not work.
If the script is started manually - everything works.

For 3 days I compared and looked for the problem in:

  • the user and group are the same.
  • copied all the environment variables.
  • SELinux and AppArmor are missing.
  • tried to use sudo adding to /etc/sudoers: sftpgo ALL=(ALL) NOPASSWD: ALL

I'm using Ubuntu 24.04.1 LTS on a Huper-V VM

When starting automatically - it doesn't work:

Mon Mar 17 16:37:15 2025 - Start /etc/sftpgo/auth_nc.sh
Mon Mar 17 16:37:15 2025 - Script running as user: sftpgo
Mon Mar 17 16:37:15 2025 - Script running as group: sftpgo fuse
Mon Mar 17 16:37:15 2025 - USERNAME = t.test01
Mon Mar 17 16:37:15 2025 - MOUNT_POINT= /mnt/sftpgo/t.test01
Mon Mar 17 16:37:15 2025 - RCLONE_CONFIG_DIR = /etc/sftpgo/rclone_configs
Mon Mar 17 16:37:15 2025 - RCLONE_CONFIG = /etc/sftpgo/rclone_configs/t.test01.conf
Mon Mar 17 16:37:15 2025 - Attempting to authenticate user: t.test01
Mon Mar 17 16:37:16 2025 - Response code: 200
Mon Mar 17 16:37:16 2025 - Authentication successful for user: t.test01
Mon Mar 17 16:37:16 2025 - Call /etc/sftpgo/test.sh
Mon Mar 17 16:37:16 2025 - Start /etc/sftpgo/test.sh
Mon Mar 17 16:37:16 2025 - Script running as user: sftpgo
Mon Mar 17 16:37:16 2025 - Script running as group: sftpgo fuse
Mon Mar 17 16:37:16 2025 - USERNAME = t.test01
Mon Mar 17 16:37:16 2025 - MOUNT_POINT= /mnt/sftpgo/t.test01
Mon Mar 17 16:37:16 2025 - RCLONE_CONFIG_DIR = /etc/sftpgo/rclone_configs
Mon Mar 17 16:37:16 2025 - RCLONE_CONFIG = /etc/sftpgo/rclone_configs/t.test01.conf
2025/03/17 16:37:16 mount helper error: fusermount: fuse device not found, try 'modprobe fuse' first
2025/03/17 16:37:16 Fatal error: failed to mount FUSE fs: fusermount: exit status 1
2025/03/17 16:38:16 Fatal error: mount not ready

$sudo modprobe fuse
$lsmod | grep fuse
no answer.

$dmesg | grep fuse
[0.115670] fuse: init (API version 7.39)
[ 1.442094] systemd[1]: Starting modprobe@fuse.service - Load Kernel Module fuse...

$cat /boot/config-$(uname -r) | grep FUSE
CONFIG_FUSE_FS=y
CONFIG_FUSE_DAX=y

$fusermount -V
fusermount3 version: 3.14.0

cat /etc/fuse.conf
user_allow_other
#mount_max = 1000

$ sudo -u sftpgo ls -l /dev/fuse
crw-rw-rw- 1 root root 10, 229 Mar 17 16:29 /dev/fuse

When started manually - everything works:
$sudo -u sftpgo -g sftpgo ./test.sh

Mon Mar 17 16:39:13 2025 - Start /etc/sftpgo/test.sh
Mon Mar 17 16:39:13 2025 - Script running as user: sftpgo
Mon Mar 17 16:39:13 2025 - Script running as group: sftpgo fuse
Mon Mar 17 16:39:13 2025 - USERNAME = t.test01
Mon Mar 17 16:39:13 2025 - MOUNT_POINT= /mnt/sftpgo/t.test01
Mon Mar 17 16:39:13 2025 - RCLONE_CONFIG_DIR = /etc/sftpgo/rclone_configs
Mon Mar 17 16:39:13 2025 - RCLONE_CONFIG = /etc/sftpgo/rclone_configs/t.test01.conf
Mon Mar 17 16:39:13 2025 - Mount successful for user: t.test01

$sudo -u sftpgo -g sftpgo fusermount -u /mnt/sftpgo/t.test01

I think the problem is in rclone
In automatic mode it does not find the built-in fuse

$rclone version
rclone v1.60.1-DEV

  • os/version: ubuntu 24.04 (64 bit)
  • os/kernel: 6.8.0-55-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.22.2
  • go/linking: dynamic
  • go/tags: none

/etc/sftpgo/test.sh

#!/bin/bash
USERNAME="t.test01"
MOUNT_POINT="/mnt/sftpgo/$USERNAME"
RCLONE_CONFIG_DIR="/etc/sftpgo/rclone_configs"
RCLONE_CONFIG="$RCLONE_CONFIG_DIR/$USERNAME.conf"

echo "$(date) - Start /etc/sftpgo/test.sh" >> /var/log/sftpgo_scr.log
echo "$(date) - Script running as user: $(whoami)" >> /var/log/sftpgo_scr.log
echo "$(date) - Script running as group: $(groups)" >> /var/log/sftpgo_scr.log
echo "$(date) - USERNAME = $USERNAME" >> /var/log/sftpgo_scr.log
echo "$(date) - MOUNT_POINT= $MOUNT_POINT" >> /var/log/sftpgo_scr.log
echo "$(date) - RCLONE_CONFIG_DIR = $RCLONE_CONFIG_DIR" >> /var/log/sftpgo_scr.log
echo "$(date) - RCLONE_CONFIG = $RCLONE_CONFIG" >> /var/log/sftpgo_scr.log

#env >> /var/log/hand_run.log
#sudo modprobe fuse
#sudo rclone mount --allow-other --config "$RCLONE_CONFIG" "nextcloud_$USERNAME:" "$MOUNT_POINT" --daemon --log-file /var/log/hand_run.log
#rclone mount --allow-other --config "$RCLONE_CONFIG" "nextcloud_$USERNAME:" "$MOUNT_POINT" >> /var/log/hand_run.log &
#sudo rclone mount --allow-other --config "$RCLONE_CONFIG" "nextcloud_$USERNAME:" "$MOUNT_POINT" >> /var/log/hand_run.log &

rclone mount --allow-other --vfs-cache-mode full --config "$RCLONE_CONFIG" "nextcloud_$USERNAME:" "$MOUNT_POINT" --daemon --log-file /var/log/sftpgo_scr.log
#sleep 2-10-20

if mountpoint -q "$MOUNT_POINT"; then
 echo "$(date) - Mount successful for user: $USERNAME" >> /var/log/sftpgo_scr.log
else
 echo "$(date) - Mount failed for user: $USERNAME" >> /var/log/sftpgo_scr.log
 exit 1
fi

welcome to the forum,

that is a very old, custom compiled, third-party version from an out-of-date repository.

rclone selfupdate
or
uninstall that old version and install the official latest rclone.
https://rclone.org/install/#script-installation

Thanks.
but it didn't solve the problem.

$rclone version
rclone v1.69.1

  • os/version: ubuntu 24.04 (64 bit)
  • os/kernel: 6.8.0-55-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.24.0
  • go/linking: static
  • go/tags: none

Automatic - doesn't work (fuse device not found)
When started manually - works.

Mon Mar 17 17:45:58 2025 - Start /etc/sftpgo/auth_nc.sh
Mon Mar 17 17:45:58 2025 - Script running as user: sftpgo
Mon Mar 17 17:45:58 2025 - Script running as group: sftpgo fuse
Mon Mar 17 17:45:58 2025 - USERNAME = t.test01
Mon Mar 17 17:45:58 2025 - MOUNT_POINT= /mnt/sftpgo/t.test01
Mon Mar 17 17:45:58 2025 - RCLONE_CONFIG_DIR = /etc/sftpgo/rclone_configs
Mon Mar 17 17:45:58 2025 - RCLONE_CONFIG = /etc/sftpgo/rclone_configs/t.test01.conf
Mon Mar 17 17:45:58 2025 - Attempting to authenticate user: t.test01
Mon Mar 17 17:45:58 2025 - Response code: 200
Mon Mar 17 17:45:58 2025 - Authentication successful for user: t.test01
Mon Mar 17 17:45:58 2025 - Call /etc/sftpgo/test.sh
-----
Mon Mar 17 17:45:58 2025 - Start /etc/sftpgo/test.sh
Mon Mar 17 17:45:58 2025 - Script running as user: sftpgo
Mon Mar 17 17:45:58 2025 - Script running as group: sftpgo fuse
Mon Mar 17 17:45:58 2025 - USERNAME = t.test01
Mon Mar 17 17:45:58 2025 - MOUNT_POINT= /mnt/sftpgo/t.test01
Mon Mar 17 17:45:58 2025 - RCLONE_CONFIG_DIR = /etc/sftpgo/rclone_configs
Mon Mar 17 17:45:58 2025 - RCLONE_CONFIG = /etc/sftpgo/rclone_configs/t.test01.conf
2025/03/17 17:45:58 mount helper error: fusermount3: fuse device not found, try 'modprobe fuse' first
2025/03/17 17:45:58 CRITICAL: Fatal error: failed to mount FUSE fs: fusermount: exit status 1
2025/03/17 17:45:58 ERROR: Daemon timed out. Failed to terminate daemon pid 1322: os: process already finished
2025/03/17 17:45:58 CRITICAL: Fatal error: daemon exited with error code 1
Mon Mar 17 17:45:58 2025 - Mount failed for user: t.test01

$sudo -u sftpgo ./test.sh

Mon Mar 17 17:53:08 2025 - Start /etc/sftpgo/test.sh
Mon Mar 17 17:53:08 2025 - Script running as user: sftpgo
Mon Mar 17 17:53:08 2025 - Script running as group: sftpgo fuse
Mon Mar 17 17:53:08 2025 - USERNAME = t.test01
Mon Mar 17 17:53:08 2025 - MOUNT_POINT= /mnt/sftpgo/t.test01
Mon Mar 17 17:53:08 2025 - RCLONE_CONFIG_DIR = /etc/sftpgo/rclone_configs
Mon Mar 17 17:53:08 2025 - RCLONE_CONFIG = /etc/sftpgo/rclone_configs/t.test01.conf
Mon Mar 17 17:53:08 2025 - Mount successful for user: t.test01

what does that mean?


maybe test without --daemon

I tried the commands

  1. sudo rclone mount --allow-other --config "$RCLONE_CONFIG" "nextcloud_$USERNAME:" "$MOUNT_POINT" --daemon --log-file /var/log/hand_run.log
  2. rclone mount --allow-other --config "$RCLONE_CONFIG" "nextcloud_$USERNAME:" "$MOUNT_POINT" --daemon --log-file /var/log/sftpgo_scr.log
  3. sudo rclone mount --allow-other --config "$RCLONE_CONFIG" "nextcloud_$USERNAME:" "$MOUNT_POINT" >> /var/log/sftpgo_scr.log &
  4. rclone mount --allow-other --config "$RCLONE_CONFIG" "nextcloud_$USERNAME:" "$MOUNT_POINT" >> /var/log/sftpgo_scr.log &

When started manually ( sudo -u sftpgo ./test.sh ) - all work.
When started automatically - all do not work.

I get the error "mount helper error: fusermount3: fuse device not found, try 'modprobe fuse' first" only when running
rclone mount --allow-other --config "$RCLONE_CONFIG" "nextcloud_$USERNAME:" "$MOUNT_POINT" --daemon --log-file /var/log/sftpgo_scr.log

the rest complete without Rclone errors,
but it does not work - the directory is not mounted.
the script reports - Mount failed for user: t.test01

please post a full rclone debug log.


what does that mean?

User goes to https:// or sftp:// SFTPGo server
SFTPGo runs my auth_nc.sh script
a USER / PASS request is made to the NextCloud server API.
if successful

created file /etc/sftpgo/rclone_configs/t.test01.conf

[nextcloud_t.test01]
type = webdav
url = https://cloud.######.com/remote.php/dav/files/t.test01/
vendor = nextcloud
user = t.test01
pass = 7G1mr88sfjwGQqtCfzviJO9jRVVVOna1BH6ung

created directory /mnt/sftpgo/t.test01

script source /etc/sftpgo/test.sh is launched
script should mount WebDAV resource https://cloud.######.com/remote.php/dav/files/t.test01/
but it doesn't work automatically.

how do i view the rclone log?

journalctl -xe | grep fuse

Mar 17 20:05:35 sftp01 sudo[1401]: root : TTY=pts/2 ; PWD=/var/log ; USER=sftpgo ; COMMAND=/usr/bin/fusermount -u /mnt/sftpgo/t.test01
Mar 17 20:06:53 sftp01 sudo[1510]: root : TTY=pts/2 ; PWD=/mnt/sftpgo ; USER=sftpgo ; COMMAND=/usr/bin/fusermount -u /mnt/sftpgo/t.test01
Mar 17 20:30:42 sftp01 sudo[1819]: root : TTY=pts/2 ; PWD=/var/log ; USER=sftpgo ; COMMAND=/usr/bin/fusermount -u /mnt/sftpgo/t.test01
Mar 17 20:31:29 sftp01 sudo[1849]: root : TTY=pts/2 ; PWD=/var/lib/sftpgo ; USER=sftpgo ; COMMAND=/usr/bin/fusermount -u /mnt/sftpgo/t.test01
Mar 17 20:31:48 sftp01 sudo[1892]: root : TTY=pts/2 ; PWD=/var/lib ; USER=sftpgo ; COMMAND=/usr/bin/fusermount -u /mnt/sftpgo/t.test01

I don't see any error messages.

--log-level=DEBUG --log-file /var/log/sftpgo_scr.log

please do not post an old log. make sure to delete the old log, run rclone and post full output

error log

Mon Mar 17 22:00:25 2025 - Start /etc/sftpgo/auth_nc.sh
Mon Mar 17 22:00:25 2025 - Script running as user: sftpgo
Mon Mar 17 22:00:25 2025 - Script running as group: sftpgo fuse
Mon Mar 17 22:00:25 2025 - USERNAME = t.test01
Mon Mar 17 22:00:25 2025 - MOUNT_POINT= /mnt/sftpgo/t.test01
Mon Mar 17 22:00:25 2025 - RCLONE_CONFIG_DIR = /etc/sftpgo/rclone_configs
Mon Mar 17 22:00:25 2025 - RCLONE_CONFIG = /etc/sftpgo/rclone_configs/t.test01.conf
Mon Mar 17 22:00:25 2025 - Attempting to authenticate user: t.test01
Mon Mar 17 22:00:26 2025 - Response code: 200
Mon Mar 17 22:00:26 2025 - Authentication successful for user: t.test01
Mon Mar 17 22:00:26 2025 - Call /etc/sftpgo/test.sh
Mon Mar 17 22:00:26 2025 - Start /etc/sftpgo/test.sh
Mon Mar 17 22:00:26 2025 - Script running as user: sftpgo
Mon Mar 17 22:00:26 2025 - Script running as group: sftpgo fuse
Mon Mar 17 22:00:26 2025 - USERNAME = t.test01
Mon Mar 17 22:00:26 2025 - MOUNT_POINT= /mnt/sftpgo/t.test01
Mon Mar 17 22:00:26 2025 - RCLONE_CONFIG_DIR = /etc/sftpgo/rclone_configs
Mon Mar 17 22:00:26 2025 - RCLONE_CONFIG = /etc/sftpgo/rclone_configs/t.test01.conf
2025/03/17 22:00:26 DEBUG : rclone: Version "v1.69.1" starting with parameters ["rclone" "mount" "--allow-other" "--config" "/etc/sftpgo/rclone_configs/t.test01.conf"
 "nextcloud_t.test01:" "/mnt/sftpgo/t.test01" "--daemon" "--log-level=DEBUG" "--log-file" "/var/log/sftpgo_scr.log"]
2025/03/17 22:00:26 DEBUG : Using fallback PATH to run fusermount
2025/03/17 22:00:26 DEBUG : Creating backend with remote "nextcloud_t.test01:"
2025/03/17 22:00:26 DEBUG : Using config file from "/etc/sftpgo/rclone_configs/t.test01.conf"
2025/03/17 22:00:26 DEBUG : found headers:
2025/03/17 22:00:26 DEBUG : Chunks temporary upload directory: https://cloud.######.com/remote.php/dav/uploads/t.test01/
2025/03/17 22:00:26 DEBUG : rclone: Version "v1.69.1" starting with parameters ["/usr/bin/rclone" "mount" "--allow-other" "--config" "/etc/sftpgo/rclone_configs/t.tes
t01.conf" "nextcloud_t.test01:" "/mnt/sftpgo/t.test01" "--daemon" "--log-level=DEBUG" "--log-file" "/var/log/sftpgo_scr.log"]
2025/03/17 22:00:26 DEBUG : Creating backend with remote "nextcloud_t.test01:"
2025/03/17 22:00:26 DEBUG : Using config file from "/etc/sftpgo/rclone_configs/t.test01.conf"
2025/03/17 22:00:26 DEBUG : found headers:
2025/03/17 22:00:26 DEBUG : Chunks temporary upload directory: https://cloud.omesta.com/remote.php/dav/uploads/t.test01/
2025/03/17 22:00:26 INFO  : webdav root '': poll-interval is not supported by this remote
2025/03/17 22:00:26 NOTICE: webdav root '': --vfs-cache-mode writes or full is recommended for this remote as it can't stream
2025/03/17 22:00:26 DEBUG : webdav root '': Mounting on "/mnt/sftpgo/t.test01"
2025/03/17 22:00:26 mount helper error: fusermount3: fuse device not found, try 'modprobe fuse' first
2025/03/17 22:00:26 CRITICAL: Fatal error: failed to mount FUSE fs: fusermount: exit status 1
2025/03/17 22:00:26 ERROR : Daemon timed out. Failed to terminate daemon pid 1040: os: process already finished
2025/03/17 22:00:26 CRITICAL: Fatal error: daemon exited with error code 1
Mon Mar 17 22:00:26 2025 - Mount failed for user: t.test01

$sudo -u sftpgo ./test.sh
if I run the script with my hands, it works.
the log file is as follows:

Mon Mar 17 22:07:44 2025 - Start /etc/sftpgo/test.sh
Mon Mar 17 22:07:44 2025 - Script running as user: sftpgo
Mon Mar 17 22:07:44 2025 - Script running as group: sftpgo fuse
Mon Mar 17 22:07:44 2025 - USERNAME = t.test01
Mon Mar 17 22:07:44 2025 - MOUNT_POINT= /mnt/sftpgo/t.test01
Mon Mar 17 22:07:44 2025 - RCLONE_CONFIG_DIR = /etc/sftpgo/rclone_configs
Mon Mar 17 22:07:44 2025 - RCLONE_CONFIG = /etc/sftpgo/rclone_configs/t.test01.conf
2025/03/17 22:07:44 DEBUG : rclone: Version "v1.69.1" starting with parameters ["rclone" "mount" "--allow-other" "--config" "/etc/sftpgo/rclone_configs/t.test01.conf" "nextcloud_t.test01:" "
/mnt/sftpgo/t.test01" "--daemon" "--log-level=DEBUG" "--log-file" "/var/log/sftpgo_scr.log"]
2025/03/17 22:07:44 DEBUG : Creating backend with remote "nextcloud_t.test01:"
2025/03/17 22:07:44 DEBUG : Using config file from "/etc/sftpgo/rclone_configs/t.test01.conf"
2025/03/17 22:07:44 DEBUG : found headers:
2025/03/17 22:07:44 DEBUG : Chunks temporary upload directory: https://cloud.#####.com/remote.php/dav/uploads/t.test01/
2025/03/17 22:07:44 DEBUG : rclone: Version "v1.69.1" starting with parameters ["/usr/bin/rclone" "mount" "--allow-other" "--config" "/etc/sftpgo/rclone_configs/t.test01.conf" "nextcloud_t.t
est01:" "/mnt/sftpgo/t.test01" "--daemon" "--log-level=DEBUG" "--log-file" "/var/log/sftpgo_scr.log"]
2025/03/17 22:07:44 DEBUG : Creating backend with remote "nextcloud_t.test01:"
2025/03/17 22:07:44 DEBUG : Using config file from "/etc/sftpgo/rclone_configs/t.test01.conf"
2025/03/17 22:07:44 DEBUG : found headers:
2025/03/17 22:07:44 DEBUG : Chunks temporary upload directory: https://cloud.#####.com/remote.php/dav/uploads/t.test01/
2025/03/17 22:07:44 INFO  : webdav root '': poll-interval is not supported by this remote
2025/03/17 22:07:44 NOTICE: webdav root '': --vfs-cache-mode writes or full is recommended for this remote as it can't stream
2025/03/17 22:07:44 DEBUG : webdav root '': Mounting on "/mnt/sftpgo/t.test01"
2025/03/17 22:07:44 DEBUG : : Root:
2025/03/17 22:07:44 DEBUG : : >Root: node=/, err=<nil>
2025/03/17 22:07:44 DEBUG : rclone: Version "v1.69.1" finishing with parameters ["/usr/bin/rclone" "mount" "--allow-other" "--config" "/etc/sftpgo/rclone_configs/t.test01.conf" "nextcloud_t.
test01:" "/mnt/sftpgo/t.test01" "--daemon" "--log-level=DEBUG" "--log-file" "/var/log/sftpgo_scr.log"]
2025/03/17 22:07:44 DEBUG : /: Attr:
2025/03/17 22:07:44 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
Mon Mar 17 22:07:44 2025 - Mount successful for user: t.test01
2025/03/17 22:17:44 DEBUG : : forgetting directory cache

cat test.sh

#!/bin/bash
USERNAME="t.test01"
MOUNT_POINT="/mnt/sftpgo/$USERNAME"
RCLONE_CONFIG_DIR="/etc/sftpgo/rclone_configs"
RCLONE_CONFIG="$RCLONE_CONFIG_DIR/$USERNAME.conf"

echo "$(date) - Start /etc/sftpgo/test.sh" >> /var/log/sftpgo_scr.log
echo "$(date) - Script running as user: $(whoami)" >> /var/log/sftpgo_scr.log
echo "$(date) - Script running as group: $(groups)" >> /var/log/sftpgo_scr.log
echo "$(date) - USERNAME = $USERNAME" >> /var/log/sftpgo_scr.log
echo "$(date) - MOUNT_POINT= $MOUNT_POINT" >> /var/log/sftpgo_scr.log
echo "$(date) - RCLONE_CONFIG_DIR = $RCLONE_CONFIG_DIR" >> /var/log/sftpgo_scr.log
echo "$(date) - RCLONE_CONFIG = $RCLONE_CONFIG" >> /var/log/sftpgo_scr.log

#env >> /var/log/hand_run.log
#sudo modprobe fuse

# sudo rclone mount --allow-other --config "$RCLONE_CONFIG" "nextcloud_$USERNAME:" "$MOUNT_POINT" --daemon --log-level=DEBUG --log-file /var/log/hand_run.log
  rclone mount --allow-other --config "$RCLONE_CONFIG" "nextcloud_$USERNAME:" "$MOUNT_POINT" --daemon --log-level=DEBUG --log-file /var/log/sftpgo_scr.log
# sudo rclone mount --allow-other --config "$RCLONE_CONFIG" "nextcloud_$USERNAME:" "$MOUNT_POINT" --log-level=DEBUG >> /var/log/hand_run.log &
# rclone mount --allow-other --config "$RCLONE_CONFIG" "nextcloud_$USERNAME:" "$MOUNT_POINT" --log-level=DEBUG >> /var/log/hand_run.log &

#sleep 2-10-20

if mountpoint -q "$MOUNT_POINT"; then
   echo "$(date) - Mount successful for user: $USERNAME" >> /var/log/sftpgo_scr.log
else
   echo "$(date) - Mount failed for user: $USERNAME" >> /var/log/sftpgo_scr.log
   exit 1
fi

I know nothing about SFTPGo but what you describe sounds for me like it uses some form of confinement (cgroups?) which affect availability of fuse.

For pure debug reasons include in your script some fuse test commands, e.g.:

fusermount -V
ls -l /dev/fuse

Let's see if they produce the same output as when you run them from command line.

I added the following lines to the script

echo "$(date) - Command: fusermount -V" >> /var/log/sftpgo_scr.log
to install in fusermount -V >> /var/log/sftpgo_scr.log

echo "$(date) - command: ls -l /dev/fuse " >> /var/log/sftpgo_scr.log
ls -l /dev/fuse >> /var/log/sftpgo_scr.log

error log:

Mon Mar 17 23:53:51 2025 - Attempting to authenticate user: t.test01
Mon Mar 17 23:53:51 2025 - Response code: 200
Mon Mar 17 23:53:51 2025 - Authentication successful for user: t.test01
Mon Mar 17 23:53:51 2025 - Call /etc/sftpgo/test.sh
Mon Mar 17 23:53:51 2025 - Start /etc/sftpgo/test.sh
Mon Mar 17 23:53:51 2025 - Script running as user: sftpgo
Mon Mar 17 23:53:51 2025 - Script running as group: sftpgo fuse
Mon Mar 17 23:53:51 2025 - USERNAME = t.test01
Mon Mar 17 23:53:51 2025 - MOUNT_POINT= /mnt/sftpgo/t.test01
Mon Mar 17 23:53:51 2025 - RCLONE_CONFIG_DIR = /etc/sftpgo/rclone_configs
Mon Mar 17 23:53:51 2025 - RCLONE_CONFIG = /etc/sftpgo/rclone_configs/t.test01.conf
Mon Mar 17 23:53:51 2025 - Command: fusermount -V
fusermount3 version: 3.14.0
Mon Mar 17 23:53:51 2025 - Command: ls -l /dev/fuse
2025/03/17 23:53:51 DEBUG : rclone: Version "v1.69.1" starting with parameters ["rclone" "mount" "--allow-other" "--config" "/etc/sftpgo/rclone_configs/t.test01.conf" "nextcloud_t.test01:" "
/mnt/sftpgo/t.test01" "--daemon" "--log-level=DEBUG" "--log-file" "/var/log/sftpgo_scr.log"]
2025/03/17 23:53:51 DEBUG : Using fallback PATH to run fusermount
2025/03/17 23:53:51 DEBUG : Creating backend with remote "nextcloud_t.test01:"
2025/03/17 23:53:51 DEBUG : Using config file from "/etc/sftpgo/rclone_configs/t.test01.conf"
2025/03/17 23:53:51 DEBUG : found headers:
2025/03/17 23:53:51 DEBUG : Chunks temporary upload directory: https://cloud.omesta.com/remote.php/dav/uploads/t.test01/
2025/03/17 23:53:51 DEBUG : rclone: Version "v1.69.1" starting with parameters ["/usr/bin/rclone" "mount" "--allow-other" "--config" "/etc/sftpgo/rclone_configs/t.test01.conf" "nextcloud_t.t
est01:" "/mnt/sftpgo/t.test01" "--daemon" "--log-level=DEBUG" "--log-file" "/var/log/sftpgo_scr.log"]
2025/03/17 23:53:51 DEBUG : Creating backend with remote "nextcloud_t.test01:"
2025/03/17 23:53:51 DEBUG : Using config file from "/etc/sftpgo/rclone_configs/t.test01.conf"
2025/03/17 23:53:51 DEBUG : found headers:
2025/03/17 23:53:51 DEBUG : Chunks temporary upload directory: https://cloud.omesta.com/remote.php/dav/uploads/t.test01/
2025/03/17 23:53:51 INFO  : webdav root '': poll-interval is not supported by this remote
2025/03/17 23:53:51 NOTICE: webdav root '': --vfs-cache-mode writes or full is recommended for this remote as it can't stream
2025/03/17 23:53:51 DEBUG : webdav root '': Mounting on "/mnt/sftpgo/t.test01"
2025/03/17 23:53:51 mount helper error: fusermount3: fuse device not found, try 'modprobe fuse' first
2025/03/17 23:53:51 CRITICAL: Fatal error: failed to mount FUSE fs: fusermount: exit status 1
2025/03/17 23:53:51 ERROR : Daemon timed out. Failed to terminate daemon pid 1330: os: process already finished
2025/03/17 23:53:51 CRITICAL: Fatal error: daemon exited with error code 1
Mon Mar 17 23:53:51 2025 - Mount failed for user: t.test01

Script running as user: sftpgo
Script running as group: sftpgo fuse

The ls -l /dev/fuse command is missing

important information,
I still don't understand how to fix it.

Are you running in a docker on the machine? Just on the OS?

What happens if you log in as that user, use no script and ls -al dev/fuse?

Something on your OS is messed up if you can't see fuse.

This is a Microsoft Hyper-V virtual machine
A new, clean, minimal Ubuntu 24.04.2 LTS is installed
A few utilities are added and SFTPgo is installed.

user sftpgo will not be able to log in
cat /etc/passwd | grep sftpgo
sftpgo:x:999:990:SFTPGo user:/var/lib/sftpgo:/usr/sbin/nologin
cat /etc/shadow | grep sftpgo
sftpgo:!:20111::::::

I can only do
sudo -u sftpgo ls -al /dev/fuse
crw-rw-rw- 1 root root 10, 229 Mar 18 00:38 /dev/fuse

AI says:
SFTPGo may run a script in an isolated context where it does not have access to devices or other resources. This may be due to the use of systemd, chroot or other isolation mechanisms.

I'm trying to look into this.

/usr/lib/systemd/system/sftpgo.service

[Unit]
Description=SFTPGo Server
After=network.target

[Service]
User=sftpgo
Group=sftpgo
Type=simple
WorkingDirectory=/etc/sftpgo
RuntimeDirectory=sftpgo
Environment=SFTPGO_CONFIG_DIR=/etc/sftpgo/
Environment=SFTPGO_LOG_FILE_PATH=
EnvironmentFile=-/etc/sftpgo/sftpgo.env
ExecStart=/usr/bin/sftpgo serve
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=8192
KillMode=mixed
PrivateTmp=true
Restart=always
RestartSec=10s
NoNewPrivileges=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=true
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
AmbientCapabilities=CAP_NET_BIND_SERVICE

[Install]
WantedBy=multi-user.target

Seems your issue has little to do with rclone and however your system is setup.

You have quite the complex setup for someone not familiar with the OS and how things are working.

You are right, it is not a problem of Rclone.
Starting in an isolated environment did not allow full operation..
This is the first time I encountered this.

Now I did:
sudo systemctl edit sftpgo

### Editing /etc/systemd/system/sftpgo.service.d/override.conf
### Anything between here and the comment below will become the contents of the drop-in file

[Service]
NoNewPrivileges=no
ProtectSystem=false
PrivateDevices=no
DevicePolicy=auto
#DeviceAllow=/dev/fuse rw

### Edits below this comment will be discarded

### /usr/lib/systemd/system/sftpgo.service
# [Unit]
# Description=SFTPGo Server
# After=network.target
#.
# [Service]
# User=sftpgo
# Group=sftpgo
#Type=simple
# WorkingDirectory=/etc/sftpgo
# RuntimeDirectory=sftpgo
# Environment=SFTPGO_CONFIG_DIR=/etc/sftpgo/
# Environment=SFTPGO_LOG_FILE_PATH=
# EnvironmentFile=-/etc/sftpgo/sftpgo.env
# ExecStart=/usr/bin/sftpgo serve
# ExecReload=/bin/kill -s HUP $MAINPID
# LimitNOFILE=8192
# KillMode=mixed
#PrivateTmp=true
# Restart=always
# RestartSec=10s
# NoNewPrivileges=yes
#PrivateDevices=yes
# DevicePolicy=closed
# ProtectSystem=true
# RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
# AmbientCapabilities=CAP_NET_BIND_SERVICE
#.
# [Install]
# WantedBy=multi-user.target

sudo systemctl restart sftpgo

the script started working automatically.
The problem is solved.
Thank you all very much.

BTW. It hurts eyes to see such "fixes". Next step would be to run everything as root as it allows to avoid all weird permissions and privileges issues. But hey ho - this is your system.

The main thing was to find the cause.
Now experiments and minimization of changes.
You can see that the line #DeviceAllow=/dev/fuse rw is already prepared
After optimization and copying the scripts, I will restore the backup copy of the virtual machine.
I will make a clean installation without traces of searching for the problem in the system.

I will do this, but it is not necessary to do this...
This is the only task of the intermediary machine.
It does not manage access rights to NextCloud cloud files
Its task is to access the NextCloud cloud via SFTP.

1 Like

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