Open SuperSandro2000 opened 3 years ago
I could further pinpoint this issue down to nix-copy-closure --from ssh://server /nix/store/.....
core dumping but nix copy --from ssh://server /nix/store/.....
works just fine.
The relevant version mismatch seems to be between the local daemon and the remote builder. In my case the following version combinations both result in the error:
local CLI: 2.3.10
, local daemon: 2.3.10
, remote daemon: 2.4pre20210326_dd77f71
local CLI: 2.4pre20210326_dd77f71
, local daemon: 2.3.10
, remote daemon: 2.4pre20210326_dd77f71
while this combination works:
local CLI: 2.4pre20210326_dd77f71
, local daemon: 2.4pre20210326_dd77f71
, remote daemon: 2.4pre20210326_dd77f71
for completeness, I tried this combination, which resulted in nix-build
just hanging forever not building anything:
local CLI: 2.3.10
, local daemon: 2.4pre20210326_dd77f71
, remote daemon: 2.4pre20210326_dd77f71
I am seeing the same error when building from 2.3.10 (x86_64-linux) on a 2.4pre20210503_6d2553a (aarch64-linux) box. The stack trace is pretty similar to what has been posted above:
#0 0x00007f5e7bbad33a in raise () from /nix/store/v8q6nxyppy1myi3rxni2080bv8s9jxiy-glibc-2.32-40/lib/libc.so.6
#1 0x00007f5e7bb97523 in abort () from /nix/store/v8q6nxyppy1myi3rxni2080bv8s9jxiy-glibc-2.32-40/lib/libc.so.6
#2 0x00007f5e7bb9741f in __assert_fail_base.cold.0 () from /nix/store/v8q6nxyppy1myi3rxni2080bv8s9jxiy-glibc-2.32-40/lib/libc.so.6
#3 0x00007f5e7bba5d92 in __assert_fail () from /nix/store/v8q6nxyppy1myi3rxni2080bv8s9jxiy-glibc-2.32-40/lib/libc.so.6
#4 0x00007f5e7c2bf81c in nix::LegacySSHStore::queryPathInfoUncached(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, nix::Callback<std::shared_ptr<nix::ValidPathInfo> >) () from /nix/store/0mfa9hrs5pascjqvq4q7bz1qp4ql72w2-nix-2.3.10/lib/libnixstore.so
#5 0x00007f5e7c34459b in nix::Store::queryPathInfo(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, nix::Callback<nix::ref<nix::ValidPathInfo> >) ()
from /nix/store/0mfa9hrs5pascjqvq4q7bz1qp4ql72w2-nix-2.3.10/lib/libnixstore.so
#6 0x00007f5e7c344a0a in nix::Store::queryPathInfo(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
from /nix/store/0mfa9hrs5pascjqvq4q7bz1qp4ql72w2-nix-2.3.10/lib/libnixstore.so
#7 0x00007f5e7c345d04 in std::_Function_handler<std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&), nix::copyPaths(nix::ref<nix::Store>, nix::ref<nix::Store>, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, nix::RepairFlag, nix::CheckSigsFlag, nix::SubstituteFlag)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#2}>::_M_invoke(std::_Any_data const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /nix/store/0mfa9hrs5pascjqvq4q7bz1qp4ql72w2-nix-2.3.10/lib/libnixstore.so
#8 0x00007f5e7c34b241 in nix::processGraph<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(nix::ThreadPool&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::function<std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>, std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const ()
from /nix/store/0mfa9hrs5pascjqvq4q7bz1qp4ql72w2-nix-2.3.10/lib/libnixstore.so
#9 0x00007f5e7c10c2ca in nix::ThreadPool::doWork(bool) () from /nix/store/0mfa9hrs5pascjqvq4q7bz1qp4ql72w2-nix-2.3.10/lib/libnixutil.so
#10 0x00007f5e7c10d085 in nix::ThreadPool::process() () from /nix/store/0mfa9hrs5pascjqvq4q7bz1qp4ql72w2-nix-2.3.10/lib/libnixutil.so
#11 0x00007f5e7c348a4f in void nix::processGraph<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(nix::ThreadPool&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::function<std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>, std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>) ()
from /nix/store/0mfa9hrs5pascjqvq4q7bz1qp4ql72w2-nix-2.3.10/lib/libnixstore.so
#12 0x00007f5e7c3409fd in nix::copyPaths(nix::ref<nix::Store>, nix::ref<nix::Store>, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, nix::RepairFlag, nix::CheckSigsFlag, nix::SubstituteFlag) () from /nix/store/0mfa9hrs5pascjqvq4q7bz1qp4ql72w2-nix-2.3.10/lib/libnixstore.so
#13 0x000000000044e3cc in _main(int, char**) ()
#14 0x000000000050a0b0 in nix::mainWrapped(int, char**) ()
#15 0x00007f5e7c3dd2e9 in nix::handleExceptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void ()>) ()
from /nix/store/0mfa9hrs5pascjqvq4q7bz1qp4ql72w2-nix-2.3.10/lib/libnixmain.so
#16 0x0000000000449c14 in main ()
This can be tested by running a stable nix version locally and remote building on the community aarch64-linux box.
The assertion that is being triggered is this one:
https://github.com/NixOS/nix/blob/2.3.11/src/libstore/legacy-ssh-store.cc#L103-L106
I made that assertion print an error before aborting like so (on the 2.3 client):
diff --git a/src/libstore/legacy-ssh-store.cc b/src/libstore/legacy-ssh-store.cc
index d5fbdd25a..a2e552e6c 100644
--- a/src/libstore/legacy-ssh-store.cc
+++ b/src/libstore/legacy-ssh-store.cc
@@ -101,7 +101,10 @@ struct LegacySSHStore : public Store
auto info = std::make_shared<ValidPathInfo>();
conn->from >> info->path;
if (info->path.empty()) return callback(nullptr);
- assert(path == info->path);
+ if (path != info->path) {
+ printError("path %s != info->path %s", path, info->path);
+ assert(path == info->path);
+ }
In my case this ended up resulting in this log line:
path /nix/store/mdkb735zm8dfhcyg9frd7ych2y5h38ly-mpp-git != info->path K
Briefly looking at the code this could be related to the storePath refactoring that @Ericson2314 did a while ago. Mind having a look?
In my case this ended up resulting in this log line:
path /nix/store/mdkb735zm8dfhcyg9frd7ych2y5h38ly-mpp-git != info->path K
FWIW, the K
remotely looks like the begining of the progress bar (\r\e[K
). Might have nothing to do with it but I’ve seen it pop up in a few places because of that, so maybe that’s what’s happening here
@Ericson2314 this is still an issue with any system that is still running 2.3 and is connecting to a builder with Nix 2.4. Any chance you could have a look? I am still sure that this is related to that refactoring you did back then.
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/nix-2-4-and-what-s-next/16257/1
Unfortunately I didn't see this one yet with the mixed version testing I was working on. Though perhaps too many remote builder tests were skipped, and fixing that would cause this to be reproduced after all.
@Ericson2314 if you’re referring to https://github.com/NixOS/nix/pull/5602, I don’t think it’s testing the exact setup (because of the daemon thing I mention in https://github.com/NixOS/nix/pull/5602#issuecomment-983361970). You’ll probably need a killDaemon
at the start of the test or something like that to make sure that it’s really nixA<->nixB(remote-builder)
and not nixA(client)<->nixB(daemon)<->nixB(remote-builder)
Oh right yes thanks.
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
I marked this as stale due to inactivity. → More info
Describe the bug
I had different nix versions for my nix-daemon and user nix binaries inplace which leads to coredumps when copying the derivations.
Steps To Reproduce
failed due to signal 6 (Aborted)
Expected behavior
It should not coredump or fail with a nicer message than coredumping
nix-env --version
output global envuser env
remote builders
Additional context