# Rclone mount as nssm service and permissions

Hello,

When a rclone mount is done by a windows service as the local user SYSTEM, Administrator can't create anything in the mount point. Creating a new folder results in creating 4 folders that actually don't really exist. I know it's a permission issue as discussed in the Github issue #3216. Based on rclone mount documentation #windows-caveats, using nssm.exe would be a workaround but I don't know how.

Can anyone help with this?

Best regards,
Frédéric.

hello and welcome to the forum,

you can create a mount using any user account, including administrator.
to create a mount as system user, i use task scheduler, it is very easy to use and has a nice user interface

This is a product of running as SYSTEM - odd I know!

See this issue for background and some possible solutions

Also see the docs here

https://rclone.org/commands/rclone_mount/#windows-caveats

i use mounts on windows every day on many machines as system user and non-system users

i just read the link ncw shared, that is using a old version of rclone and it is not clear what version of winfsp was used.

never once, did i run into that situation of four folders.
but then i have use windows explorer in 10+ years

as a test, i just created a mount as system user

1. used windows explorer to create a new folder. did not get duplicate folders.
2. i opened a command prompt, with admin privileges, created a folder, did not get duplicates.
3. i opened a command prompt, without admin privileges, created a folder, did not get duplicates.
4. using double commander, i created a folder, did not get duplicates.

what version of rclone are you running?
what version of winfsp are you running?

Hi Nick,

Thanks for stopping by and posting these links

I wanted to post them in my first post as I found them already but the forum wouldn't let me do it. (new user I suppose...)

I had read the #3216 Github issue a few times and also the windows caveats in the doc, but I can't see any workaround. The documentation says that nssm.exe could help, but it doesn't say how.

Bests,
Frédéric.

Hey,

Thank you for helping. That happens with Rclone 1.49.5 and WinFSP 1.4.19016. I just upgraded Rclone to latest 1.51.0 but it's still happens. What surprises me is that it used to work fine with the windows service mounting the rclone resource. I could browse the rclone mount in Windows Explorer as Administrator without any issues a few months back. Looks like it just started to happen.

Regards,
Frédéric.

you need to update winfsp to lastest stable
http://www.secfs.net/winfsp/rel/

I upgraded your account. New users are limited because of spam accounts. You can post links now.

1 Like

I did. Uninstall 1.4, reboot, Install latest 1.6, stopped the windows service (created with nssm.exe), started the service again, opened Windows Explorer, created a New folder and bam, 4 folders again...
Don't know what to do.

good, now we are using the latest versions.

• using, nssm, what is the username you are running as?
• what is your rclone command?
• can you try to create a folder from the command line?
• can you use a log with debug info?
--log-file=c:\path\to\log\log.txt --log-level=DEBUG and post it
• sing, nssm, what is the username you are running as?

local system account, allow desktop interaction is ticked.

• what is your rclone command?

rclone mount s3:/prod-rclone-vms-rec-01/ S:
--volname="S3 - prod-rclone-vms-rec-01"
--s3-provider=Ceph
--s3-endpoint="https://s3.mydomain.fr:9443"
--s3-acl=private
--s3-bucket-acl=private
--s3-access-key-id=XXXXXXXXXXXXXXXXXX
--s3-secret-access-key=XXXXXXXXXXXXXXXXXXXXXX
--s3-chunk-size=80M
--vfs-cache-mode=full --vfs-cache-poll-interval=0m15s --vfs-cache-max-size=120G
--cache-dir="E:\Rclone_cache"

• can you try to create a folder from the command line?
Creating a folder from the CLI seems to work but it doesn't. Listing folders using an S3 client shows that the folders were not created.

• can you use a log with debug info?
--log-file=c:\path\to\log\log.txt --log-level=DEBUG and post it
I attached log.txt file : log.txt (99.5 KB)

Frédéric.

i would simplify the mount command and test
rclone mount s3:/prod-rclone-vms-rec-01/ S:, add the absolute bare minimum of flags.

who/what is hosting the ceph backend?

I'm operating the Ceph cluster and the S3 RadosGW.

I've made some progress. Using the very same options for the rclone mount:

I can:

• Copy a local file to the mount point with success. I can see the S3 PUT operation getting a 200 return code in the S3 gateway log files, and I can list this file using a desktop S3 client.
• Copy a local folder as long as it has a file in it

But I can't:

• create an empty folder in the mount point or in any other folders create with the desktop client (same credentials)
• copy an empty folder from local storage to the mount point

I'm now wondering if this is not a S3 gateway issue. I think I'll have to downgrade the packages on the S3 gateway.

[EDIT] I attached a new log.txt file : log.txt (1.0 MB)

Frédéric.

well,
s3 does not like empty folders.
https://rclone.org/overview/#optional-features.

I don't know about Amazon S3 service but Ceph S3 supports creating empty folders and I can create empty folders in the very same bucket from my desktop client (Dragondisk).

seems to me that dragondisk is not creating the empty folder, but ceph itself is.

s3 does not any concept of a folder.
ceph is not s3 and perhaps it has a concept of a folder and allowing empty folders to exist.
different software 'creates' a s3 'folder' in different ways.

TLDR: ncw is awesome!
recently, i ran into a problem.
rclone had one definition of a folder
and
cloudberry/wasabi had a different definition of a folder
rclone considered that 'folder' created with cloudberry/wasabi to be a file with no name and of zero size.
ncw saved the day, he created a beta that fixed the problem, that will be merged in v1.52.
you can read all about it here.

Thanks for these clues. I will downgrade the packages on the RGW and try again. This is the only change I can see for now besides any Windows updates that might have broken WinFSP. As I said previously, creating empty folders was working fine until recently and Ceph RGWs handles this well whatever the client.

First of all, let me agree with this statement : "TLDR: ncw is awesome!"
For a moment I thought I was hitting the same one as you hit as I had seen this messages ERROR : : Entry doesn't belong in directory "" many times in the past using the linux version of rlcone. But... Trying the latest rclone-beta-latest-windows-amd64.zip did not help with the 4 folders being created. I'm left with downgrading yum packages on one of our RGWs.
You guys have a nice day.
Frédéric.

Well well well... I could isolate one of the RGWs and downgrade the packages to the version that I know was working fine. Then I forced Windows network traffic to go through this RGWs (entry in hosts file) and it appears that the Ceph version is not the cause. Creating a folder still results in showing 4 folders, with actually none created.

What I don't understand is why this is now happening as I don't remember ever encountering this issue before, when I made all my tests of the rclone mount in September (Rclone download) and the windows user attached to the rclone mount service was already the .\SYSTEM user.
When mounting from the CLI with no user privileges elevation (Windows+R + 'cmd') I can create a folder with no issues (virtually as the folder is not actually created until a file is dropped in it) and it doesn't turn into 4 folders being created (or not created actually).
When mounting from the CLI with Administrator privileges elevation ('cmd' run as Administrator) then it doesn't work and a folder creation turns into 4 folders... Same as if the mount was started by the service under the .\SYSTEM account.

I'm not sure how to solve this. Should I use a specific user to run the windows service?

Frédéric.

This is what Bill Ziss (the WinFSP developer) said about the 4 directory problem

This is almost always a permission issue. Windows Explorer has this weird behavior where if it gets "Access Denied" during directory creation it retries it 4 times! In order for this problem to be resolved you will have to fix the permissions that the file system reports.

This could perhaps be a permission problem of the underlying s3 system, but I still suspect some problem with the actual WinFSP config.

Note that s3 doesn't really support empty directories without making directory markers and rclone doesn't make directory markers.

This means you can create empty directories in the mount but they will disappear after the directory cache time expires.

Some clients do create directory markers (which are 0 length files ending in /).

BTW I run the integration tests with rclone against CEPH+RGQ both swift and s3 interfaces.

As an experiment open a cmd window as a normal user and run the rclone mount command. See if it works like that.