Start rclone as service on Windows, but the file can't be writen

What is the problem you are having with rclone?

  1. If I start rclone mount from command line to mount a remote SFTP, all works as expected.
  2. Then I tried to start rclone as service via NSSM, the mount works well, but when I tried to write a file on remote, it failed. However, if I append a new file to the remote directory, it's OK.

I also tried rlcone of version 1.51, it also failed.

What is your rclone version (output from rclone version)

rclone v1.55.1

  • os/type: windows
  • os/arch: amd64
  • go/version: go1.16.3
  • go/linking: dynamic
  • go/tags: cmount

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

Windows 10, 64bit

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

SFTP

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

C:\Program\rclone-v1.55.1-windows-amd64\rclone.exe mount mmm: E: --config "rclone.conf" --vfs-cache-mode writes  --dir-cache-time 30s

The rclone config contents with secrets removed.

[mmm]
type = sftp
host = xx.xx.xx.xx
user = xxx
pass = xxxxxxxx
md5sum_command = md5sum
sha1sum_command = sha1sum

A log from the command with the -vv flag

If rclone is started from command line, it works just FINE.
I don't know how to catch log when start rclone as a service

You need to add --log-file C:\rclone.log (or whatever path you want) and add -vv on your command line and produce a log file to look at.

hello and welcome to the forum,

what username are you using for the service?

what exactly does that mean? what was the error?

rclone.log (222.4 KB)
I have caught log as you mentioned,
Could you help to check it.
Thanks for your kindness.

I can add new file to remote directory, But If I tried to modify this file, it always failed.
Looks it became read only.
But I didn't mount as read only.

2021/05/20 10:34:52 DEBUG : /.IdeaIC2019.3: Getattr: fh=0xFFFFFFFFFFFFFFFF
2021/05/20 10:34:52 DEBUG : /.IdeaIC2019.3: >Getattr: errc=0
2021/05/20 10:34:52 DEBUG : /.IdeaIC2019.3: Getattr: fh=0xFFFFFFFFFFFFFFFF
2021/05/20 10:34:52 DEBUG : /.IdeaIC2019.3: >Getattr: errc=0
2021/05/20 10:34:52 DEBUG : /.IdeaIC2019.3: Opendir:
//below O_RDONLY is very suspicious
2021/05/20 10:34:52 DEBUG : /.IdeaIC2019.3: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2021/05/20 10:34:52 DEBUG : /.IdeaIC2019.3: >OpenFile: fd=.IdeaIC2019.3/ (r), err=
2021/05/20 10:34:52 DEBUG : /.IdeaIC2019.3: >Opendir: errc=0, fh=0x1
2021/05/20 10:34:52 DEBUG : /.IdeaIC2019.3: Readdir: ofst=0, fh=0x1
2021/05/20 10:34:52 DEBUG : /.IdeaIC2019.3: >Readdir: items=2, errc=0

I don't see anything wrong in your log file.

Which file were you trying to write?

This may be a Windows user permissions problem to do with how you started the mount. Can you try starting the mount not via nssm and running it as you and see if it works?

what exaclly happends, what app are you using to write to the file, do you get a pop-up from that app?
can you post a screen snippet?

run the command, not as system user, on the command line.

This only happens when I start rclone as windows service,
If I start rclone from command line, it works just fine. Files can be writen as expected.

what username are you running the service as?

run the service using the same username as you are logged in as

:+1: :+1: :+1: :+1: :+1: :+1: :+1: :+1:
config "log on" tab in nssm as my windows account name, And all now works fine.
Excellent!!!
This thread can be closed
Million Thanks.

1 Like

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