MinIO Can’t Delete Folder. Fix Undeletable Files and Ghost Folders

We noticed that sometimes in MinIO, even after clicking “delete folder” in the GUI, the folder still shows up and worse, it can’t be deleted anymore. Let’s dig into this challenge.1

Current Situation

We use Spark to write Parquet files into MinIO (RELEASE.2025-03-12T17-29-24Z). At some point, Delta Lake started throwing the following error:

Caused by: org.apache.spark.sql.delta.DeltaAnalysisException: [DELTA_CREATE_TABLE_WITH_NON_EMPTY_LOCATION] 
Cannot create table ('`landingzone`.`testi_table`'). The associated location ('s3a://landing-zone/testi/table') is not empty and also not a Delta table.

However, when we checked the location in the MinIO GUI, we couldn’t delete the folder. Inside it, there were “folders” with a .parquet suffix but they appeared to be empty. Because these couldn’t be removed, Delta still considered the location non-empty and refused to create the table.

Analysis

MinIO stores objects differently at the filesystem level than what you see in the GUI.

A healthy object (e.g., a Parquet file) looks like this:

part-00000-...snappy.parquet/
├── xl.meta
└── <uuid>/
    ├── part.1
    ├── part.2
    └── part.3

Notice there is an xl.meta file. While you can partially read it, it also contains non-readable characters and symbols, indicating that it is a binary file storing metadata that tells MinIO how to interpret the directory as a single object.

But in our unhealthy case, the structure looked like this:

part-00000-...snappy.parquet/
└── <uuid>/
    └── part.1

Notice the missing xl.meta file.

Our Interpretation / Hypothesis:
Without xl.meta, MinIO cannot interpret this directory as an object anymore.

  • The GUI shows it as a folder (because that’s what it physically is)
  • But it appears empty (because MinIO doesn’t know how to read the raw parts)
  • mc commands don’t work properly
  • Spark/Delta still sees “something” in the location → causing errors

This likely happens due to an interrupted write or delete operation, leaving behind orphaned data parts without metadata.

Resolution

The only reliable fix was to remove the broken objects directly at the filesystem level. MinIO allowed this without requiring a container restart. After that, the folder was truly empty, and Delta could create the table again.

We also tried mulitple MinIO client approaches using different flags (i.e. –version, –dangerous, –force …) but non succeeded.

Other (related) Issues

https://github.com/minio/minio/discussions/15257#discussioncomment-3109625

https://github.com/minio/minio/issues/16836

https://github.com/minio/minio/discussions/19516

  1. This blog post was drafted manually and then summarized, refined, and written with the help of ChatGPT 5.3. ↩︎

5 thoughts on “MinIO Can’t Delete Folder. Fix Undeletable Files and Ghost Folders”

  1. The distinction between MinIO’s virtual folder prefixes and actual objects explains why the GUI showed empty folders that Delta Lake still treated as present. Checking object versions and using a recursive, forced removal is a useful fix for these leftover Parquet or transaction-log prefixes.

  2. The distinction between MinIO’s virtual folders and the underlying object prefixes is especially important here. Checking hidden objects and cleanup markers with the S3/MinIO CLI, rather than relying only on the GUI, explains why those suffix folders looked empty but still blocked Delta Lake table creation.

  3. The distinction between MinIO’s GUI “folders” and actual S3 object prefixes explains why those suffix-suffixed entries can look empty yet still block Delta Lake table creation. Checking and removing the underlying objects with the MinIO CLI is much more reliable than relying on the folder view.

  4. The distinction between MinIO’s virtual folder prefixes and actual objects explains why those suffix-suffixed “empty” folders remained undeletable. Checking and removing the underlying objects or metadata, rather than relying only on the GUI, is crucial when Delta Lake still sees the location as non-empty.

  5. The distinction between MinIO’s GUI “folders” and S3 object prefixes is key here—those suffix-named entries can look empty while still leaving objects or delete markers behind. Checking the prefix with `mc ls –recursive` before removing it is a useful detail for Spark/Delta Lake cleanup.

Leave a Comment

Your email address will not be published. Required fields are marked *

hungsblog | Nguyen Hung Manh | Dresden
Scroll to Top