Rclone cant access the folders within a SMB share - readdir error

What is the problem you are having with rclone?

Rclone cant access the folders within a SMB share.

What is your rclone version (output from rclone version)

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>rclone version
rclone v1.55.0
- os/type: windows
- os/arch: 386
- go/version: go1.16.2
- go/linking: dynamic
- go/tags: cmount

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

Win 7, 32 bit

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

Not applicable.. issue is with accessing a local share.

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

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>rclone lsd z:
          -1 2016-10-04 20:35:21        -1 .Spotlight-V100
          -1 2020-01-18 14:01:44        -1 .Trashes
          -1 2021-04-10 04:40:07        -1 .fseventsd
          -1 2019-02-24 14:18:05        -1 Backups.backupdb
          -1 2016-10-04 20:36:31        -1 LaCie
          -1 2016-10-04 20:36:25        -1 LaCie Setup
          -1 2020-07-13 23:32:49        -1 QB.old
          -1 2019-10-18 01:58:47        -1 Quckbooks
          -1 2021-04-09 18:21:23        -1 Quckbooks backup
          -1 2021-04-10 03:01:37        -1 Takeout

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>rclone lsd z:\Takeout
2021/04/10 05:02:41 ERROR : : error listing: failed to read directory entry: rea
ddir \\?\z:\Takeout: The system cannot find the path specified.
2021/04/10 05:02:41 Failed to lsd with 2 errors: last error was: failed to read
directory entry: readdir \\?\z:\Takeout: The system cannot find the path specifi
ed.

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>

The rclone config contents with secrets removed.

Not applicable. The issue is with local drive.

A log from the command with the -vv flag

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>rclone lsd z:\Takeout -vv
2021/04/10 05:06:20 DEBUG : Using config file from "C:\\Users\\PC\\.config\\rclo
ne\\rclone.conf"
2021/04/10 05:06:20 DEBUG : rclone: Version "v1.55.0" starting with parameters [
"rclone" "lsd" "z:\\Takeout" "-vv"]
2021/04/10 05:06:20 DEBUG : Creating backend with remote "z:\\Takeout"
2021/04/10 05:06:20 DEBUG : fs cache: renaming cache item "z:\\Takeout" to be ca
nonical "//?/z:/Takeout"
2021/04/10 05:06:20 ERROR : : error listing: failed to read directory entry: rea
ddir \\?\z:\Takeout: The system cannot find the path specified.
2021/04/10 05:06:20 DEBUG : 2 go routines active
2021/04/10 05:06:20 Failed to lsd with 2 errors: last error was: failed to read
directory entry: readdir \\?\z:\Takeout: The system cannot find the path specifi
ed.

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>

What have you tried so far?

  1. Tried using the UNC rather than the mapped drive. Same issue, but interestingly the folder above it works. Tried creating folders at that level and it didn't solve the issue.
C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>rclone lsd \\192.168.2.5\LaCie\
Takeout
2021/04/10 05:10:49 ERROR : : error listing: failed to read directory entry: rea
ddir \\?\UNC\192.168.2.5\LaCie\Takeout: The system cannot find the path specifie
d.
2021/04/10 05:10:49 Failed to lsd with 2 errors: last error was: failed to read
directory entry: readdir \\?\UNC\192.168.2.5\LaCie\Takeout: The system cannot fi
nd the path specified.

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>rclone lsd \\192.168.2.5\LaCie
          -1 2016-10-04 20:35:21        -1 .Spotlight-V100
          -1 2020-01-18 14:01:44        -1 .Trashes
          -1 2021-04-10 04:40:07        -1 .fseventsd
          -1 2019-02-24 14:18:05        -1 Backups.backupdb
          -1 2016-10-04 20:36:31        -1 LaCie
          -1 2016-10-04 20:36:25        -1 LaCie Setup
          -1 2020-07-13 23:32:49        -1 QB.old
          -1 2019-10-18 01:58:47        -1 Quckbooks
          -1 2021-04-09 18:21:23        -1 Quckbooks backup
          -1 2021-04-10 03:01:37        -1 Takeout

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>
  1. Added an environment variable for GODEBUG=asyncpreemptoff=1 from another thread. No go.

perhaps a file/folder permissons issue.

Does

dir \\?\z:\Takeout

Work in a CMD window as the same user that you are trying rclone with?

tl;dr
run rclone mount as system user
or
run rclone mount pointing to folder, not drive letter

the OP might not realize that it takes more than that.
with windows, for each user, there are two separate set of shares.
one set of network shares if rclone mount is run with a command prompt that has administrator rights
one set of network shares if `rclone mount' is run with a command prompt that has not administrator rights.

here i show three command prompts

  1. rclone mount x: with admin rights.
  2. dir x: with a command prompt with admin rights, shows x:
  3. dir x: with a command prompt without admin rights, does not show x:

there way workarounds for that tho.

  1. run rclone mount as system user
  2. run rclone mount pointing to a folder, not a drive letter.

here i run a rclone mount to a folder and both command prompts can see the mount

and here is the other way round, the rclone mount is run as user without admin rights.
windows explorer runs without admin rights
so if you want windows explorer to see the drive letter, you must mount without admin rights or as system user.

Tried as both a regular cmd prompt and as Admin cmd prompt.

This works fine as a regular cmd prompt.

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>dir \\?\z:\Takeout
 Volume in drive \\?\z: is LaCie
 Volume Serial Number is 0000-0000

 Directory of \\?\z:\Takeout

04/10/2021  11:41 AM    <DIR>          .
04/10/2021  08:58 AM    <DIR>          ..
04/10/2021  09:55 PM    <DIR>          Takeout
04/09/2021  07:27 AM    10,741,369,171 takeout-20210409T084241Z-002.zip.jc!
               1 File(s) 10,741,369,171 bytes
               3 Dir(s)  99,504,984,064 bytes free

Admin cmd prompt can't find the share (as its not mounted for Admin user?)

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>dir \\?\z:\Takeout
The system cannot find the path specified.

this is a workaround for the problem.
https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/ee844140(v=ws.10)?redirectedfrom=MSDN

Ok, so I tried a whole bunch of things using admin prompts to see if they alleviate any permission type issues. I realize how mounts in windows explorer are without admin rights, and show the tests related to that as well.

  1. mounted the share as a drive using rclone running under Admin cmd prompt
C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>rclone mount \\192.168.2.5\LaCi
e\Takeout\Takeout x:
The service rclone has been started.

Tried running the same commans you ran as admin and they didn't work:

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>rclone lsd x:
2021/04/11 10:31:36 ERROR : : failed to open directory "": open \\?\X:\: The sys
tem cannot find the path specified.
2021/04/11 10:31:36 ERROR : : error listing: failed to open directory "": open \
\?\X:\: The system cannot find the path specified.
2021/04/11 10:31:36 Failed to lsd with 2 errors: last error was: failed to open
directory "": open \\?\X:\: The system cannot find the path specified.

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>rclone lsd y:
2021/04/11 10:31:48 ERROR : : error listing: directory not found
2021/04/11 10:31:48 Failed to lsd with 2 errors: last error was: directory not f
ound

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>rclone lsd z:
2021/04/11 10:31:59 ERROR : : error listing: directory not found
2021/04/11 10:31:59 Failed to lsd with 2 errors: last error was: directory not f
ound

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>dir x:
 Volume in drive X is local   ? UNC 192.168.2.5 LaCie
 Volume Serial Number is 101C-BD3B

 Directory of X:\

File Not Found

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>

Went back to the other command prompt where mounted as Admin, and now it shows the same readdir error:

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>gclone mount \\192.168.2.5\LaCi
e\Takeout\Takeout x:
'gclone' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>rclone mount \\192.168.2.5\LaCi
e\Takeout\Takeout x:
The service rclone has been started.
2021/04/11 10:31:36 ERROR : IO error: failed to read directory entry: readdir \\
?\UNC\192.168.2.5\LaCie\Takeout\Takeout: The system cannot find the path specifi
ed.
2021/04/11 10:41:15 ERROR : IO error: failed to read directory entry: readdir \\
?\UNC\192.168.2.5\LaCie\Takeout\Takeout: The system cannot find the path specifi
ed.
  1. Re-ran the steps above but not at the folder level above it and it worked. All below as Admin cmd prompt.
C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>rclone mount \\192.168.2.5\LaCie\ x:
The service rclone has been started.

and

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>dir x:
 Volume in drive X is local   ? UNC 192.168.2.5 LaCie
 Volume Serial Number is 4E44-6E8D

 Directory of X:\

01/18/2020  03:01 PM            14,340 .DS_Store
10/04/2016  08:35 PM    <DIR>          .Spotlight-V100
01/18/2020  03:01 PM    <DIR>          .Trashes
10/04/2016  08:35 PM           974,464 .VolumeIcon.icns
10/04/2016  08:35 PM           133,670 .VolumeIcon.ico
02/24/2019  03:20 PM                 0 .com.apple.timemachine.supported
10/04/2016  10:17 PM               341 .disk_label
10/04/2016  10:17 PM             1,373 .disk_label_2x
04/10/2021  10:28 PM    <DIR>          .fseventsd
02/24/2019  03:18 PM    <DIR>          Backups.backupdb
10/04/2016  08:36 PM    <DIR>          LaCie
10/04/2016  08:36 PM    <DIR>          LaCie Setup
07/13/2020  11:32 PM    <DIR>          QB.old
10/18/2019  01:58 AM    <DIR>          Quckbooks
04/10/2021  06:21 PM    <DIR>          Quckbooks backup
04/10/2021  11:41 AM    <DIR>          Takeout
04/10/2021  08:57 AM    <DIR>          abc
10/04/2016  08:35 PM                31 autorun.inf
08/11/2016  09:35 PM           111,620 tmbootpicker.efi
               8 File(s)      1,235,839 bytes
              11 Dir(s)  99,504,984,064 bytes free

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>rclone lsd x:
          -1 2016-10-04 20:35:21        -1 .Spotlight-V100
          -1 2020-01-18 14:01:44        -1 .Trashes
          -1 2021-04-10 22:28:39        -1 .fseventsd
          -1 2019-02-24 14:18:05        -1 Backups.backupdb
          -1 2016-10-04 20:36:31        -1 LaCie
          -1 2016-10-04 20:36:25        -1 LaCie Setup
          -1 2020-07-13 23:32:49        -1 QB.old
          -1 2019-10-18 01:58:47        -1 Quckbooks
          -1 2021-04-10 18:21:21        -1 Quckbooks backup
          -1 2021-04-10 11:41:28        -1 Takeout
          -1 2021-04-10 08:57:50        -1 abc

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>
  1. Tried mounting to a folder, not a drive letter. Again all as admin. No go.

The mount setup

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>rclone mount \\192.168.2.5\LaCi
e\Takeout\Takeout\ C:\rc
The service rclone has been started.

Mount test:

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>dir c:\rc
 Volume in drive C has no label.
 Volume Serial Number is CACE-D0FA

 Directory of c:\rc

File Not Found

Error on mount command

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>rclone mount \\192.168.2.5\LaCi
e\Takeout\Takeout\ C:\rc
The service rclone has been started.
2021/04/11 10:50:54 ERROR : IO error: failed to read directory entry: readdir \\
?\UNC\192.168.2.5\LaCie\Takeout\Takeout: The system cannot find the path specifi
ed.
  1. Same as #3 but at that folder level that works. Again all as admin.

Mount setup:

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>rclone mount \\192.168.2.5\LaCi
e\ C:\rc
The service rclone has been started.

Mount test:

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>dir c:\rc
 Volume in drive C has no label.
 Volume Serial Number is CACE-D0FA

 Directory of c:\rc

01/18/2020  03:01 PM            14,340 .DS_Store
10/04/2016  08:35 PM    <DIR>          .Spotlight-V100
01/18/2020  03:01 PM    <DIR>          .Trashes
10/04/2016  08:35 PM           974,464 .VolumeIcon.icns
10/04/2016  08:35 PM           133,670 .VolumeIcon.ico
02/24/2019  03:20 PM                 0 .com.apple.timemachine.supported
10/04/2016  10:17 PM               341 .disk_label
10/04/2016  10:17 PM             1,373 .disk_label_2x
04/10/2021  10:28 PM    <DIR>          .fseventsd
02/24/2019  03:18 PM    <DIR>          Backups.backupdb
10/04/2016  08:36 PM    <DIR>          LaCie
10/04/2016  08:36 PM    <DIR>          LaCie Setup
07/13/2020  11:32 PM    <DIR>          QB.old
10/18/2019  01:58 AM    <DIR>          Quckbooks
04/10/2021  06:21 PM    <DIR>          Quckbooks backup
04/10/2021  11:41 AM    <DIR>          Takeout
04/10/2021  08:57 AM    <DIR>          abc
10/04/2016  08:35 PM                31 autorun.inf
08/11/2016  09:35 PM           111,620 tmbootpicker.efi
               8 File(s)      1,235,839 bytes
              11 Dir(s)  99,504,984,064 bytes free

C:\Users\PC\Downloads\rclone-v1.55.0-windows-386>

--- JUST SAW YOUR NOTE JOJO ON THE WORKAROUND ---

Now the admin can see the share as well:

Still the same issue as before though:

you are using rclone mount to mount a smb share and the use rclone to view it?
pretty sure, never seen anybody try that and not sure the logic of that.
is there a reason for not using net use \\192.168.2.5\LaCie\Takeout\Takeout x:

if you want to have a drive letter be visible in all users, run the command as system user.
for example, here is a mount.driveletter.cmd
rclone mount \\vserver03\v$ t:
and here is a script that will run that .cmd as system user

set cmdfile=mount.driveletter.cmd
psexec -i -s "%cmdfile%"

Nice one, I didn't know about that trick. Have you tried it, so you know it is working for rclone mount, e.g. on Windows 10? If so, we should probably include a sentence about it into the following doc paragraph:

Note that drives created as Administrator are not visible by other accounts (including the account that was elevated as Administrator). So if you start a Windows drive from an Administrative Command Prompt and then try to access the same drive from Explorer (which does not run as Administrator), you will not be able to see the new drive.

1 Like

thanks, i did try in a vm once a long time ago and it does work.
the point of that link was to make clear what is going on behind the scenes.

i have no plan to use it:

  1. from a security point of view, never want to lessen security on windows. in effect giving non-admin apps access to admin resources.
  2. so many ways to run something as system user

as for the docs, there is room for improvement.
i was thinking of writing a wiki or how-to guide about all these issue

  1. mounting to a folder seems to work around the problem.
  2. suggesting nssm as the only option, too complex. perhaps, add task scheduler with easy gui or psexec.
1 Like

Sorry Jojo, im confused now. I don't understand what I am doing wrong or what I am supposed to do with this command.
Not sure if this is a permissions thing as the standard user account in the windows explorer and command prompt has no issues accessing the folder (either direct UNC or via the mapped drive), and now thanks to the registry edit the admin account can too.

Mounting to a folder didn't resolve it either.

you have tried many commands, so which command?

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