Nix-command develop Download Hanging Forever

I’m using Ubuntu 22.04.1 LTS, I did a clean nix install earlier today.
I ran nix --verbose --extra-experimental-features "nix-command" develop and expected some cached packages to be downloaded, but instead I see this forever, until I C-C:


(Please excuse the screenshot, I can’t copy the text because the terminal is refreshing continuously)

I then tried with --no-substitute (omitting --verbose because it doesn’t print anything and removes the [26.8 MiB DL]) but got the same behaviour:

I tried leaving this overnight and nothing happened - not even a timeout. After that, I did the clean install and tried again but I get the same behaviour.

What is the next step to either fix the issue or provide more useful information?

FYI I can access http://cache.nixos.org/ in my browser okay and I can curl it too:

$ curl -H 'Host: cache.nixos.org' http://151.101.134.217/nix-cache-info
StoreDir: /nix/store
WantMassQuery: 1
Priority: 40

Thanks!

What version of nix? (nix-env --version)

Multi- or single user?

How did you install nix?

What is the size of the folder where you run the command?

Version:

$ nix-env --version
nix-env (Nix) 2.11.0

I installed a multi-user nix by doing:

sh <(curl -L https://nixos.org/nix/install) --daemon

And following the prompts - I didn’t change anything from the default if there was an option to do so and I allowed the script to use sudo. I can do another reinstall and post the terminal history if it helps?

What do you mean by size, exactly? I have:

$ stat .
  File: .
  Size: 4096      	Blocks: 8          IO Block: 4096   directory
Device: 10302h/66306d	Inode: 12075461    Links: 5
Access: (0775/drwxrwxr-x)  Uid: ( 1000/  elliot)   Gid: ( 1000/  elliot)
Access: 2022-09-22 19:41:59.443562680 +0900
Modify: 2022-09-22 19:43:22.348480664 +0900
Change: 2022-09-22 19:43:22.348480664 +0900
 Birth: 2022-09-22 08:02:09.819028198 +0900
$ du -sh .
1.9M	.

This is what I meant. If a flake related option is issued in huge folders they can take quite some time as the content is copied to the nix store…

But as your version is recent and you are already using the demon, I have no clue where to continue.

does nix shell nixpkgs#hello work?

Not sure why but changing my DNS server to cloudflare’s (1.1.1.1) seems to have fixed it.
So this can be marked as “solved”, I suppose?
Changing the DNS back, I can’t reproduce the original issue. I tried flushing the DNS cache (with sudo resolvectl flush-caches) but it didn’t change anything.

I’m not sure if nix was doing anything wrong but perhaps the lack of timeout (or at least feedback after a certain timeout) should be considered a bug? I’m not sure if it was DNS resolution failure or something else weird going on.

Sorry @Solene but I just saw this post so didn’t get to try that while it was still broken.

Thanks for the help all.

Edit: it’s happening again, so I guess just waiting some time causes the bad DNS information to propagate. I’ll see if I can debug exactly where this happens.

1 Like

It looks like it’s a blocking read():

(gdb) bt
#0  0x00007ffff6cfa7c4 in read () from /nix/store/scd5n7xsn0hh0lvhhnycr9gx0h8xfzsl-glibc-2.34-210/lib/libc.so.6
#1  0x00007ffff77980d3 in nix::FdSource::readUnbuffered(char*, unsigned long) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixutil.so
#2  0x00007ffff77937d2 in nix::BufferedSource::read(char*, unsigned long) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixutil.so
#3  0x00007ffff7794d78 in nix::Source::operator()(char*, unsigned long) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixutil.so
#4  0x00007ffff7406a61 in unsigned long nix::readNum<unsigned long>(nix::Source&) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixstore.so
#5  0x00007ffff750155c in nix::RemoteStore::Connection::processStderr(nix::Sink*, nix::Source*, bool) ()
   from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixstore.so
#6  0x00007ffff7506579 in nix::RemoteStore::ensurePath(nix::StorePath const&) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixstore.so
#7  0x00007ffff7b6ffcd in nix::fetchers::Input::fetch(nix::ref<nix::Store>) const () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixfetchers.so
#8  0x00007ffff7db10b7 in nix::fetchTree(nix::EvalState&, nix::PosIdx, nix::Value**, nix::Value&, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, nix::FetchTreeParams const&) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#9  0x00007ffff7db266e in nix::prim_fetchTree(nix::EvalState&, nix::PosIdx, nix::Value**, nix::Value&) ()
   from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#10 0x00007ffff7cd97ec in nix::EvalState::callFunction(nix::Value&, unsigned long, nix::Value**, nix::Value&, nix::PosIdx) ()
   from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#11 0x00007ffff7cda98b in nix::ExprCall::eval(nix::EvalState&, nix::Env&, nix::Value&) ()
   from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#12 0x00007ffff7cdf879 in nix::ExprVar::eval(nix::EvalState&, nix::Env&, nix::Value&) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#13 0x00007ffff7ce0832 in nix::ExprConcatStrings::eval(nix::EvalState&, nix::Env&, nix::Value&) ()
   from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#14 0x00007ffff7ce0832 in nix::ExprConcatStrings::eval(nix::EvalState&, nix::Env&, nix::Value&) ()
   from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#15 0x00007ffff7ce0832 in nix::ExprConcatStrings::eval(nix::EvalState&, nix::Env&, nix::Value&) ()
   from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#16 0x0000000000570ddd in void nix::EvalState::forceValue<nix::EvalState::forceValue(nix::Value&, nix::PosIdx)::{lambda()#1}>(nix::Value&, nix::EvalState::forceValue(nix::Value&, nix::PosIdx)::{lambda()#1}) ()
#17 0x00007ffff7cdd507 in nix::EvalState::coerceToString(nix::PosIdx, nix::Value&, 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> > > >&, bool, bool, bool) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#18 0x00007ffff7cde4c9 in nix::EvalState::coerceToPath(nix::PosIdx, nix::Value&, 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> > > >&) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#19 0x00007ffff7d89aa9 in nix::realisePath(nix::EvalState&, nix::PosIdx, nix::Value&, nix::RealisePathFlags) ()
   from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#20 0x00007ffff7d8a676 in nix::import(nix::EvalState&, nix::PosIdx, nix::Value&, nix::Value*, nix::Value&) ()
   from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#21 0x00007ffff7cd97ec in nix::EvalState::callFunction(nix::Value&, unsigned long, nix::Value**, nix::Value&, nix::PosIdx) ()
   from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#22 0x00007ffff7cda98b in nix::ExprCall::eval(nix::EvalState&, nix::Env&, nix::Value&) ()
   from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#23 0x00007ffff7cdf879 in nix::ExprVar::eval(nix::EvalState&, nix::Env&, nix::Value&) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#24 0x00007ffff7cde83f in nix::ExprSelect::eval(nix::EvalState&, nix::Env&, nix::Value&) ()
   from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#25 0x00007ffff7d75029 in nix::prim_isFunction(nix::EvalState&, nix::PosIdx, nix::Value**, nix::Value&) ()
   from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#26 0x00007ffff7cd97ec in nix::EvalState::callFunction(nix::Value&, unsigned long, nix::Value**, nix::Value&, nix::PosIdx) ()
   from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#27 0x00007ffff7cda98b in nix::ExprCall::eval(nix::EvalState&, nix::Env&, nix::Value&) ()
   from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#28 0x00007ffff7cdfeec in nix::ExprAssert::eval(nix::EvalState&, nix::Env&, nix::Value&) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#29 0x00007ffff7cd96ca in nix::EvalState::callFunction(nix::Value&, unsigned long, nix::Value**, nix::Value&, nix::PosIdx) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#30 0x0000000000570e09 in void nix::EvalState::forceValue<nix::EvalState::forceValue(nix::Value&, nix::PosIdx)::{lambda()#1}>(nix::Value&, nix::EvalState::forceValue(nix::Value&, nix::PosIdx)::{lambda()#1}) ()
#31 0x00007ffff7cdec4d in nix::ExprSelect::eval(nix::EvalState&, nix::Env&, nix::Value&) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#32 0x00007ffff7cd96ca in nix::EvalState::callFunction(nix::Value&, unsigned long, nix::Value**, nix::Value&, nix::PosIdx) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#33 0x00007ffff7cdf8aa in nix::ExprVar::eval(nix::EvalState&, nix::Env&, nix::Value&) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#34 0x00007ffff7cde83f in nix::ExprSelect::eval(nix::EvalState&, nix::Env&, nix::Value&) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#35 0x00007ffff7cdf879 in nix::ExprVar::eval(nix::EvalState&, nix::Env&, nix::Value&) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#36 0x00007ffff7cde83f in nix::ExprSelect::eval(nix::EvalState&, nix::Env&, nix::Value&) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#37 0x00007ffff7cda922 in nix::ExprCall::eval(nix::EvalState&, nix::Env&, nix::Value&) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#38 0x0000000000570ddd in void nix::EvalState::forceValue<nix::EvalState::forceValue(nix::Value&, nix::PosIdx)::{lambda()#1}>(nix::Value&, nix::EvalState::forceValue(nix::Value&, nix::PosIdx)::{lambda()#1}) ()
#39 0x00007ffff7cdec4d in nix::ExprSelect::eval(nix::EvalState&, nix::Env&, nix::Value&) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#40 0x00007ffff7cbc434 in nix::eval_cache::AttrCursor::forceValue() () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#41 0x00007ffff7cbce8b in nix::eval_cache::AttrCursor::maybeGetAttr(nix::Symbol, bool) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#42 0x00007ffff7cbdaa5 in nix::eval_cache::AttrCursor::maybeGetAttr(std::basic_string_view<char, std::char_traits<char> >) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#43 0x00007ffff7cc0d8f in nix::eval_cache::AttrCursor::isDerivation() () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixexpr.so
#44 0x00007ffff71a774c in nix::InstallableFlake::toDerivation[abi:cxx11]() () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixcmd.so
#45 0x00007ffff71a801b in nix::InstallableFlake::toDerivations() () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixcmd.so
#46 0x00007ffff719e918 in nix::InstallableValue::toDerivedPaths() () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixcmd.so
#47 0x00007ffff7197eef in nix::Installable::toDerivations(nix::ref<nix::Store>, std::vector<std::shared_ptr<nix::Installable>, std::allocator<std::shared_ptr<nix::Installable> > > const&, bool) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixcmd.so
#48 0x0000000000541d84 in Common::getShellOutPath(nix::ref<nix::Store>) ()
#49 0x000000000054c794 in Common::getBuildEnvironment[abi:cxx11](nix::ref<nix::Store>) ()
#50 0x000000000054cef1 in CmdDevelop::run(nix::ref<nix::Store>) ()
#51 0x00007ffff717f7a0 in nix::StoreCommand::run() () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixcmd.so
#52 0x00000000005a4df5 in nix::mainWrapped(int, char**) ()
#53 0x00007ffff7f38039 in nix::handleExceptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void ()>) () from /nix/store/nmq5zcd93qb1yskx42rs910ff0247nn2-nix-2.11.0/lib/libnixmain.so
#54 0x000000000046a5a6 in main ()
(gdb) 

Unfortunately I can’t spend any more time on this today but I hope this helps.