# \`\`\`rclone move chunker:dir/file chunker:dir\`\`\` deletes all file chunks

**URL:** <https://forum.rclone.org/t/rclone-move-chunker-dir-file-chunker-dir-deletes-all-file-chunks/43333>\
**Category:** Suspected Bug\
**Created:** [December 7, 2023, 5:15pm UTC](https://forum.rclone.org/t/rclone-move-chunker-dir-file-chunker-dir-deletes-all-file-chunks/43333 "2023-12-07T17:15:00Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![izami-mario](https://forum.rclone.org/letter_avatar_proxy/v4/letter/i/b77776/32.png) [@izami-mario](https://forum.rclone.org/u/izami-mario)\
**Post date:** [December 7, 2023, 5:15pm UTC](https://forum.rclone.org/t/rclone-move-chunker-dir-file-chunker-dir-deletes-all-file-chunks/43333/1 "2023-12-07T17:15:00Z")

</div>

### What is the problem you are having with rclone?

# Moving a chunked-file to its own directory deletes all of the file's chunks.

* * *

### `rclone version`

```auto
rclone v1.65.0
- os/version: debian 12.1
- os/kernel: 6.1.21+ (armv6l)
- os/type: linux
- os/arch: arm (ARMv6 compatible)
- go/version: go1.21.4
- go/linking: static
- go/tags: none

```

### Used remotes:

`chunker over local file system`

#### Command

```auto
rclone move chunker:dir/file chunker:dir

```

### Config

```auto
[chunker]
type = chunker
remote = /home/MyUsername
chunk_size = 1Mi

```

# Steps to reproduce:

## 1. Have some chunked file inside chunker remote.

`$ rclone tree chunker:`

```auto
/
└── rclone.deb

0 directories, 1 files

```

## 2. Move file to its own directory using the command below.

`$ rclone move chunker:rclone.deb chunker: -vv`

```auto
<7>DEBUG : rclone: Version "v1.65.0" starting with parameters ["rclone" "move" "chunker:rclone.deb" "chunker:" "-vv"]
<7>DEBUG : rclone: systemd logging support activated
<7>DEBUG : Creating backend with remote "chunker:rclone.deb"
<7>DEBUG : Using config file from "/home/MyUsername/.config/rclone/rclone.conf"
<7>DEBUG : Creating backend with remote "/home/MyUsername/chunker/rclone.deb"
<7>DEBUG : fs cache: adding new entry for parent of "/home/MyUsername/chunker/rclone.deb", "/home/txtr/chunker"
<7>DEBUG : Reset feature "ListR"
<7>DEBUG : Creating backend with remote "chunker:"
<7>DEBUG : Reset feature "ListR"
<7>DEBUG : rclone.deb: Size and modification time the same (differ by 0s, within tolerance 1ns)
<7>DEBUG : rclone.deb: Unchanged skipping
<6>INFO : rclone.deb: Deleted
<6>INFO : 
Transferred: 0 B / 0 B, -, 0 B/s, ETA -
Checks: 1 / 1, 100%
Deleted: 1 (files), 0 (dirs)
Elapsed time: 0.0s

<7>DEBUG : 4 go routines active

```

# Result:

`$ rclone tree chunker:`

```auto
/

0 directories, 0 files

```

# Expected result:

`$ rclone tree chunker:`

```auto
/
└── rclone.deb

0 directories, 1 files

```

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://forum.rclone.org/user_avatar/forum.rclone.org/kapitainsky/32/14450_2.png) [@kapitainsky](https://forum.rclone.org/u/kapitainsky)\
**Post date:** [December 7, 2023, 5:55pm UTC](https://forum.rclone.org/t/rclone-move-chunker-dir-file-chunker-dir-deletes-all-file-chunks/43333/2 "2023-12-07T17:55:52Z")

</div>

Indeed I can replicate it easily.

I think it is a bug. Not massive but still one.

---

<div class="post-metadata">

**Author:** ![asdffdsa](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@asdffdsa](https://forum.rclone.org/u/asdffdsa)\
**Post date:** [December 7, 2023, 6:29pm UTC](https://forum.rclone.org/t/rclone-move-chunker-dir-file-chunker-dir-deletes-all-file-chunks/43333/3 "2023-12-07T18:29:00Z")

</div>

i would expect rclone to output.

`don't need to copy/move rclone.deb, it is already at target location`

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://forum.rclone.org/user_avatar/forum.rclone.org/kapitainsky/32/14450_2.png) [@kapitainsky](https://forum.rclone.org/u/kapitainsky)\
**Post date:** [December 7, 2023, 6:42pm UTC](https://forum.rclone.org/t/rclone-move-chunker-dir-file-chunker-dir-deletes-all-file-chunks/43333/4 "2023-12-07T18:42:36Z")

</div>

E.g. for local "remote" nothing happens:

```auto
$ rclone lsf .
a.txt

$ rclone move ./a.txt .

$ rclone lsf .
a.txt

```

but for chunker remote result is file deleted without any error.

So definitely rclone behaviour is not consistent .

---

<div class="post-metadata">

**Author:** ![asdffdsa](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@asdffdsa](https://forum.rclone.org/u/asdffdsa)\
**Post date:** [December 7, 2023, 6:44pm UTC](https://forum.rclone.org/t/rclone-move-chunker-dir-file-chunker-dir-deletes-all-file-chunks/43333/5 "2023-12-07T18:44:04Z")

</div>

> [@kapitainsky](#):
>
> nothing happens:

need to post a debug log

```auto
rclone move wasabi01:zork/file.ext wasabi01:zork -vv
2023/12/07 13:29:22 DEBUG : rclone: Version "v1.65.0" starting with parameters ["rclone" "move" "wasabi01:zork/file.ext" "wasabi01:zork" "-vv"]
2023/12/07 13:29:22 DEBUG : Creating backend with remote "wasabi01:zork/file.ext"
2023/12/07 13:29:22 DEBUG : Using config file from "c:\\data\\rclone\\rclone.conf"
2023/12/07 13:29:22 DEBUG : Resolving service "s3" region "us-east-2"
2023/12/07 13:29:22 DEBUG : fs cache: adding new entry for parent of "wasabi01:zork/file.ext", "wasabi01:zork"
2023/12/07 13:29:22 DEBUG : S3 bucket zork: don't need to copy/move file.ext, it is already at target location

```

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [December 8, 2023, 2:23pm UTC](https://forum.rclone.org/t/rclone-move-chunker-dir-file-chunker-dir-deletes-all-file-chunks/43333/6 "2023-12-08T14:23:31Z")

</div>

Yes I agree, this is a bug.

I investigated and it turns out its a bug in the chunker backend.

It was easy to fix though - please give this a try

[v1.66.0-beta.7565.88a3de4a7.fix-chunker-file](https://beta.rclone.org/branch/fix-chunker-file/v1.66.0-beta.7565.88a3de4a7.fix-chunker-file/) on branch [fix-chunker-file](https://github.com/rclone/rclone/tree/fix-chunker-file) (uploaded in 15-30 mins)

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://forum.rclone.org/user_avatar/forum.rclone.org/kapitainsky/32/14450_2.png) [@kapitainsky](https://forum.rclone.org/u/kapitainsky)\
**Post date:** [December 8, 2023, 3:23pm UTC](https://forum.rclone.org/t/rclone-move-chunker-dir-file-chunker-dir-deletes-all-file-chunks/43333/7 "2023-12-08T15:23:42Z")

</div>

FYI - looks like these builds are missing osx-amd-64 recently

---

<div class="post-metadata">

**Author:** ![asdffdsa](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@asdffdsa](https://forum.rclone.org/u/asdffdsa)\
**Post date:** [December 8, 2023, 6:01pm UTC](https://forum.rclone.org/t/rclone-move-chunker-dir-file-chunker-dir-deletes-all-file-chunks/43333/8 "2023-12-08T18:01:15Z")

</div>

the beta seems to have fixed the issue

```auto
./rclone touch chunker:file.ext

./rclone move chunker:file.ext chunker: -vv
2023/12/08 12:57:59 DEBUG : rclone: Version "v1.66.0-beta.7565.88a3de4a7.fix-chunker-file" starting with parameters ["./rclone" "move" "chunker:file.ext" "chunker:" "-vv"]
2023/12/08 12:57:59 DEBUG : Creating backend with remote "chunker:file.ext"
2023/12/08 12:57:59 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2023/12/08 12:57:59 DEBUG : Creating backend with remote "/root/test/file.ext"
2023/12/08 12:57:59 DEBUG : fs cache: adding new entry for parent of "/root/test/file.ext", "/root/test"
2023/12/08 12:57:59 DEBUG : Reset feature "ListR"
2023/12/08 12:57:59 DEBUG : fs cache: adding new entry for parent of "chunker:file.ext", "chunker:"
2023/12/08 12:57:59 DEBUG : Chunked 'chunker:': don't need to copy/move file.ext, it is already at target location
2023/12/08 12:57:59 INFO :
Transferred: 0 B / 0 B, -, 0 B/s, ETA -
Elapsed time: 0.0s

2023/12/08 12:57:59 DEBUG : 5 go routines active

```

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://forum.rclone.org/user_avatar/forum.rclone.org/kapitainsky/32/14450_2.png) [@kapitainsky](https://forum.rclone.org/u/kapitainsky)\
**Post date:** [December 8, 2023, 6:42pm UTC](https://forum.rclone.org/t/rclone-move-chunker-dir-file-chunker-dir-deletes-all-file-chunks/43333/9 "2023-12-08T18:42:56Z")

</div>

> [@ncw](#):
>
> [fix-chunker-file](https://github.com/rclone/rclone/tree/fix-chunker-file)

Works for me as well - with chunker on top of crypt and union. It did not work before.

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [December 9, 2023, 11:49am UTC](https://forum.rclone.org/t/rclone-move-chunker-dir-file-chunker-dir-deletes-all-file-chunks/43333/10 "2023-12-09T11:49:03Z")

</div>

Thanks for testing 🙂

I made an integration test for this and it showed the `compress` and `crypt` backends are broken in the same way, so I'll have to fix those too.

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [December 10, 2023, 10:30pm UTC](https://forum.rclone.org/t/rclone-move-chunker-dir-file-chunker-dir-deletes-all-file-chunks/43333/11 "2023-12-10T22:30:45Z")

</div>

The fix for this is merged into [the latest beta](https://beta.rclone.org/)  
and I'll put it in 1.65.1

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [January 9, 2024, 10:31pm UTC](https://forum.rclone.org/t/rclone-move-chunker-dir-file-chunker-dir-deletes-all-file-chunks/43333/12 "2024-01-09T22:31:40Z")

</div>

Closed on January 9, 2024, 10:31pm UTC

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