Getting a build log from a remote builder?

Hello all,

At work we are using a remote builder for our nix needs. I’m looking for a reliable way to get the build log files from this remote builder (for any user, not just the one that requested the build). My situation is as follows:

  • The builder builds derivations fine.
  • The builder’s store seems accessible, ie, nix store ping --store ssh://builduser@buildserver returns OK.
  • Doing nix log .#myPackage will show the log for package myPackage, if and only if I was the (first one) to request that the build server build myPackage
  • According to the documentation for nix log, it is possible to query a remote store for a log: nix log - Nix Reference Manual using the --store parameter.
  • Running this in my case gives me an error message:
$ nix log --store ssh://builderuser@buildserver .#myPackage
error:
       … while fetching the input 'path:/home/me/my_package'

       error: operation 'addToStoreFromDump' is not supported by store 'ssh://builderuser@buildserver'

I feel like this final command should work, and that this is probably a bug, but I’m also not 100% confident that a remote builder is also (by default) a nix store that can be queried like this. Should I also set up builduser@buildserver as a binary cache?

Any help appreciated.

I’ve not solved this, but from a bit of poking around in the source code (rev b7e712, it seems that there’s only one place in the code from which this error is thrown, line 306 of src/libstore/binary-cache-store.cc:

StorePath BinaryCacheStore::addToStoreFromDump(Source & dump, std::string_view name,
    FileIngestionMethod method, HashType hashAlgo, RepairFlag repair, const StorePathSet & references)
{
    if (method != FileIngestionMethod::Recursive || hashAlgo != htSHA256)
        unsupported("addToStoreFromDump");

The error is triggered by a check on just two variables so it seems it is relatively easy to pin down. addToStoreFromDump is called from a number of places elsewhere in the code, though, and it’s not obvious to me where.