!zghijEASpYQWYFzriI:nixos.org

Hydra

375 Members
109 Servers

Load older messages


SenderMessageTime
20 Sep 2024
@cleverca22:matrix.orgcleverca22
        <div class="page-header">500 Internal Server Error        </div>   <div class="alert alert-error">Caught exception in Hydra::View::NARInfo-&gt;process &quot;Can't locate object method &quot;readFile&quot; via package &quot;/etc/nix/keys/secret-key-file&quot; (perhaps you forgot to load &quot;/etc/nix/keys/secret-key-file&quot;?) at /nix/store/78qww3jbcnvbhw6xpfn7mc0bpph8ngx4-hydra-0.1.20240920.cc1b6d3/libexec/hydra/lib/Hydra/View/NARInfo.pm line 39.&quot;</div>

John Ericson applied that patch and upgraded hydra to 1 commit ahead of that branch, now the narinfo endpoint is broken instead

08:00:40
@cleverca22:matrix.orgcleverca22
--- a/src/lib/Hydra/View/NARInfo.pm
+++ b/src/lib/Hydra/View/NARInfo.pm
@@ -36,7 +36,7 @@ sub process {
     # Optionally, sign the NAR info file we just created.
     my $secretKeyFile = $c->config->{binary_cache_secret_key_file};
     if (defined $secretKeyFile) {
-        my $secretKey = readFile $secretKeyFile;
+        my $secretKey = readFile($secretKeyFile);
         my $fingerprint = fingerprintPath($storePath, $narHash, $narSize, $refs);
         my $sig = signString($secretKey, $fingerprint);
         $info .= "Sig: $sig\n";
08:51:37
@cleverca22:matrix.orgcleverca22i noticed, the function call here, is missing some parens08:51:44
@janne.hess:helsinki-systems.dedas_j
In reply to @cleverca22:matrix.org
i noticed, the function call here, is missing some parens
That's valid in Perl 🤡
09:01:20
@cleverca22:matrix.orgcleverca22
In reply to @janne.hess:helsinki-systems.de
That's valid in Perl 🤡
is it still valid in the latest version? has something changed?
what does the error mean exactly? why is it treating the secret key as a module?
09:17:48
@janne.hess:helsinki-systems.dedas_jreadFile is only in the c++ codebase09:49:04
@janne.hess:helsinki-systems.dedas_j

for reading a file, you would use:

use File::Slurper qw(read_text);
# …
read_text($secretKeyFile);
09:50:00
@janne.hess:helsinki-systems.dedas_j *

for reading a file in the perl codebase, you would use:

use File::Slurper qw(read_text);
# …
read_text($secretKeyFile);
09:50:09
@janne.hess:helsinki-systems.dedas_j *

for reading a file in the perl codebase, you would use:

use File::Slurper qw(read_text);
# …
my $secretKey = read_text($secretKeyFile);
09:50:31
@janne.hess:helsinki-systems.dedas_jI assume something went wrong here: https://github.com/NixOS/hydra/commit/b94a7b6d5c56362af9ea85d944f8454d861ec00109:52:18
@janne.hess:helsinki-systems.dedas_jBut there is no reason to use the nix function rather than the perl way of life09:52:29
@joerg:thalheim.ioMic92 cleverca22: https://github.com/NixOS/hydra/pull/1413 09:53:13
@cleverca22:matrix.orgcleverca22
In reply to @joerg:thalheim.io
cleverca22: https://github.com/NixOS/hydra/pull/1413
CI tests fail, still deploying on my end
10:04:02
@cleverca22:matrix.orgcleverca22 ( STDERR ) job 69 Can't locate File/Slurp.pm in @INC (you may need to install the File::Slurp module) 10:04:26
@joerg:thalheim.ioMic92 cleverca22: indeed John just imagined this function... It's also present in c++ 10:05:30
@joerg:thalheim.ioMic92in the nix code base10:05:33
@cleverca22:matrix.orgcleverca22https://github.com/NixOS/nix/blob/master/src/perl/lib/Nix/Utils.pm#L710:10:45
@cleverca22:matrix.orgcleverca22hmmm, readFile is part of Nix::Utils?10:11:09
@cleverca22:matrix.orgcleverca22oh, and narinfo doesnt import that now!?10:11:20
@cleverca22:matrix.orgcleverca22bingo, that got removed in a recent commit10:11:44
@joerg:thalheim.ioMic92 cleverca22: https://github.com/NixOS/hydra/pull/1413/files#diff-99bd8eee901b9b16f07b535be184e0d630739e79cb8678b8465e82ed54f2543aR42 10:14:28
@cleverca22:matrix.orgcleverca22yeah, thats a more portable solution10:14:54
@joerg:thalheim.ioMic92again relying on you for testing. Currently working on something else10:15:05
@joerg:thalheim.ioMic92ok ci fails again.10:21:43
@joerg:thalheim.ioMic92I might need to run this locally.10:21:48
@joerg:thalheim.ioMic92ok. linter error10:23:25
@joerg:thalheim.ioMic92My perl got very rusty.... I learned in the early 2000s10:25:14
@joerg:thalheim.ioMic92 cleverca22: so CI is green 10:42:03
@cleverca22:matrix.orgcleverca22 Caught exception in Hydra::View::NARInfo-&gt;process &quot;Undefined subroutine &amp;Hydra::View::NARInfo::signString called at /nix/store/vrph94x32fi58pjr00z4inx1yb69ql8f-hydra-0.1.20240920.1a2d201/libexec/hydra/lib/Hydra/View/NARInfo.pm line 42.&quot; 10:42:42
@cleverca22:matrix.orgcleverca22 when i fix the readFile a different way 10:42:48

Show newer messages


Back to Room ListRoom Version: 6