The Nix daemon crashes when started without --experimental-features ca-derivations
, but a client tries to force it
#5017
Labels
--experimental-features ca-derivations
, but a client tries to force it
#5017
Describe the bug
(privileged) clients can enable some experimental features on the daemon they talk to. This is generally fine, except for the
ca-derivations
which will cause the daemon to crash with something likesrc/libstore/sqlite.cc:92: nix::SQLiteStmt::Use::Use(nix::SQLiteStmt&): Assertion
stmt.stmt' failed`.Steps To Reproduce
ca-derivations
experimental feature--extra-experimental-features ca-derivations
Expected behavior
Ideally this should transparently work as expected.
This might be a bit tricky because of the DB schema constraints, but we should at least yield a proper error in that case.
Additional context
The underlying issue is that enabling
ca-derivations
changes the underlying db schema (which can only happen at the begining of the process when we open the DB).Then some precompiled SQL queries in
LocalStore
depend on the ca-specific schema, so they are left undefined if the experimental-feature isn’t set (here).In a “normal” setting, this is fine because we’ll never use these as
ca-derivations
isn’t set. But since the client can enable the feature after-the-fact, we end-up using it anyways, leading to the assertion failure (which is mostly a glorified null pointer exception)The text was updated successfully, but these errors were encountered: