meilisearch: Error when deleting index: DirectoryNotEmpty

Description When deleting an index using $client->deleteIndex('Posts') I see in the MeiliSearch output the error below. However, the index does seem to be deleted in the sense that $client->getAllIndexes() no longer shows the one I just tried to delete.

ERROR meilisearch_lib::index_controller::index_resolver] Error while deleting index: Internal(Os { code: 39, kind: DirectoryNotEmpty, message: "Directory not empty" })

Expected behavior There should not be an error

Current behavior There’s a DirectoryNotEmpty error

Screenshots or Logs See above

Environment (please complete the following information):

  • OS: Ubuntu running in a Virtualbox (Laravel Homestead) on MacOS
  • MeiliSearch version: 0.23.1
  • meilisearch-php version: ^0.19.2

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (10 by maintainers)

Most upvoted comments

Hello @stefkes thanks for opening this issue. It seems related to MeiliSearch and not to meilisearch-php library, so I move the issue into the right repo 😃 I will move it back if it appears it’s finally a meilisearch-php issue

Currently checking with the devs of the core team to know better where this issue could come from

We are getting same error on v0.30.0rc2 . Running Meilisearch instance on Kubernetes with persistent volume.

simple request like

curl -X DELETE '<meilisearch>/indexes/<index>' 

will return

{"taskUid":33,"indexUid":"v2_staging","status":"enqueued","type":"indexDeletion","enqueuedAt":"2022-11-21T17:46:40.863515208Z"}%    

logs

[2022-11-21T17:59:19Z INFO  actix_web::middleware::logger] 10.244.0.226 "DELETE /indexes/v2_staging HTTP/1.1" 202 127 "-" "curl/7.84.0" 0.001331

then when I check Tasks:

[
 {
      "uid": 33,
      "indexUid": "<index>",
      "status": "failed",
      "type": "indexDeletion",
      "details": {
        "deletedDocuments": 0
      },
      "error": {
        "message": "An internal error has occurred. `Directory not empty (os error 39)`.",
        "code": "internal",
        "type": "internal",
        "link": "https://docs.meilisearch.com/errors#internal"
      },
      "duration": "PT0.002740018S",
      "enqueuedAt": "2022-11-21T17:46:40.863515208Z",
      "startedAt": "2022-11-21T17:46:40.865735138Z",
      "finishedAt": "2022-11-21T17:46:40.868475156Z"
    }
...
]

The thing is, that index was deleted as a result.

So the information that it is not possible to delete the index is wrong

Hi,

I have the same issue here, Meilisearch is on Clever-cloud, index of ~4M entries. v0.24

ERROR meilisearch_lib::index_controller::index_resolver] Error while deleting index: Internal(Os { code: 39, kind: DirectoryNotEmpty, message: "Directory not empty" })

Edit : The index was deleted anyway, but the machine crashed and restarted.