Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hydra-queue-runner: better error message if nix-store can not be started #632

Merged
merged 1 commit into from Jan 23, 2019

Conversation

nlewo
Copy link
Member

@nlewo nlewo commented Jan 22, 2019

The hydra-queue-runner opens a connection to the builder. If the
builder is 'localhost' it starts nix-store, otherwise it starts
'ssh'.

Currently, if the hydra-queue-runner can not start nix-store (not in
the PATH for instance), the error message is:

cannot connect to ‘localhost’: error: cannot start ssh: No such file
or directory

This is not useful since ssh is actually not started:/

With this patch the error message is now:

cannot connect to ‘localhost’: error: cannot start nix-store: No such file
or directory

@@ -66,7 +70,7 @@ static void openConnection(Machine::ptr machine, Path tmpDir, int stderrFD, Chil

execvp(argv.front().c_str(), (char * *) stringsToCharPtrs(argv).data()); // FIXME: remove cast

throw SysError("cannot start ssh");
throw SysError(format("cannot start %1%") % pgmName);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW it's shorter to write throw SysError("cannot start %s", pgmName).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx, applied.

The hydra-queue-runner opens a connection to the builder. If the
builder is 'localhost' it starts `nix-store`, otherwise it starts
'ssh'.

Currently, if the hydra-queue-runner can not start `nix-store` (not in
the PATH for instance), the error message is:

  cannot connect to ‘localhost’: error: cannot start ssh: No such file
  or directory

This is not useful since ssh is actually not started:/

With this patch the error message is now:

  cannot connect to ‘localhost’: error: cannot start nix-store: No such file
  or directory
@edolstra edolstra merged commit 5dd4736 into NixOS:master Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants