Input/Output Error Copying to CIFS mount

What is your rclone version (output from rclone version)

1.52.2

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

CentOS 7

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

Start the Rclone Remote Control with the following:

rcd --log-level DEBUG --rc-no-auth --rc-addr=127.0.0.1:5816 --log-file="REDACTED" --copy-links --local-no-set-modtime

After that, perform simple copy commands using RC: https://rclone.org/rc/#operations-copyfile

The rclone config contents with secrets removed.

None.

Description of the issue.

When copying to a CIFS mounted drive, Rclone will intermittently return with the error message:
"2020/10/02 12:41:46 NOTICE: __s_2_2403.tmp.filter: Removing partially written file on error: close /destination/path/__s_2_2403.tmp.filter: input/output error"

On every following attempt to copy that file using Rclone, Rclone will return with the error message:
"2020/10/02 12:51:02 ERROR : s_2_2403.filter: Failed to copy: open /destination/path/__s_2_2403.tmp.filter: no such file or directory"

Couple more notes:

  • After the first error occurs, the "/destination/path/__s_2_2403.tmp.filter" seems to be "corrupted" at the operating system level. Any attempt to interact with the file from the command line (for example, "ls -l", "touch -m", "rm") will receive a "no such file or directory". The only way to "recover" the file is to remount the drive (at which point, the corrupted file can be deleted and Rclone can successfully copy)
  • After the first error occurs, the mount is still usable and Rclone can copy other files to the mounted drive.
  • This error seems to be very intermittent. Sometimes, we can copy over 100k files without seeing the issue. Other times, we will see this issue more often (once every 10k files)
  • Found a somewhat similar issue here: https://github.com/rclone/rclone/issues/2926. Following the suggestions on that thread, we tried updating the mount settings to use rsize=524288 and wsize=524288 but the error still occurred.
  • Our team tried to track down the issue through the Rclone code (we are not Go developers at all). Believe the error is occurring here https://github.com/rclone/rclone/blob/6a56ac1032bf03843850d1351d5239ef2960995b/backend/local/local.go#L1156 . We tried editing the Rclone code to retry the close attempt if the close fails but this did not resolve the issue.

Couple questions:

  • Has anyone encountered any similar errors when using Rclone to copy to a CIFS mounted drive?
  • Are there any potential Rclone solutions or workarounds that can be used to mitigate this issue?

A log from the command with the -vv flag

Relevant information from the log file. Cannot add the entire file due to confidential information.

2020/10/02 12:32:36 DEBUG : rclone: Version "v1.52.2-DEV" starting with parameters ["/project/path/Dependencies/rclone" "rcd" "--log-level" "DEBUG" "--rc-no-auth" "--rc-addr=127.0.0.1:5816" "--log-file=redacted" "--copy-links" "--local-no-set-modtime"]
2020/10/02 12:32:36 NOTICE: Serving remote control on http://127.0.0.1:5816/
2020/10/02 12:41:36 DEBUG : rc: "operations/copyfile": with parameters map[_group:<nil> dstFs:/destination/path dstRemote:__s_2_2403.tmp.filter srcFs:/source/path srcRemote:s_2_2403.filter]
2020/10/02 12:41:36 DEBUG : s_2_2403.filter: Need to transfer - File not found at Destination
2020/10/02 12:41:46 NOTICE: __s_2_2403.tmp.filter: Removing partially written file on error: close /destination/path/__s_2_2403.tmp.filter: input/output error
2020/10/02 12:41:48 ERROR : s_2_2403.filter: Failed to copy: close /destination/path/__s_2_2403.tmp.filter: input/output error
2020/10/02 12:41:48 ERROR : rc: "operations/copyfile": error: close /destination/path/__s_2_2403.tmp.filter: input/output error
2020/10/02 12:51:02 DEBUG : rc: "operations/copyfile": with parameters map[_group:<nil> dstFs:/destination/path dstRemote:__s_2_2403.tmp.filter srcFs:/source/path srcRemote:s_2_2403.filter]
2020/10/02 12:51:02 DEBUG : s_2_2403.filter: Need to transfer - File not found at Destination
2020/10/02 12:51:02 ERROR : s_2_2403.filter: Failed to copy: open /destination/path/__s_2_2403.tmp.filter: no such file or directory
2020/10/02 12:51:02 ERROR : rc: "operations/copyfile": error: open /destination/path/__s_2_2403.tmp.filter: no such file or directory

CIFS has been surprisingly troublesome with rclone.

I believe this to be to do with rclone using less frequently used file system operations and these are tripping over bugs in CIFS.

This is the cause of the problem (even though it is printed after the problem removing the file). Rclone was trying to write this file and CIFS returned an IO error (EIO). When a file system returns EIO it is saying that serious stuff has gone wrong and data is likely corrupted.

Makes me think the underlying cause is a CIFS bug. Rclone shouldn't be able to break CIFS - rclone is just a user space process doing what user space processes do.

There is another issue with CIFS and rclone described here: https://github.com/golang/go/issues/39237 - I don't think this is directly related but it is possible Go's async pre-emption is causing issues with CIFS with you too. So you could try the workaround of setting the environment variable GODEBUG=asyncpreemptoff=1 to see if that helps.

Can you also try 1.53.1 which is built with a later go version.

I'm not sure any of that will help though - I suspect upgrading the kernel will be the only way to fix this.

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