Error copying files to mounted drive on windows

What is the problem you are having with rclone?

I am trying to copy a file from my local drive to a mounted drive using the following rclone command

rclone mount OneDriveP: Z: --network-mode --volname \\server\share --file-perms=0777 --vfs-cache-mode=full

but windows keep showing a message that the destination already has a file with the same name, even though it does not. If I press "replace file in destination" I get the following error message "invalid MS-DOS" function; if I press "Skip", I see that a file with the same name has been created in the destination but with zero size. When I try to copy the file from the windows cmd I get the following message:

Incorrect function.
        0 file(s) copied.

I googled the issues but could not find any relevant discussion. I also tried running a beta version of rclone but the problem persisted. This behavior has not always been there. I have been using rclone with no issues for over a year. I think this started happening in the last few weeks. Would really appreciate any tips on how to resolve this.

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

rclone v1.62.2

  • os/version: Microsoft Windows 10 Enterprise 21H2 (64 bit)
  • os/kernel: 10.0.19044.2728 Build 19044.2728.2728 (x86_64)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.20.2
  • go/linking: static
  • go/tags: cmount

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

OneDrive

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

rclone mount OneDriveP: Z: --network-mode --volname \\server\share --file-perms=0777 --vfs-cache-mode=full

The rclone config contents with secrets removed.

[OneDriveP]
type = onedrive
token = 
drive_id = 
drive_type = personal

A log from the command with the -vv flag

The log is here: Microsoft Windows [Version 10.0.19044.2728](c) Microsoft Corporation. All righ - Pastebin.com

welcome to the forum,

using rclone copy, not rclone mount,
can you copy files without error?

might test a simpler command
rclone mount OneDriveP: Z:

Thanks for the quick reply.
Using the rclone copy I could copy the file.
The issue still persists using the simpler mount command.

need to reproduce the issue and post te rclone debug log.
so i would

  1. kill the rclone mount
  2. add something like --log-level=DEBUG --log-file=c:\path\to\rclone.log
  3. re-create the issue
  4. kiil the rclone mount
  5. post the full debug log

here it is 2023/04/19 17:12:27 DEBUG : rclone: Version "v1.62.2" starting with parameters [ - Pastebin.com

with that log, hopefully someone else can comment on it.

Here is the problem in the log

2023/04/19 17:12:53 DEBUG : /Presentation.pdf: CreateEx: flags=0x502, mode=0700
2023/04/19 17:12:53 DEBUG : Presentation.pdf: Open: flags=O_RDWR|O_CREATE|O_EXCL
2023/04/19 17:12:53 DEBUG : Presentation.pdf: newRWFileHandle: 
2023/04/19 17:12:53 DEBUG : Presentation.pdf: >newRWFileHandle: err=file already exists
2023/04/19 17:12:53 DEBUG : Presentation.pdf: File.openRW failed: file already exists
2023/04/19 17:12:53 DEBUG : Presentation.pdf: >Open: fd=<nil *RWFileHandle>, err=file already exists
2023/04/19 17:12:53 DEBUG : /Presentation.pdf: >CreateEx: errc=-17, fh=0xFFFFFFFFFFFFFFFF

This is the application trying to create the file and rclone returning that it already exists. It does that because it was opened with the O_EXCL and O_CREATE.

So why did it exist already???

Apparently a fraction of a second earlier the file was created

2023/04/19 17:12:53 DEBUG : /Presentation.pdf: CreateEx: flags=0x502, mode=0700
2023/04/19 17:12:53 DEBUG : Presentation.pdf: Open: flags=O_RDWR|O_CREATE|O_EXCL
2023/04/19 17:12:53 DEBUG : Presentation.pdf: newRWFileHandle: 
2023/04/19 17:12:53 DEBUG : Presentation.pdf(0xc00082aac0): openPending: 
2023/04/19 17:12:53 DEBUG : Presentation.pdf: vfs cache: truncate to size=0 (not needed as size correct)
2023/04/19 17:12:53 DEBUG : : Added virtual directory entry vAddFile: "Presentation.pdf"
2023/04/19 17:12:53 DEBUG : Presentation.pdf(0xc00082aac0): >openPending: err=<nil>
2023/04/19 17:12:53 DEBUG : Presentation.pdf: >newRWFileHandle: err=<nil>
2023/04/19 17:12:53 DEBUG : : Added virtual directory entry vAddFile: "Presentation.pdf"
2023/04/19 17:12:53 DEBUG : Presentation.pdf: >Open: fd=Presentation.pdf (rw), err=<nil>
2023/04/19 17:12:53 DEBUG : /Presentation.pdf: >CreateEx: errc=0, fh=0x0

How exactly are you copying the file to the rclone mount?

..also do you have the latest WinFSP?

I tried copying the file both using ctrl + c - ctrl + v, and through the copy command in the command prompt.

I am not sure. Should I download/update it?

the latest is:
https://github.com/winfsp/winfsp/releases/tag/v2.0

to find the version

I feel sure that other Windows users would have reported this if it was a widespread problem.

This is suspicious... What changes have been made to your system?

Experience with weird problems on Windows leads me to ask are you using a virus scanner? Can you turn it off then try the test?

I installed the version in the link. The version I have now is 2.0.23075.0. But that still made no difference.

This computer is managed by an IT department, and many things get updated frequently. But mostly installed software updates.

Nothing seems to be running besides Microsoft's own virus and threats protection. I will have to check with admin though.

Is there maybe a way to completely uninstall rclone and install it again and see if this helps?

did you reboot the computer?

well, how did you install rclone?

rclone.exe is a portable app, does not need to be installed.
all i have ever done.

  1. download the .zip
  2. unzip
  3. run rclone.exe

Yes, I did

Right, it is been a while since I did that :slight_smile:

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