Skip to content

mc mv command on same bucket delete file #5170

@skeres

Description

@skeres

NOTE

If this case is urgent, please subscribe to Subnet so that our 24/7 support team may help you faster.

Original file disappear when executing a wrong move operation on a file in identical bucket

Expected Behavior

  • the file file1.txt should be found after this wrong move, or give an error as in linux : mv file1.txt . => answer :
    mv: 'file1.txt' and './file1.txt' identify the same file, or give a solution to recover the file.

Current Behavior

  • A wrong operation ( but not possible in a linux terminal ) delete a file

Possible Solution

  • The reason seems to be that minio is doing a copy and a delete action

Steps to Reproduce (for bugs)

  • echo 'file1' > file1.txt
  • mc cp file1.txt minio1/bucket1
  • mc ls minio1/bucket1/file1.txt => answer : [[2025-03-23 21:38:09 CET] 6B STANDARD file1.txt
  • mc mv minio1/bucket1 minio1/bucket1
  • mc ls -r minio1 => answer : none
  • trying to revert action
    • mc undo minio1/bucket1/file1.txt => answer : mc: Undo command works only with S3 versioned-enabled buckets.

Context

  • I was trying mc commands, and after a wrong command, i found this issue

Regression

Your Environment

  • mc --version :
    mc version RELEASE.2025-03-12T17-29-24Z (commit-id=c1d5d4cbb4caf05afef3ea06a91a56bd778336de)
    Runtime: go1.24.1 linux/amd64
    Copyright (c) 2015-2025 MinIO, Inc.

  • Version used (minio --version): docker exec minio1 minio --version
    minio version RELEASE.2025-02-28T09-55-16Z (commit-id=8c2c92f7afdc8386b000c0cb57ecec2ee1f5bcb0)
    Runtime: go1.23.6 linux/amd64
    License: GNU AGPLv3 - https://www.gnu.org/licenses/agpl-3.0.html

  • Server setup and configuration: docker container

  • minio image used : image: minio/minio:RELEASE.2025-02-28T09-55-16Z@sha256:a929054ae025fa7997857cd0e2a2e3029238e31ad89877326dc032f4c1a14259

  • Operating System and version (uname -a): ubuntu 22.04 Linux 5.15.0-134-generic Add license header minio#145-Ubuntu SMP Wed Feb 12 20:08:39 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions