SMB remote creating a dir named `.`

What is the problem you are having with rclone?

rclone copy to smb remote create a dir named
that is a dot followed by a space character.

could be an issue with encoding
The rclone client tries to avoid 8.3 names when uploading files by encoding trailing spaces and periods

whereas when copying to a rclone mount, does NOT happen.

C:\data\rclone\rclone-v1.60.1-windows-amd64.exe mount nas: b:\rclone\mount\nas

Run the command 'rclone version' and share the full output of the command.

rclone v1.60.1
- os/version: Microsoft Windows 11 Pro 21H2 (64 bit)
- os/kernel: 10.0.22000.1281 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.19.3
- go/linking: static
- go/tags: cmount

Are you on the latest version of rclone?
YES

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

SMB

note:
the source is my laptop, W11.2H22.64BIT

the dest is the awesome, free windows server 2019 hyper-v edition
tested on two files systems.
--- NTFS
--- REFS - windows version of ZFS in a raid5 setup.

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

rclone-v1.60.1-windows-amd64.exe copy d:\files\file.ext nas:dest -vv

The rclone config contents with secrets removed.

[nas]
type = smb
host = 192.168.62.233
user = user
pass = pass

A log from the command with the -vv flag

rclone-v1.60.1-windows-amd64.exe lsf nas:dest

rclone-v1.60.1-windows-amd64.exe lsd nas:dest

rclone-v1.60.1-windows-amd64.exe tree nas:dest -all
/

0 directories, 0 files

rclone-v1.60.1-windows-amd64.exe copy d:\files\file.ext nas:dest -vv
DEBUG : rclone: Version "v1.60.1" starting with parameters ["C:\\data\\rclone\\rclone-v1.60.1-windows-amd64.exe" "copy" "d:\\files\\file.ext" "nas:dest" "-vv"]
DEBUG : Creating backend with remote "d:\\files\\file.ext"
DEBUG : Using config file from "C:\\data\\rclone\\rclone.conf"
DEBUG : fs cache: adding new entry for parent of "d:\\files\\file.ext", "//?/d:/files"
DEBUG : Creating backend with remote "nas:dest"
DEBUG : file.ext: Need to transfer - File not found at Destination
INFO  : file.ext: Copied (new)
INFO  :
Transferred:              1 B / 1 B, 100%, 0 B/s, ETA -
Transferred:            1 / 1, 100%
Elapsed time:         0.1s

2022/11/18 16:13:05 DEBUG : 8 go routines active
2022/11/18 16:13:05 DEBUG : smb://administrator@192.168.62.233:445/dest/: Closing 2 unused connections

rclone-v1.60.1-windows-amd64.exe lsf nas:dest
file.ext
./

rclone-v1.60.1-windows-amd64.exe lsd nas:dest
          -1 2022-11-18 16:13:07        -1 .

rclone-v1.60.1-windows-amd64.exe tree nas:dest -all
/
├── file.ext
└── .

1 directories, 1 files

and if a picture helps

same issue:
source: ubuntu on WSL2, same exact remote
dest: same dest as above - windows server

user01@wsl01:~/rclone/scripts$ rclone copy file.ext nas:dest -vv
DEBUG : rclone: Version "v1.60.1" starting with parameters ["rclone" "copy" "file.ext" "nas:dest" "-vv"]
DEBUG : Creating backend with remote "file.ext"
DEBUG : Using config file from "/home/user01/.config/rclone/rclone.conf"
DEBUG : fs cache: adding new entry for parent of "file.ext", "/home/user01/rclone/scripts"
DEBUG : Creating backend with remote "nas:dest"
DEBUG : file.ext: Need to transfer - File not found at Destination
INFO  : file.ext: Copied (new)
INFO  :
Transferred:              2 B / 2 B, 100%, 0 B/s, ETA -
Transferred:            1 / 1, 100%
Elapsed time:         0.2s

DEBUG : 8 go routines active
DEBUG : smb://administrator@192.168.62.233:445/dest/: Closing 2 unused connections
user01@wsl01:~/rclone/scripts$ rclone tree nas:dest
/
├── file.ext
└── .

same issue again:
the source is my laptop, W11.2H22.64BIT
the dest is a synology nas over tailscale

[nas_synbox]
type = smb
host = 100.115.37.xxx
user = user
pass = pass
rclone-v1.60.1-windows-amd64.exe lsf nas_synbox:dest

rclone-v1.60.1-windows-amd64.exe lsd nas_synbox:dest

rclone-v1.60.1-windows-amd64.exe tree nas_synbox:dest -all
/

0 directories, 0 files

rclone-v1.60.1-windows-amd64.exe copy d:\files\file.ext nas_synbox:dest -vv
DEBUG : rclone: Version "v1.60.1" starting with parameters ["C:\\data\\rclone\\rclone-v1.60.1-windows-amd64.exe" "copy" "d:\\files\\file.ext" "nas_synbox:dest" "-vv"]
DEBUG : Creating backend with remote "d:\\files\\file.ext"
DEBUG : Using config file from "C:\\data\\rclone\\rclone.conf"
DEBUG : fs cache: adding new entry for parent of "d:\\files\\file.ext", "//?/d:/files"
DEBUG : Creating backend with remote "nas_synbox:dest"
DEBUG : file.ext: Need to transfer - File not found at Destination
INFO  : file.ext: Copied (new)
INFO  :
Transferred:              1 B / 1 B, 100%, 0 B/s, ETA 0s
Transferred:            1 / 1, 100%
Elapsed time:         1.5s

DEBUG : 7 go routines active
DEBUG : smb://user99@100.115.37.34:445/dest/: Closing 2 unused connections

rclone-v1.60.1-windows-amd64.exe lsf nas_synbox:dest
file.ext
./

rclone-v1.60.1-windows-amd64.exe lsd nas_synbox:dest
          -1 2022-11-18 17:18:52        -1 .

rclone-v1.60.1-windows-amd64.exe tree nas_synbox:dest -all
/
├── file.ext
└── .

1 directories, 1 files

This does look like an encoding issue, that is the special unicode dot rclone uses.

@Lesmiscore do you have any ideas?

congrats on 10 years!

the strange thing is the issue is not with the single file that was copied.

instead that rclone creates a new dir that is empty.

1 Like

I have it in the debugger...

We're getting bitten by the classic golang path.Clean "feature":

If the result of this process is an empty string, Clean returns the string ".".

Therefore, this part:

Ends up here:

And since path.Dir here performs an implicit Clean, it ends up doing MkdirAll(".") when path is empty.

Edit: Actually, path.Dir returns ".", but then the toSambaPath encodes it, as you indicated, to the unicode dot which is what is supplied to MkdirAll.

Suggested fix:

1 Like

Ah!

We should probably have an rclone.Clean which returns "" instead as that is never what we want!

Anyway I think you fix looks correct - hoping @Lesmiscore can comment.

yeah the fix seems correct

I've merged this to master now which means it will be in the latest beta in 15-30 minutes and released in v1.61 (and 1.60.2 if we get that far!).

1 Like

the beta fixed the issue.

rclone-v1.61.0-beta.6573.7db1c506f-windows-amd64.exe lsf nas:dest

rclone-v1.61.0-beta.6573.7db1c506f-windows-amd64.exe lsd nas:dest

rclone-v1.61.0-beta.6573.7db1c506f-windows-amd64.exe tree nas:dest -all
/

0 directories, 0 files

rclone-v1.61.0-beta.6573.7db1c506f-windows-amd64.exe copy d:\files\file.ext nas:dest -vv
DEBUG : rclone: Version "v1.61.0-beta.6573.7db1c506f" starting with parameters ["C:\\data\\rclone\\rclone-v1.61.0-beta.6573.7db1c506f-windows-amd64.exe" "copy" "d:\\files\\file.ext" "nas:dest" "-vv"]
DEBUG : Creating backend with remote "d:\\files\\file.ext"
DEBUG : Using config file from "C:\\data\\rclone\\rclone.conf"
DEBUG : fs cache: adding new entry for parent of "d:\\files\\file.ext", "//?/d:/files"
DEBUG : Creating backend with remote "nas:dest"
DEBUG : file.ext: Need to transfer - File not found at Destination
INFO  : file.ext: Copied (new)
INFO  :
Transferred:              1 B / 1 B, 100%, 0 B/s, ETA -
Transferred:            1 / 1, 100%
Elapsed time:         0.1s

DEBUG : 8 go routines active
DEBUG : smb://administrator@192.168.62.233:445/dest/: Closing 2 unused connections

rclone-v1.61.0-beta.6573.7db1c506f-windows-amd64.exe lsf nas:dest
file.ext

rclone-v1.61.0-beta.6573.7db1c506f-windows-amd64.exe lsd nas:dest

rclone-v1.61.0-beta.6573.7db1c506f-windows-amd64.exe tree nas:dest -all
/
└── file.ext

0 directories, 1 files

Great :slight_smile: Thanks for testing and thanks to @albertony for fixing.

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