meilisearch: Can't create index (OS error 22)

Describe the bug Can’t create index

To Reproduce

  1. cargo run in meilisearch root folder
curl   
    -X POST 'http://localhost:7700/indexes'   
    -H 'Content-Type: application/json'   
    --data-binary '{
        "uid": "movies",
        "primaryKey": "id"
    }'

Response:

{
	"taskUid": 0,
	"indexUid": "movies",
	"status": "enqueued",
	"type": "indexCreation",
	"enqueuedAt": "2022-11-01T08:44:00.269189619Z"
}
curl \
  -X GET 'http://localhost:7700/tasks/0'

Response:

{
	"uid": 0,
	"indexUid": "movies",
	"status": "failed",
	"type": "indexCreation",
	"details": {
		"primaryKey": "id"
	},
	"error": {
		"message": "Invalid argument (os error 22)",
		"code": "internal",
		"type": "internal",
		"link": "https://docs.meilisearch.com/errors#internal"
	},
	"duration": "PT0.000368400S",
	"enqueuedAt": "2022-11-01T08:44:00.269189619Z",
	"startedAt": "2022-11-01T08:44:00.274817501Z",
	"finishedAt": "2022-11-01T08:44:00.275185901Z"
}

Expected behavior I expected the "status" field to be "succeeded" rather than "failed" in the response from curl -X GET 'http://localhost:7700/tasks/0'

Screenshots Attempting to post index: image

Attempting to get indexes: image

Checking task status: image

Meilisearch version: [e.g. v0.20.0] 0.28.1

Additional context Additional information that may be relevant to the issue. [e.g. architecture, device, OS, browser] OS: Archlinux Architecture: x86_64


EDITED by @curquiza & @dureuill

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (16 by maintainers)

Commits related to this issue

Most upvoted comments

I reproduced the issue on an up-to-date KDE Archlinux and think I have a fix:

  • it looks like it is caused by the Rust lmdb-sys package using the system’s version of lmdb if it is installed
  • On KDE archlinux lmdb (v. 0.9.29-1 for an up-to-date system) is very likely to be installed due to baloo which depends on it and is a KDE program
  • The system version of lmdb is likely to be incompatible with the version used by meilisearch
  • Modifying lmdb-sys to always use the vendored version appears to fix the issue. Adding a vendored feature like is done in https://lib.rs/crates/libgit2-sys is a way of adding this behavior back-compatibly
  • The line of the issue: https://github.com/meilisearch/lmdb-rs/blob/main/lmdb-sys/build.rs#L62
  • I will open a PR shortly to add such a vendored feature to lmdb-rs and make sure we make use of it in meilisearch

lmdb-rs PR is here, heed and milli PRs incoming

A “dependency bump” means “upgrade a dependency”, is a common term used, see for example this random tutorial I found when typing “bump dependency” on Google

But no worry with this @amab8901, @irevoire was writing this for traceability and for helping his own team internally to investigate the bug. Nothing related to you or any users.

Thanks for explanation! Even though it’s not related to me or users, I’m still curious about your process of solving the issue since I might learn something useful that I might use in my own problem-solving. Especially small and easily digested pieces of info.

why is this closed when there are 2 tasks left?

A “dependency bump” means “upgrade a dependency”, is a common term used, see for example this random tutorial I found when typing “bump dependency” on Google

But no worry with this @amab8901, @irevoire was writing this for traceability and for helping his own team internally to investigate the bug. Nothing related to you or any users.