Corrupted on transfer while copying from pipe

What is the problem you are having with rclone?

We are trying to copy data from an io.ReadCloser from a golang script to an OpenStack swift object store.
Sometimes it does work and sometimes we are running into an error. The copying takes around 12h-14h.
We are using the following method:

operations.Rcat(ctx, ftarget, dstFileName, pipe, time.Now(), nil)

which gets the cmd.StdoutPipe() from the backup command.

2024/06/12 09:26:25 DEBUG : XXX: Uploading segments into "XXX" seems done (EOF)
2024/06/12 09:26:26 DEBUG : XXX: Sizes differ (src 281129647622 vs dst 28800318982)
2024/06/12 09:26:26 ERROR : XXX: corrupted on transfer

Sometimes it runs through successfully and sometimes it fails.

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

github.com/rclone/rclone v1.66.0
go 1.22.2
docker image: alpine:latest

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

We are using OpenStack Swift

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

We are using the rclone directly imported as golang library and are using the following method from the operations package:

// Rcat reads data from the Reader until EOF and uploads it to a file on remote
//
// in is closed at the end of the transfer
func Rcat(ctx context.Context, fdst fs.Fs, dstFileName string, in io.ReadCloser, modTime time.Time, meta fs.Metadata) (dst fs.Object, err error) {
	return rcatSrc(ctx, fdst, dstFileName, in, modTime, meta, nil)
}

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[XXX]
type = swift
env_auth = true
user = XXX
key = XXX
auth = https://XXX:443/v3
domain = XXX
tenant = XXX
tenant_domain = XXX
auth_version = 3
endpoint_type = internal

A log from the command that you were trying to run with the -vv flag

Logs from failed runs.

2024/06/12 09:22:50 DEBUG : XXX: Uploading segment file "XXX/-1/00000052" into "XXX"
2024/06/12 09:26:25 DEBUG : XXX: Uploading segments into "XXX_segments" seems done (EOF)
2024/06/12 09:26:26 DEBUG : XXX: Sizes differ (src 281129647622 vs dst 28800318982)
2024/06/12 09:26:26 ERROR : XXX: corrupted on transfer

another log from another try:

2024/06/12 12:31:04 DEBUG : XXX: Uploading segments into "XXX" seems done (EOF)                                                                                                                 
2024/06/12 12:31:04 DEBUG : XXX: Sizes differ (src 318285130095 vs dst 98168056175)                                                                                                                                  
2024/06/12 12:31:04 ERROR : XXX: corrupted on transfer

if you run rclone rcat on the command line, do you have the same issue?

Those sizes are very different

src 281,129,647,622 
dst  28,800,318,982

They are exactly 235 GiB different - how did 235 GiB of data go missing?

Can you look in the segments container and see if the segments did get uploaded?

src 318,285,130,095
dst  98,168,056,175

That is 205 GiB different.

Judging by your config you are using the default 5GiB segment size so 47 segments went missing in the first transfer and 41 in the second.

It should be pretty easy to see if they are in the segments container using rclone to list the "XXX_segments" container.

I suspect this might be an eventual consistency problem.

Were there any other errors in the log?

1 Like

Is now running like that, will keep you updated.

Regarding the 235GB difference. When I check the XXX_segment container from that run, I can see chunks starting from

00000041 -> 5GB
00000042 -> 5GB
... -> 5GB
00000059 -> 1,43GB

No errors as long as I can see the log.

I also checked the other run, there is only

00000047 -> 5GB
00000048 -> 5GB
...
00000052 -> 1.82 GB

For example the segments from yesterday (XXX.20240610_220003_segments)
are all there.

00000000 -> 5GB
00000001 -> 5GB
...
00000052 -> 1.82 GB

I disabled all logs except from rclone to see it better if there are some issues, but on the first view there were no errors.

Running rclone rcat command as bash script went through successfully.

Also running the embedded rclone in the golang script went through successfully.
Here are the logs:

2024-06-13T05:51:36Z    DEBUG    rclone/client.go:240    copying from pipe    {"config": "/tmp/XXX-3995356424", "target": "XXX:XXX/XXX/cron/20240613_055136/", "file": "XXX.20240613_055136"}
2024/06/13 05:51:36 DEBUG : Creating backend with remote "XX:XXX/XXX/cron/20240613_055136/"
2024/06/13 05:51:36 DEBUG : Using config file from "/tmp/XXX-3995356424"
2024/06/13 05:51:37 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000000" into "XXX_segments"
2024/06/13 06:10:22 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000001" into "XXX_segments"
2024/06/13 06:26:11 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000002" into "XXX_segments"
2024/06/13 06:41:31 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000003" into "XXX_segments"
2024/06/13 06:56:10 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000004" into "XXX_segments"
2024/06/13 07:11:49 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000005" into "XXX_segments"
2024/06/13 07:27:16 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000006" into "XXX_segments"
2024/06/13 07:42:42 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000007" into "XXX_segments"
2024/06/13 07:57:54 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000008" into "XXX_segments"
2024/06/13 08:12:23 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000009" into "XXX_segments"
2024/06/13 08:27:49 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000010" into "XXX_segments"
2024/06/13 08:42:22 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000011" into "XXX_segments"
2024/06/13 08:57:30 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000012" into "XXX_segments"
2024/06/13 09:11:48 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000013" into "XXX_segments"
2024/06/13 09:25:13 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000014" into "XXX_segments"
2024/06/13 09:39:08 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000015" into "XXX_segments"
2024/06/13 09:52:53 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000016" into "XXX_segments"
2024/06/13 10:06:33 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000017" into "XXX_segments"
2024/06/13 10:20:40 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000018" into "XXX_segments"
2024/06/13 10:34:36 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000019" into "XXX_segments"
2024/06/13 10:48:23 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000020" into "XXX_segments"
2024/06/13 11:02:10 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000021" into "XXX_segments"
2024/06/13 11:16:07 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000022" into "XXX_segments"
2024/06/13 11:30:02 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000023" into "XXX_segments"
2024/06/13 11:43:55 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000024" into "XXX_segments"
2024/06/13 11:57:19 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000025" into "XXX_segments"
2024/06/13 12:10:39 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000026" into "XXX_segments"
2024/06/13 12:24:08 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000027" into "XXX_segments"
2024/06/13 12:37:26 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000028" into "XXX_segments"
2024/06/13 12:51:36 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000029" into "XXX_segments"
2024/06/13 13:05:23 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000030" into "XXX_segments"
2024/06/13 13:19:22 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000031" into "XXX_segments"
2024/06/13 13:32:37 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000032" into "XXX_segments"
2024/06/13 13:46:00 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000033" into "XXX_segments"
2024/06/13 13:59:46 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000034" into "XXX_segments"
2024/06/13 14:13:19 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000035" into "XXX_segments"
2024/06/13 14:26:45 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000036" into "XXX_segments"
2024/06/13 14:40:25 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000037" into "XXX_segments"
2024/06/13 14:54:05 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000038" into "XXX_segments"
2024/06/13 15:07:55 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000039" into "XXX_segments"
2024/06/13 15:21:35 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000040" into "XXX_segments"
2024/06/13 15:34:54 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000041" into "XXX_segments"
2024/06/13 15:48:27 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000042" into "XXX_segments"
2024/06/13 16:02:03 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000043" into "XXX_segments"
2024/06/13 16:15:45 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000044" into "XXX_segments"
2024/06/13 16:29:21 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000045" into "XXX_segments"
2024/06/13 16:43:03 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000046" into "XXX_segments"
2024/06/13 16:56:54 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000047" into "XXX_segments"
2024/06/13 17:10:44 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000048" into "XXX_segments"
2024/06/13 17:24:18 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000049" into "XXX_segments"
2024/06/13 17:37:48 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000050" into "XXX_segments"
2024/06/13 17:51:28 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000051" into "XXX_segments"
2024/06/13 17:51:28 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000052" into "XXX_segments"
2024/06/13 17:51:28 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000053" into "XXX_segments"
2024/06/13 17:10:44 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000054" into "XXX_segments"
2024/06/13 17:24:18 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000055" into "XXX_segments" 
2024/06/13 17:37:48 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000056" into "XXX_segments" 
2024/06/13 17:51:28 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000057" into "XXX_segments" 
2024/06/13 18:04:49 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000058" into "XXX_segments" 
2024/06/13 18:18:23 DEBUG : XXX.20240613_055136: Uploading segment file "XXX/cron/20240613_055136/XXX.20240613_055136/1718257897.301707048/-1/00000059" into "XXX_segments" 
2024/06/13 19:26:43 DEBUG : XXX.20240613_055136: Uploading segments into "XXX_segments" seems done (EOF)                                                                          
2024/06/13 19:26:43 DEBUG : XXX.20240613_055136: Returning empty Md5sum for swift large object                                                                                                
2024/06/13 19:26:43 DEBUG : XXX.20240613_055136: Dst hash empty - aborting Src hash check                                                                                                     
2024/06/13 19:26:43 DEBUG : XXX.20240613_055136: Size of src and dst objects identical

Is it your conclusion that the problem is in your custom code?

The last couple of days we had no issue. I think the problem happened due to infrastructure problems.

Thanks for your help :slight_smile:

1 Like

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