Issue mounting using windows service nssm

I've been using nssm successfully to create several windows services to mount several rclone remotes. I recently deleted a service to make a small parameter change. When re-installing the service, it installs successfully, but the mount does not work. It will show in my File Explorer, but if I click into it, it will think for a VERY long time, then finally return this I/O Error:
"S:\ is not accessible. The request could not be performed because of an I/O device error."

Running the exact same mount command in the command line works just fine.
This works in cmd:

rclone mount my-remote: s: --config "C:\rclone\rclone.conf" --fuse-flag --VolumePrefix=\SERVER\stuff

Remote will mount alongside other running remotes which were started by nssm.
In NSSM, I'm using the same arguments.

Version:

rclone v1.53.0
- os/arch: windows/amd64
- go version: go1.15

OS: Windows 10

Remote Storage: S3

config:

type = s3
provider = AWS
env_auth = true
region = us-east-2
upload_cutoff = 0

This was working just fine earlier today. I've been troubleshooting for hours! I've tried my old config and various flags / parameters. Please suggest troubleshooting steps.

EDIT:
I just thought of one more thing. Between it working and not working, I did experiment with Web GUI / RCD (without success, that is another story). Not sure if installing Web GUI could have messed with anything?

hi,

please provide this.

A log from the command with the -vv flag

Paste  log here

The challenge is, I don't know how to get nssm to produce a log, since the Windows Service runs in the background. Is there a way to pipe the log to a file?

you can add this to your command. change the actual location of the log file
--log-level=DEBUG --log-file=c:\path\to\local\folder\log.txt

https://rclone.org/docs/#log-file-file
https://rclone.org/docs/#log-level-level

Here are the initial logs.

2020/09/04 10:57:38 DEBUG : rclone: Version "v1.53.0" starting with parameters ["C:\\rclone\\rclone.exe" "mount" "my-remote:" "s:" "--config" "C:\\rclone\\rclone.conf" "--fuse-flag" "--VolumePrefix=\\server\\data" "--log-level=DEBUG" "--log-file=c:\\rclone\\log.txt"]
2020/09/04 10:57:38 DEBUG : Creating backend with remote "my-remote:"
2020/09/04 10:57:38 DEBUG : Using config file from "C:\\rclone\\rclone.conf"
2020/09/04 10:57:38 INFO  : S3 root: poll-interval is not supported by this remote
2020/09/04 10:57:38 DEBUG : S3 root: Mounting on "s:"
2020/09/04 10:57:38 DEBUG : S3 root: Mounting with options: ["-o" "fsname=my-remote:" "-o" "subtype=rclone" "-o" "max_readahead=131072" "-o" "attr_timeout=1" "-o" "atomic_o_trunc" "-o" "uid=-1" "-o" "gid=-1" "--FileSystemName=rclone" "-o" "volname=my-remote" "--VolumePrefix=\\server\\data"]
2020/09/04 10:57:38 DEBUG : S3 root: Init: 
2020/09/04 10:57:38 DEBUG : S3 root: >Init: 
2020/09/04 10:57:38 DEBUG : /: Statfs: 
2020/09/04 10:57:38 DEBUG : /: >Statfs: stat={Bsize:4096 Frsize:4096 Blocks:274877906944 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Favail:0 Fsid:0 Flag:0 Namemax:255}, errc=0
2020/09/04 10:57:38 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:57:38 DEBUG : /: >Getattr: errc=0
2020/09/04 10:57:38 DEBUG : /: Readlink: 
2020/09/04 10:57:38 DEBUG : /: >Readlink: linkPath="", errc=-40
2020/09/04 10:57:38 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:57:38 DEBUG : /: >Getattr: errc=0
2020/09/04 10:57:38 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:57:38 DEBUG : /: >Getattr: errc=0
2020/09/04 10:57:38 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:57:38 DEBUG : /: >Getattr: errc=0
2020/09/04 10:57:38 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:57:38 DEBUG : /: Opendir: 
2020/09/04 10:57:38 DEBUG : /: >Getattr: errc=0
2020/09/04 10:57:38 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2020/09/04 10:57:38 DEBUG : /: Opendir: 
2020/09/04 10:57:38 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2020/09/04 10:57:38 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2020/09/04 10:57:38 DEBUG : /: >Opendir: errc=0, fh=0x0
2020/09/04 10:57:38 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2020/09/04 10:57:38 DEBUG : /: >Opendir: errc=0, fh=0x1
2020/09/04 10:57:38 DEBUG : /: Releasedir: fh=0x0
2020/09/04 10:57:38 DEBUG : /: >Releasedir: errc=0
2020/09/04 10:57:38 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:57:38 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:57:38 DEBUG : /: >Getattr: errc=0
2020/09/04 10:57:38 DEBUG : /: >Getattr: errc=0
2020/09/04 10:57:38 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:57:38 DEBUG : /: >Getattr: errc=0
2020/09/04 10:57:38 DEBUG : /: Opendir: 
2020/09/04 10:57:38 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2020/09/04 10:57:38 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2020/09/04 10:57:38 DEBUG : /: >Opendir: errc=0, fh=0x0
2020/09/04 10:57:38 DEBUG : /: Releasedir: fh=0x1
2020/09/04 10:57:38 DEBUG : /: >Releasedir: errc=0
2020/09/04 10:57:38 DEBUG : /: Releasedir: fh=0x0
2020/09/04 10:57:38 DEBUG : /: >Releasedir: errc=0
2020/09/04 10:57:38 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:57:38 DEBUG : /: >Getattr: errc=0
2020/09/04 10:57:38 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:57:38 DEBUG : /: >Getattr: errc=0
2020/09/04 10:57:38 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:57:38 DEBUG : /: >Getattr: errc=0
2020/09/04 10:57:38 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:57:38 DEBUG : /: >Getattr: errc=0
2020/09/04 10:57:38 DEBUG : /: Opendir: 
2020/09/04 10:57:38 DEBUG : /: Opendir: 
2020/09/04 10:57:38 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2020/09/04 10:57:38 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2020/09/04 10:57:38 DEBUG : /: >Opendir: errc=0, fh=0x0
2020/09/04 10:57:38 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2020/09/04 10:57:38 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2020/09/04 10:57:38 DEBUG : /: >Opendir: errc=0, fh=0x1
2020/09/04 10:57:38 DEBUG : /: Releasedir: fh=0x0
2020/09/04 10:57:38 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:57:38 DEBUG : /: >Getattr: errc=0
2020/09/04 10:57:38 DEBUG : /: >Releasedir: errc=0
2020/09/04 10:57:38 DEBUG : /: Releasedir: fh=0x1
2020/09/04 10:57:38 DEBUG : /: >Releasedir: errc=0
2020/09/04 10:57:38 DEBUG : /Desktop.ini: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:57:55 DEBUG : /my-bucket/code: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:58:11 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:58:11 DEBUG : /: >Getattr: errc=0
2020/09/04 10:58:11 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:58:11 DEBUG : /: >Getattr: errc=0
2020/09/04 10:58:11 DEBUG : /: Opendir: 
2020/09/04 10:58:11 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2020/09/04 10:58:11 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:58:11 DEBUG : /: >Getattr: errc=0
2020/09/04 10:58:11 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:58:11 DEBUG : /: >Getattr: errc=0
2020/09/04 10:58:11 DEBUG : /: Opendir: 
2020/09/04 10:58:11 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2020/09/04 10:58:20 ERROR : /: Dir.Stat error: NoCredentialProviders: no valid providers in chain. Deprecated.
	For verbose messaging see aws.Config.CredentialsChainVerboseErrors
2020/09/04 10:58:20 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2020/09/04 10:58:20 DEBUG : /: >Opendir: errc=0, fh=0x0
2020/09/04 10:58:20 ERROR : IO error: NoCredentialProviders: no valid providers in chain. Deprecated.
	For verbose messaging see aws.Config.CredentialsChainVerboseErrors
2020/09/04 10:58:20 DEBUG : /Desktop.ini: >Getattr: errc=-5
2020/09/04 10:58:20 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:58:20 DEBUG : /: >Getattr: errc=0
2020/09/04 10:58:20 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:58:20 DEBUG : /: >Getattr: errc=0
2020/09/04 10:58:20 DEBUG : /: Opendir: 
2020/09/04 10:58:20 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2020/09/04 10:58:20 DEBUG : /: >Opendir: errc=0, fh=0x1
2020/09/04 10:58:20 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2020/09/04 10:58:20 DEBUG : /Desktop.ini: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:58:20 DEBUG : /: Releasedir: fh=0x0
2020/09/04 10:58:20 DEBUG : /: >Releasedir: errc=0
2020/09/04 10:58:20 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:58:20 DEBUG : /: >Getattr: errc=0
2020/09/04 10:58:20 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:58:20 DEBUG : /: >Getattr: errc=0
2020/09/04 10:58:20 DEBUG : /: Opendir: 
2020/09/04 10:58:20 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2020/09/04 10:58:41 ERROR : /: Dir.Stat error: NoCredentialProviders: no valid providers in chain. Deprecated.
	For verbose messaging see aws.Config.CredentialsChainVerboseErrors
2020/09/04 10:58:41 ERROR : IO error: NoCredentialProviders: no valid providers in chain. Deprecated.
	For verbose messaging see aws.Config.CredentialsChainVerboseErrors
2020/09/04 10:58:41 DEBUG : /my-bucket/code: >Getattr: errc=-5
2020/09/04 10:58:41 DEBUG : /: Statfs: 
2020/09/04 10:58:41 DEBUG : /: >Statfs: stat={Bsize:4096 Frsize:4096 Blocks:274877906944 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Favail:0 Fsid:0 Flag:0 Namemax:255}, errc=0
2020/09/04 10:58:41 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:58:41 DEBUG : /: >Getattr: errc=0
2020/09/04 10:58:41 DEBUG : /: Releasedir: fh=0x1
2020/09/04 10:58:41 DEBUG : /: >Releasedir: errc=0
2020/09/04 10:58:41 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:58:41 DEBUG : /: >Getattr: errc=0
2020/09/04 10:58:41 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:58:41 DEBUG : /: >Getattr: errc=0
2020/09/04 10:58:41 DEBUG : /: Opendir: 
2020/09/04 10:58:41 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2020/09/04 10:58:41 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2020/09/04 10:58:41 DEBUG : /: >Opendir: errc=0, fh=0x0
2020/09/04 10:58:41 DEBUG : /my-bucket/code: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:58:41 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2020/09/04 10:58:41 DEBUG : /: >Opendir: errc=0, fh=0x1
2020/09/04 10:58:41 DEBUG : /: Releasedir: fh=0x0
2020/09/04 10:58:41 DEBUG : /: >Releasedir: errc=0
2020/09/04 10:58:41 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:58:41 DEBUG : /: >Getattr: errc=0
2020/09/04 10:58:41 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:58:41 DEBUG : /: >Getattr: errc=0
2020/09/04 10:58:41 DEBUG : /: Opendir: 
2020/09/04 10:58:41 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2020/09/04 10:59:02 ERROR : /: Dir.Stat error: NoCredentialProviders: no valid providers in chain. Deprecated.
	For verbose messaging see aws.Config.CredentialsChainVerboseErrors
2020/09/04 10:59:02 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2020/09/04 10:59:02 DEBUG : /: >Opendir: errc=0, fh=0x0
2020/09/04 10:59:02 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2020/09/04 10:59:02 ERROR : IO error: NoCredentialProviders: no valid providers in chain. Deprecated.
	For verbose messaging see aws.Config.CredentialsChainVerboseErrors
2020/09/04 10:59:02 DEBUG : /: >Opendir: errc=0, fh=0x2
2020/09/04 10:59:02 DEBUG : /Desktop.ini: >Getattr: errc=-5
2020/09/04 10:59:02 DEBUG : /: Releasedir: fh=0x1
2020/09/04 10:59:02 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:59:02 DEBUG : /: >Getattr: errc=0
2020/09/04 10:59:02 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:59:02 DEBUG : /: >Getattr: errc=0
2020/09/04 10:59:02 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:59:02 DEBUG : /: >Releasedir: errc=0
2020/09/04 10:59:02 DEBUG : /: Opendir: 
2020/09/04 10:59:02 DEBUG : /: >Getattr: errc=0
2020/09/04 10:59:02 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2020/09/04 10:59:02 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:59:02 DEBUG : /desktop.ini: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:59:02 DEBUG : /: >Getattr: errc=0
2020/09/04 10:59:02 DEBUG : /: Opendir: 
2020/09/04 10:59:02 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2020/09/04 10:59:23 ERROR : /: Dir.Stat error: NoCredentialProviders: no valid providers in chain. Deprecated.
	For verbose messaging see aws.Config.CredentialsChainVerboseErrors
2020/09/04 10:59:23 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2020/09/04 10:59:23 DEBUG : /: >Opendir: errc=0, fh=0x1
2020/09/04 10:59:23 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2020/09/04 10:59:23 ERROR : IO error: NoCredentialProviders: no valid providers in chain. Deprecated.
	For verbose messaging see aws.Config.CredentialsChainVerboseErrors
2020/09/04 10:59:23 DEBUG : /my-bucket/code: >Getattr: errc=-5
2020/09/04 10:59:23 DEBUG : /: >Opendir: errc=0, fh=0x3
2020/09/04 10:59:23 DEBUG : /: Statfs: 
2020/09/04 10:59:23 DEBUG : /: Statfs: 
2020/09/04 10:59:23 DEBUG : /: >Statfs: stat={Bsize:4096 Frsize:4096 Blocks:274877906944 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Favail:0 Fsid:0 Flag:0 Namemax:255}, errc=0
2020/09/04 10:59:23 DEBUG : /AutoRun.inf: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:59:23 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:59:23 DEBUG : /: >Statfs: stat={Bsize:4096 Frsize:4096 Blocks:274877906944 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Favail:0 Fsid:0 Flag:0 Namemax:255}, errc=0
2020/09/04 10:59:23 DEBUG : /: >Getattr: errc=0
2020/09/04 10:59:23 DEBUG : /my-bucket/code: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:59:23 DEBUG : /: Releasedir: fh=0x2
2020/09/04 10:59:23 DEBUG : /: >Releasedir: errc=0
2020/09/04 10:59:23 DEBUG : /: Releasedir: fh=0x0
2020/09/04 10:59:23 DEBUG : /: >Releasedir: errc=0
2020/09/04 10:59:23 DEBUG : /: Releasedir: fh=0x1
2020/09/04 10:59:23 DEBUG : /: >Releasedir: errc=0
2020/09/04 10:59:23 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:59:23 DEBUG : /: >Getattr: errc=0
2020/09/04 10:59:23 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/09/04 10:59:23 DEBUG : /: >Getattr: errc=0
2020/09/04 10:59:23 DEBUG : /: Opendir: 
2020/09/04 10:59:23 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx

I noticed a few mentions of credentials. I'm using "default" i.e. system variables.

I then edited my config file to contain the access key and secret key. It is now working again with no issue.

So it seems when I run from CMD it has no problem reading my Environment Variables and mounting the drive. But when I run the same command through NSSM, it doesn't like it for some reason.

about nssm service, what username are you using?

Ah, great question and it is all making sense now. It is "Local System account", which would not have access to my User Env. Vars. Woops!

image

yes,
i was going to tell you that but i like to give the OP a chance to figure it out for themselves.

2 Likes

you can use this to set system variables.

https://ss64.com/nt/setx.html

1 Like

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