NixOS / hydra

Hydra, the Nix-based continuous build system
http://nixos.org/hydra
GNU General Public License v3.0
1.1k stars 291 forks source link

23.11 hydra compile error: 2 tests fail: hydra-create-user.t and hydra-init.t #1333

Closed qknight closed 6 months ago

qknight commented 6 months ago

Describe the bug I'm using nixos 23.11 on a dated t530 lenovo notebook with this configuration from the documentation:

services.hydra = {
  enable = true;
  hydraURL = "http://localhost:3000";
  notificationSender = "js@lastlog.de";
  buildMachinesFiles = [];
  useSubstitutes = true;
};
nix-channel --list
nixos https://nixos.org/channels/nixos-23.11

It needs to compile hydra, which usually should be a binary subsitute for reasons I don't understand.

( STDERR )  job 50      (in cleanup) {UNKNOWN}: DBI Exception: DBD::Pg::st DESTROY failed: no connection to the server [for Statement "SELECT me.project, me.jobset, me.name, me.type, me.emailresponsible FROM j
obsetinputs me WHERE ( ( me.jobset = ? AND me.project = ? ) )"]  at /nix/store/n0cm976fyqxc4l3gcb8sp940z5cnxlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Schema.pm line 1118.
( STDERR )  job 50      DBIx::Class::Schema::throw_exception(Hydra::Schema=HASH(0x7dd6e70), "DBI Exception: DBD::Pg::st DESTROY failed: no connection to t"...) called at /nix/store/n0cm976fyqxc4l3gcb8sp940z5cn
xlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Storage.pm line 113
( STDERR )  job 50      DBIx::Class::Storage::throw_exception(DBIx::Class::Storage::DBI::Pg=HASH(0x7e4c3c0), "DBI Exception: DBD::Pg::st DESTROY failed: no connection to t"...) called at /nix/store/n0cm976fyqx
c4l3gcb8sp940z5cnxlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Storage/DBI.pm line 1623
( STDERR )  job 50      DBIx::Class::Storage::DBI::__ANON__("DBD::Pg::st DESTROY failed: no connection to the server [for "..., DBI::st=HASH(0xabc97b8), undef) called at Hydra/Plugin/RunCommand/dynamic-disable
d.t line 0
( STDERR )  job 50      eval {...} called at Hydra/Plugin/RunCommand/dynamic-disabled.t line 0
( STDERR )  job 50    1:dynamic-enabled.t)
( PASSED )  job 50    Hydra/Plugin/RunCommand/dynamic-disabled.t
( PASSED )  job 51    Hydra/Plugin/RunCommand/dynamic-enabled.t
( PASSED )  job 53    Hydra/Plugin/RunCommand/fanout.t
( PASSED )  job 52    Hydra/Plugin/RunCommand/errno.t
( STDERR )  job 55      (in cleanup) {UNKNOWN}: DBI Exception: DBD::Pg::st DESTROY failed: no connection to the server [for Statement "SELECT me.build, me.name, me.path FROM buildoutputs me WHERE ( ( me.build
= ? AND me.name = ? ) )"]  at /nix/store/n0cm976fyqxc4l3gcb8sp940z5cnxlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Schema.pm line 1118.
( STDERR )  job 55      DBIx::Class::Schema::throw_exception(Hydra::Schema=HASH(0x4444fa8), "DBI Exception: DBD::Pg::st DESTROY failed: no connection to t"...) called at /nix/store/n0cm976fyqxc4l3gcb8sp940z5cn
xlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Storage.pm line 113
( STDERR )  job 55      DBIx::Class::Storage::throw_exception(DBIx::Class::Storage::DBI::Pg=HASH(0x44aea40), "DBI Exception: DBD::Pg::st DESTROY failed: no connection to t"...) called at /nix/store/n0cm976fyqx
c4l3gcb8sp940z5cnxlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Storage/DBI.pm line 1623
( STDERR )  job 55      DBIx::Class::Storage::DBI::__ANON__("DBD::Pg::st DESTROY failed: no connection to the server [for "..., DBI::st=HASH(0x4a19e18), undef) called at Hydra/Plugin/RunCommand/json.t line 0
( STDERR )  job 55      eval {...} called at Hydra/Plugin/RunCommand/json.t line 0
( STDERR )  job 55    m
( PASSED )  job 55    Hydra/Plugin/RunCommand/json.t
( PASSED )  job 56    Hydra/Plugin/RunCommand/matcher.t
( STDERR )  job 57    "my" variable $uri masks earlier declaration in same scope at Hydra/Plugin/gitea.t line 75.
( STDERR )  job 54      (in cleanup) {UNKNOWN}: DBI Exception: DBD::Pg::st DESTROY failed: FATAL:  terminating connection due to administrator command
( STDERR )  job 54    server closed the connection unexpectedly
( STDERR )  job 54      This probably means the server terminated abnormally
( STDERR )  job 54      before or while processing the request. [for Statement "SELECT me.id, me.uuid, me.job_matcher, me.build_id, me.command, me.start_time, me.end_time, me.error_number, me.exit_code, me.sig
nal, me.core_dumped FROM runcommandlogs me WHERE ( me.uuid = ? )"]  at /nix/store/n0cm976fyqxc4l3gcb8sp940z5cnxlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Schema.pm line 1118.
( STDERR )  job 54      DBIx::Class::Schema::throw_exception(Hydra::Schema=HASH(0x7dd47e8), "DBI Exception: DBD::Pg::st DESTROY failed: FATAL:  terminatin"...) called at /nix/store/n0cm976fyqxc4l3gcb8sp940z5cn
xlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Storage.pm line 113
( STDERR )  job 54      DBIx::Class::Storage::throw_exception(DBIx::Class::Storage::DBI::Pg=HASH(0x7e3d098), "DBI Exception: DBD::Pg::st DESTROY failed: FATAL:  terminatin"...) called at /nix/store/n0cm976fyqx
c4l3gcb8sp940z5cnxlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Storage/DBI.pm line 1623
( STDERR )  job 54      DBIx::Class::Storage::DBI::__ANON__("DBD::Pg::st DESTROY failed: FATAL:  terminating connection du"..., DBI::st=HASH(0xaf44c90), undef) called at Hydra/Plugin/RunCommand/http.t line 0
( STDERR )  job 54      eval {...} called at Hydra/Plugin/RunCommand/http.t line 0
( STDERR )  job 54    0m
( PASSED )  job 54    Hydra/Plugin/RunCommand/http.t
( STDERR )  job 57    127.0.0.1 - - [04/Jan/2024 09:59:06] "POST /gitea/api/v1/repos/root/foo/statuses/e35a5db678eba268aee5d1d5e48bf5558157564c HTTP/1.1" 200 -
( PASSED )  job 57    Hydra/Plugin/gitea.t
( PASSED )  job 58    Hydra/PostgresListener.t
( PASSED )  job 60    Hydra/Schema/Result/TaskRetries.t
( PASSED )  job 59    Hydra/Schema/Result/RunCommandLogs.t
( PASSED )  job 61    Hydra/Schema/ResultSet/TaskRetries.t
( STDERR )  job 63    error running bogus-channel hooks: Failing plugin. at Hydra/TaskDispatcher.t line 55.
( STDERR )  job 63    er.t)
( STDERR )  job 63    error running bogus-channel hooks: Failing plugin. at Hydra/TaskDispatcher.t line 55.
( STDERR )  job 63    er.t)
( STDERR )  job 63    No plugin named this-plugin-does-not-exist
( STDERR )  job 63    error running fail-event hooks: Failing plugin. at Hydra/TaskDispatcher.t line 55.
( STDERR )  job 63    er.t)
( STDERR )  job 63    error running fail-event hooks: Failing plugin. at Hydra/TaskDispatcher.t line 55.
( STDERR )  job 63    er.t)
( STDERR )  job 63    error running fail-event hooks: Failing plugin. at Hydra/TaskDispatcher.t line 55.
( STDERR )  job 63    er.t)
( PASSED )  job 63    Hydra/TaskDispatcher.t
( PASSED )  job 64    Hydra/View/TT.t
( STDERR )  job 62      (in cleanup) {UNKNOWN}: DBI Exception: DBD::Pg::st DESTROY failed: FATAL:  terminating connection due to administrator command
( STDERR )  job 62    server closed the connection unexpectedly
( STDERR )  job 62      This probably means the server terminated abnormally
( STDERR )  job 62      before or while processing the request. [for Statement "UPDATE users SET password = ? WHERE ( username = ? )"]  at /nix/store/n0cm976fyqxc4l3gcb8sp940z5cnxlgp-hydra-perl-deps/lib/perl5/
site_perl/5.38.0/DBIx/Class/Schema.pm line 1118.
( STDERR )  job 62      DBIx::Class::Schema::throw_exception(Hydra::Schema=HASH(0x434d3c8), "DBI Exception: DBD::Pg::st DESTROY failed: FATAL:  terminatin"...) called at /nix/store/n0cm976fyqxc4l3gcb8sp940z5cn
xlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Storage.pm line 113
( STDERR )  job 62      DBIx::Class::Storage::throw_exception(DBIx::Class::Storage::DBI::Pg=HASH(0x43ba1d0), "DBI Exception: DBD::Pg::st DESTROY failed: FATAL:  terminatin"...) called at /nix/store/n0cm976fyqx
c4l3gcb8sp940z5cnxlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Storage/DBI.pm line 1623
( STDERR )  job 62      DBIx::Class::Storage::DBI::__ANON__("DBD::Pg::st DESTROY failed: FATAL:  terminating connection du"..., DBI::st=HASH(0x48de8b0), undef) called at Hydra/Schema/Users.t line 0
( STDERR )  job 62      eval {...} called at Hydra/Schema/Users.t line 0
( STDERR )  job 62    t)
( STDERR )  job 62      (in cleanup) {UNKNOWN}: DBI Exception: DBD::Pg::st DESTROY failed: no connection to the server [for Statement "INSERT INTO users ( emailaddress, password, username) VALUES ( ?, ?, ? )"]
  at /nix/store/n0cm976fyqxc4l3gcb8sp940z5cnxlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Schema.pm line 1118.
( STDERR )  job 62      DBIx::Class::Schema::throw_exception(Hydra::Schema=HASH(0x434d3c8), "DBI Exception: DBD::Pg::st DESTROY failed: no connection to t"...) called at /nix/store/n0cm976fyqxc4l3gcb8sp940z5cn
xlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Storage.pm line 113
( STDERR )  job 62      DBIx::Class::Storage::throw_exception(DBIx::Class::Storage::DBI::Pg=HASH(0x43ba1d0), "DBI Exception: DBD::Pg::st DESTROY failed: no connection to t"...) called at /nix/store/n0cm976fyqx
c4l3gcb8sp940z5cnxlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Storage/DBI.pm line 1623
( STDERR )  job 62      DBIx::Class::Storage::DBI::__ANON__("DBD::Pg::st DESTROY failed: no connection to the server [for "..., DBI::st=HASH(0x487c090), undef) called at Hydra/Schema/Users.t line 0
( STDERR )  job 62      eval {...} called at Hydra/Schema/Users.t line 0
( STDERR )  job 62    t)
( PASSED )  job 62    Hydra/Schema/Users.t
( PASSED )  job 66    build-products.t
( STDERR )  job 65      (in cleanup) {UNKNOWN}: DBI Exception: DBD::Pg::st DESTROY failed: FATAL:  terminating connection due to administrator command
( STDERR )  job 65    server closed the connection unexpectedly
( STDERR )  job 65      This probably means the server terminated abnormally
( STDERR )  job 65      before or while processing the request. [for Statement "SELECT me.id, me.finished, me.timestamp, me.jobset_id, me.job, me.nixname, me.description, me.drvpath, me.system, me.license, me.
homepage, me.maintainers, me.maxsilent, me.timeout, me.ischannel, me.iscurrent, me.priority, me.globalpriority, me.starttime, me.stoptime, me.iscachedbuild, me.buildstatus, me.size, me.closuresize, me.releasen
ame, me.keep, me.notificationpendingsince FROM builds me  JOIN jobsets jobset ON jobset.id = me.jobset_id  JOIN projects project ON project.name = jobset.project WHERE ( ( iscurrent = ? AND job ILIKE ? AND job
set.hidden = ? AND project.hidden = ? ) ) ORDER BY jobset.project, jobset.name, job LIMIT ?"]  at /nix/store/n0cm976fyqxc4l3gcb8sp940z5cnxlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Schema.pm lin
e 1118.
( STDERR )  job 65      DBIx::Class::Schema::throw_exception(Hydra::Schema=HASH(0x7dea060), "DBI Exception: DBD::Pg::st DESTROY failed: FATAL:  terminatin"...) called at /nix/store/n0cm976fyqxc4l3gcb8sp940z5cn
xlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Storage.pm line 113
( STDERR )  job 65      DBIx::Class::Storage::throw_exception(DBIx::Class::Storage::DBI::Pg=HASH(0x7e52c78), "DBI Exception: DBD::Pg::st DESTROY failed: FATAL:  terminatin"...) called at /nix/store/n0cm976fyqx
c4l3gcb8sp940z5cnxlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Storage/DBI.pm line 1623
( STDERR )  job 65      DBIx::Class::Storage::DBI::__ANON__("DBD::Pg::st DESTROY failed: FATAL:  terminating connection du"..., DBI::st=HASH(0xabfa418), undef) called at api-test.t line 0
( STDERR )  job 65      eval {...} called at api-test.t line 0
( STDERR )  job 65    te-basic.t)
( PASSED )  job 65    api-test.tm
( PASSED )  job 67    evaluator/evaluate-basic.t
( PASSED )  job 68    evaluator/evaluate-constituents-broken.t
( STDERR )  job 69    finding garbage collector roots...
( STDERR )  job 69    error: Cannot delete path '/build/yath-3699-J056YE/tmp/YR7qiE/dBFV4iXff_/nix/store/nl44iixc77w0qrs90m4ghydgb8xjfc1r-empty-dir-A.drv' since it is still alive. To find out why, use: nix-sto
re --query --roots
( STDERR )  job 69    finding garbage collector roots...
( STDERR )  job 69    error: Cannot delete path '/build/yath-3699-J056YE/tmp/YR7qiE/dBFV4iXff_/nix/store/s82bqz097ag6yyczmc6i0nkl6lx49y18-direct_aggregate.drv' since it is still alive. To find out why, use: ni
x-store --query --roots
( STDERR )  job 69    finding garbage collector roots...
( STDERR )  job 69    error: Cannot delete path '/build/yath-3699-J056YE/tmp/YR7qiE/dBFV4iXff_/nix/store/62axxpycms093nnwkyc9xfq6fwqnfrvn-indirect_aggregate.drv' since it is still alive. To find out why, use:
nix-store --query --roots
( PASSED )  job 69    evaluator/evaluate-constituents-gc.t
( SKIPPED)  job 71    evaluator/evaluate-oom-job.t  -  `systemd-run` failed when invoked in this environment
( PASSED )  job 70    evaluator/evaluate-dependent-jobsets.t
( PASSED )  job 72    input-types/bzr-checkout.t
( PASSED )  job 73    input-types/bzr.t
( PASSED )  job 74    input-types/darcs.t
( PASSED )  job 76    input-types/git-rev.t
( PASSED )  job 75    input-types/deepgit.t
( PASSED )  job 78    input-types/hg.t
( PASSED )  job 77    input-types/git.t
( PASSED )  job 79    input-types/svn-checkout.t
( PASSED )  job 80    input-types/svn.t
( PASSED )  job 82    queue-runner/constituents.t
( PASSED )  job 81    queue-runner/build-locally-with-substitutable-path.t
( PASSED )  job 83    queue-runner/default-machine-file.t
( PASSED )  job 84    queue-runner/direct-indirect-constituents.t
( STDERR )  job 85    this derivation will be built:
( STDERR )  job 85      /build/yath-3699-J056YE/tmp/leGwQK/gRmB03vkxL/nix/store/rhk7vm5snqp835yvdka5garcd5vzx80w-can-be-substituted.drv
( STDERR )  job 85    building '/build/yath-3699-J056YE/tmp/leGwQK/gRmB03vkxL/nix/store/rhk7vm5snqp835yvdka5garcd5vzx80w-can-be-substituted.drv'...
( STDERR )  job 85    some outputuser.t)
( STDERR )  job 85    warning: you don't have Internet access; disabling some network-dependent features
( STDERR )  job 85    copying 1 paths...
( STDERR )  job 85    copying path '/build/yath-3699-J056YE/tmp/leGwQK/gRmB03vkxL/nix/store/f5nvy2fcvsrpdj342wg2wi7m5a2c7qk3-can-be-substituted' to 'file:///build/yath-3699-J056YE/tmp/leGwQK/dBFV4iXff_'...
( STDERR )  job 85    warning: you don't have Internet access; disabling some network-dependent features
( STDERR )  job 85    got build log for '/build/yath-3699-J056YE/tmp/leGwQK/gRmB03vkxL/nix/store/f5nvy2fcvsrpdj342wg2wi7m5a2c7qk3-can-be-substituted' from 'local'
( STDERR )  job 85    finding garbage collector roots...
( STDERR )  job 85    removing stale link from '/build/yath-3699-J056YE/tmp/leGwQK/gRmB03vkxL/nix/var/nix/gcroots/auto/fqldhfqlykrhjj24r385xps4p77z2gvi' to '/build/yath-3699-J056YE/tmp/leGwQK/gRmB03vkxL/basic-
canbesubstituted'
( STDERR )  job 85    deleting '/build/yath-3699-J056YE/tmp/leGwQK/gRmB03vkxL/nix/store/f5nvy2fcvsrpdj342wg2wi7m5a2c7qk3-can-be-substituted'
( STDERR )  job 85    deleting unused links...
( STDERR )  job 85    note: currently hard linking saves -0.00 MiB
( STDERR )  job 85    finding garbage collector roots...
( STDERR )  job 85    deleting garbage...[0m
( STDERR )  job 85    deleting '/build/yath-3699-J056YE/tmp/leGwQK/gRmB03vkxL/nix/store/rhk7vm5snqp835yvdka5garcd5vzx80w-can-be-substituted.drv'
( STDERR )  job 85    deleting '/build/yath-3699-J056YE/tmp/leGwQK/gRmB03vkxL/nix/store/62h9dv5fvdkvba26czkypfw0hpbsdrlc-empty-dir-builder.sh'
( STDERR )  job 85    deleting unused links...
( STDERR )  job 85    note: currently hard linking saves -0.00 MiB
( STDERR )  job 85    this path will be fetched (0.00 MiB download, 0.00 MiB unpacked):
( STDERR )  job 85      /build/yath-3699-J056YE/tmp/leGwQK/gRmB03vkxL/nix/store/f5nvy2fcvsrpdj342wg2wi7m5a2c7qk3-can-be-substituted
( STDERR )  job 85    copying path '/build/yath-3699-J056YE/tmp/leGwQK/gRmB03vkxL/nix/store/f5nvy2fcvsrpdj342wg2wi7m5a2c7qk3-can-be-substituted' from 'file:///build/yath-3699-J056YE/tmp/leGwQK/dBFV4iXff_'...
( STDERR )  job 85    warning: you don't have Internet access; disabling some network-dependent features
( STDERR )  job 85    error: build log of '/build/yath-3699-J056YE/tmp/leGwQK/gRmB03vkxL/nix/store/f5nvy2fcvsrpdj342wg2wi7m5a2c7qk3-can-be-substituted' is not available
( STDERR )  job 85    finding garbage collector roots...
( STDERR )  job 85    removing stale link from '/build/yath-3699-J056YE/tmp/leGwQK/gRmB03vkxL/nix/var/nix/gcroots/auto/fqldhfqlykrhjj24r385xps4p77z2gvi' to '/build/yath-3699-J056YE/tmp/leGwQK/gRmB03vkxL/basic-
canbesubstituted'
( STDERR )  job 85    deleting '/build/yath-3699-J056YE/tmp/leGwQK/gRmB03vkxL/nix/store/f5nvy2fcvsrpdj342wg2wi7m5a2c7qk3-can-be-substituted'
( STDERR )  job 85    deleting unused links...
( STDERR )  job 85    note: currently hard linking saves -0.00 MiB
( STDERR )  job 85    finding garbage collector roots...
( STDERR )  job 85    deleting garbage...[0m
( STDERR )  job 85    deleting '/build/yath-3699-J056YE/tmp/leGwQK/gRmB03vkxL/nix/store/rhk7vm5snqp835yvdka5garcd5vzx80w-can-be-substituted.drv'
( STDERR )  job 85    deleting '/build/yath-3699-J056YE/tmp/leGwQK/gRmB03vkxL/nix/store/62h9dv5fvdkvba26czkypfw0hpbsdrlc-empty-dir-builder.sh'
( STDERR )  job 85    deleting unused links...
( STDERR )  job 85    note: currently hard linking saves -0.00 MiB
( PASSED )  job 85    queue-runner/notifications.t
[  FAIL  ]  job 86  +~Handling password and password hash creation
< REASON >  job 86    Subtest failures were encountered (Count: 3)
[  FAIL  ]  job 86    +~Creating a user with a plain text password (insecure) stores the password securely
< REASON >  job 86    | No plan was declared
[  FAIL  ]  job 86    | + hydra-create-user should exit zero
[  DEBUG ]  job 86    | | scripts/hydra-create-user.t line 13
(  DIAG  )  job 86    | | +-----+----+-------+
(  DIAG  )  job 86    | | | GOT | OP | CHECK |
(  DIAG  )  job 86    | | +-----+----+-------+
(  DIAG  )  job 86    | | | -1  | eq | 0     |
(  DIAG  )  job 86    | | +-----+----+-------+
[  FAIL  ]  job 86    | + The user exists
(  DIAG  )  job 86    | | Failed test 'The user exists'
(  DIAG  )  job 86    | | at scripts/hydra-create-user.t line 17.
(  DIAG  )  job 86    | | Comparison matched (it should not).
            job 86    | ^
(  DIAG  )  job 86    | ----- START -----
Failed test 'Creating a user with a plain text password (insecure) stores the password securely'
at scripts/hydra-create-user.t line 23.
(  DIAG  )  job 86    | ------ END ------
(  DIAG  )  job 86    | Caught exception in subtest: Can't call method "password" on an undefined value at scripts/hydra-create-user.t line 18.
[  FAIL  ]  job 86    +~Creating a user with a sha1 password (still insecure) stores the password as a hashed sha1
< REASON >  job 86    | No plan was declared
[  FAIL  ]  job 86    | + hydra-create-user should exit zero
[  DEBUG ]  job 86    | | scripts/hydra-create-user.t line 27
(  DIAG  )  job 86    | | +-----+----+-------+
(  DIAG  )  job 86    | | | GOT | OP | CHECK |
(  DIAG  )  job 86    | | +-----+----+-------+
(  DIAG  )  job 86    | | | -1  | eq | 0     |
(  DIAG  )  job 86    | | +-----+----+-------+
[  FAIL  ]  job 86    | + The user exists
(  DIAG  )  job 86    | | Failed test 'The user exists'
(  DIAG  )  job 86    | | at scripts/hydra-create-user.t line 30.
(  DIAG  )  job 86    | | Comparison matched (it should not).
            job 86    | ^
(  DIAG  )  job 86    | ----- START -----
Failed test 'Creating a user with a sha1 password (still insecure) stores the password as a hashed sha1'
at scripts/hydra-create-user.t line 36.
(  DIAG  )  job 86    | ------ END ------
(  DIAG  )  job 86    | Caught exception in subtest: Can't call method "password" on an undefined value at scripts/hydra-create-user.t line 31.
[  FAIL  ]  job 86    +~Creating a user by prompting for the password
< REASON >  job 86    | Subtest failures were encountered (Count: 1)
[  FAIL  ]  job 86    | +~with the same password twice
< REASON >  job 86    | | No plan was declared
[  FAIL  ]  job 86    | | + hydra-create-user should exit zero
[  DEBUG ]  job 86    | | | scripts/hydra-create-user.t line 54
(  DIAG  )  job 86    | | | +-----+----+-------+
(  DIAG  )  job 86    | | | | GOT | OP | CHECK |
(  DIAG  )  job 86    | | | +-----+----+-------+
(  DIAG  )  job 86    | | | | -1  | eq | 0     |
(  DIAG  )  job 86    | | | +-----+----+-------+
[  FAIL  ]  job 86    | | + The user exists
(  DIAG  )  job 86    | | | ----- START -----
Failed test 'The user exists'
at scripts/hydra-create-user.t line 57.
(  DIAG  )  job 86    | | | ------ END ------
(  DIAG  )  job 86    | | | Comparison matched (it should not).
            job 86    | | ^
(  DIAG  )  job 86    | | ----- START -----
Failed test 'with the same password twice'
at scripts/hydra-create-user.t line 62.
(  DIAG  )  job 86    | | ------ END ------
(  DIAG  )  job 86    | | Caught exception in subtest: Can't call method "password" on an undefined value at scripts/hydra-create-user.t line 58.
            job 86    | ^
(  DIAG  )  job 86    | ----- START -----
Failed test 'Creating a user by prompting for the password'
at scripts/hydra-create-user.t line 68.
(  DIAG  )  job 86    | ------ END ------
            job 86    ^
(  DIAG  )  job 86    ----- START -----
Failed test 'Handling password and password hash creation'
at scripts/hydra-create-user.t line 91.
(  DIAG  )  job 86    ------ END ------
(  DIAG  )  job 86    Seeded srand with seed '20240104' from local date.
( FAILED )  job 86    scripts/hydra-create-user.t
< REASON >  job 86    Test script returned error (Err: 1)
< REASON >  job 86    Errors were encountered (Count: 1)
< REASON >  job 86    Assertion failures were encountered (Count: 1)
< REASON >  job 86    Subtest failures were encountered (Count: 1)
( PASSED )  job 87    scripts/hydra-eval-jobset/notifications.t
( PASSED )  job 89    scripts/hydra-send-stats.t
[  FAIL  ]  job 88  +~hydra-init upgrades user's password hashes from sha1 to sha1 inside Argon2
< REASON >  job 88    Subtest failures were encountered (Count: 1)
[  FAIL  ]  job 88    + <UNNAMED ASSERTION>
[  DEBUG ]  job 88    | scripts/hydra-init.t line 34
(  DIAG  )  job 88    | ----- START -----
+--------------------------------------+----+-------+
| GOT                                  | OP | CHECK |
+--------------------------------------+----+-------+
| upgrading user passwords from sha1\n | eq |       |
|  * alice\n                           |    |       |
| timeout\n                            |    |       |
+--------------------------------------+----+-------+
(  DIAG  )  job 88    | ------ END ------
[  FAIL  ]  job 88    + hydra-init should exit zero
[  DEBUG ]  job 88    | scripts/hydra-init.t line 36
(  DIAG  )  job 88    | +-----+----+-------+
(  DIAG  )  job 88    | | GOT | OP | CHECK |
(  DIAG  )  job 88    | +-----+----+-------+
(  DIAG  )  job 88    | | -1  | eq | 0     |
(  DIAG  )  job 88    | +-----+----+-------+
[  FAIL  ]  job 88    +~Alice had their password updated in place
[  FAIL  ]  job 88    | + The password was updated in place.
(  DIAG  )  job 88    | | ----- START -----
Failed test 'The password was updated in place.'
at scripts/hydra-init.t line 41.
(  DIAG  )  job 88    | | ------ END ------
(  DIAG  )  job 88    | | Comparison matched (it should not).
            job 88    | ^
(  DIAG  )  job 88    | ----- START -----
Failed test 'Alice had their password updated in place'
at scripts/hydra-init.t line 46.
(  DIAG  )  job 88    | ------ END ------
            job 88    ^
(  DIAG  )  job 88    ----- START -----
Failed test 'hydra-init upgrades user's password hashes from sha1 to sha1 inside Argon2'
at scripts/hydra-init.t line 68.
(  DIAG  )  job 88    ------ END ------
(  DIAG  )  job 88    Seeded srand with seed '20240104' from local date.
( STDERR )  job 88      (in cleanup) {UNKNOWN}: DBI Exception: DBD::Pg::st DESTROY failed: FATAL:  terminating connection due to administrator command
( STDERR )  job 88    server closed the connection unexpectedly
( STDERR )  job 88      This probably means the server terminated abnormally
( STDERR )  job 88      before or while processing the request. [for Statement "SELECT me.username, me.fullname, me.emailaddress, me.password, me.emailonerror, me.type, me.publicdashboard FROM users me WHERE (
 me.username = ? )"]  at /nix/store/n0cm976fyqxc4l3gcb8sp940z5cnxlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Schema.pm line 1118.
( STDERR )  job 88      DBIx::Class::Schema::throw_exception(Hydra::Schema=HASH(0x4310d10), "DBI Exception: DBD::Pg::st DESTROY failed: FATAL:  terminatin"...) called at /nix/store/n0cm976fyqxc4l3gcb8sp940z5cn
xlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Storage.pm line 113
( STDERR )  job 88      DBIx::Class::Storage::throw_exception(DBIx::Class::Storage::DBI::Pg=HASH(0x43d1b90), "DBI Exception: DBD::Pg::st DESTROY failed: FATAL:  terminatin"...) called at /nix/store/n0cm976fyqx
c4l3gcb8sp940z5cnxlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Storage/DBI.pm line 1623
( STDERR )  job 88      DBIx::Class::Storage::DBI::__ANON__("DBD::Pg::st DESTROY failed: FATAL:  terminating connection du"..., DBI::st=HASH(0x490c008), undef) called at scripts/hydra-init.t line 0
( STDERR )  job 88      eval {...} called at scripts/hydra-init.t line 0
( STDERR )  job 88    e-gc-roots.t)
( STDERR )  job 88      (in cleanup) {UNKNOWN}: DBI Exception: DBD::Pg::st DESTROY failed: no connection to the server [for Statement "UPDATE users SET password = ? WHERE ( username = ? )"]  at /nix/store/n0cm
976fyqxc4l3gcb8sp940z5cnxlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Schema.pm line 1118.
( STDERR )  job 88      DBIx::Class::Schema::throw_exception(Hydra::Schema=HASH(0x4310d10), "DBI Exception: DBD::Pg::st DESTROY failed: no connection to t"...) called at /nix/store/n0cm976fyqxc4l3gcb8sp940z5cn
xlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Storage.pm line 113
( STDERR )  job 88      DBIx::Class::Storage::throw_exception(DBIx::Class::Storage::DBI::Pg=HASH(0x43d1b90), "DBI Exception: DBD::Pg::st DESTROY failed: no connection to t"...) called at /nix/store/n0cm976fyqx
c4l3gcb8sp940z5cnxlgp-hydra-perl-deps/lib/perl5/site_perl/5.38.0/DBIx/Class/Storage/DBI.pm line 1623
( STDERR )  job 88      DBIx::Class::Storage::DBI::__ANON__("DBD::Pg::st DESTROY failed: no connection to the server [for "..., DBI::st=HASH(0x48ed858), undef) called at scripts/hydra-init.t line 0
( STDERR )  job 88      eval {...} called at scripts/hydra-init.t line 0
( STDERR )  job 88    e-gc-roots.t)
( FAILED )  job 88    scripts/hydra-init.t
< REASON >  job 88    Test script returned error (Err: 1)
< REASON >  job 88    Errors were encountered (Count: 1)
< REASON >  job 88    Assertion failures were encountered (Count: 1)
< REASON >  job 88    Subtest failures were encountered (Count: 1)
( PASSED )  job 90    scripts/hydra-update-gc-roots/update-gc-roots.t
32mP:88|F:2|R:0|T:0] Events: 2958
The following jobs failed:
+------------------------+------------------------+------------------------+
| Job ID                 | Test File              | Subtests               |
+------------------------+------------------------+------------------------+
| 4BD88020-AAE6-11EE-808 | scripts/hydra-create-u | Handling password and  |
| 9-E7910E8479EE         | ser.t                  | password hash creation |
|                        |                        | Handling password and  |
|                        |                        | password hash creation |
|                        |                        |  -> Creating a user wi |
|                        |                        | th a plain text passwo |
|                        |                        | rd (insecure) stores t |
|                        |                        | he password securely   |
|                        |                        | Handling password and  |
|                        |                        | password hash creation |
|                        |                        |  -> Creating a user wi |
|                        |                        | th a sha1 password (st |
|                        |                        | ill insecure) stores t |
|                        |                        | he password as a hashe |
|                        |                        | d sha1                 |
|                        |                        | Handling password and  |
|                        |                        | password hash creation |
|                        |                        |  -> Creating a user by |
|                        |                        |  prompting for the pas |
|                        |                        | sword                  |
|                        |                        | Handling password and  |
|                        |                        | password hash creation |
|                        |                        |  -> Creating a user by |
|                        |                        |  prompting for the pas |
|                        |                        | sword -> with the same |
|                        |                        |  password twice        |
|                        |                        |                        |
| 4BD8A44C-AAE6-11EE-808 | scripts/hydra-init.t   | hydra-init upgrades us |
| 9-E7910E8479EE         |                        | er's password hashes f |
|                        |                        | rom sha1 to sha1 insid |
|                        |                        | e Argon2               |
|                        |                        | hydra-init upgrades us |
|                        |                        | er's password hashes f |
|                        |                        | rom sha1 to sha1 insid |
|                        |                        | e Argon2 -> Alice had  |
|                        |                        | their password updated |
|                        |                        |  in place              |
+------------------------+------------------------+------------------------+

                                    Yath Result Summary
-------------------------------------------------------------------------------------------
     Fail Count: 2
     File Count: 90
Assertion Count: 1392
      Wall Time: 1121.04 seconds
       CPU Time: 2138.57 seconds (usr: 7.50s | sys: 1.38s | cusr: 1774.83s | csys: 354.86s)
      CPU Usage: 190%
    -->  Result: FAILED  <--

1..1
not ok 1 - Passed tests when run by yath
yath exited with 256FAIL: test.pl
===================
1 of 2 tests failed
===================
make[2]: *** [Makefile:354: check-TESTS] Error 1
make[2]: Leaving directory '/build/source/t'
make[1]: *** [Makefile:480: check-am] Error 2
make[1]: Leaving directory '/build/source/t'
make: *** [Makefile:422: check-recursive] Error 1
error: builder for '/nix/store/f6lfb5617dfr245a7y1da7dqw9s8sa88-hydra-2023-11-17.drv' failed with exit code 2
error: 1 dependencies of derivation '/nix/store/7yylrncz0l8f55fb5sijiwllrara3q6m-hydra-env.drv' failed to build
error: 1 dependencies of derivation '/nix/store/wr1ii3ayjh97mcnkf2bxrcwmlqac5g8y-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/cswg50ziw719mcxag9blys3falv733fk-unit-hydra-evaluator.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/rn4d3a8gpmc2g3wpdxxrxzv4ckrx0isv-unit-hydra-init.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/f72v3qwjf2qshlan4y7yrg17wgd7sbv8-unit-hydra-notify.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/k60zm2kj4b6blbxymp8fl3y8ghzzpc9h-unit-hydra-queue-runner.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/mshdgaln08sx833r7i6jbf46fmnsqkzj-unit-hydra-send-stats.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/kd0cxsdgxqf1sc9q7y5db3ag5ijla6pi-unit-hydra-server.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/iqp5yypw0qj47r8fx6mkxw1p8gawyycx-unit-hydra-update-gc-roots.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/sh5zf3fhis12z7rkpdw76f3nl9j5pvj5-X-Restart-Triggers-polkit.drv' failed to build
error: 1 dependencies of derivation '/nix/store/vyhm6g7avci378d77bw8l65rn747mqfs-dbus-1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/fgi4378a7744s7ccgrkfa6bx2qwcqv7n-X-Restart-Triggers-dbus.drv' failed to build
error: 1 dependencies of derivation '/nix/store/kymly0a3r1riqnfbqdm7ckkrka0d05yy-unit-polkit.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/629fyzc76pavl8pdzarag6s50l5yygxj-unit-dbus.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/k89nrssx2wm8y5f1y7bb4fy7x2zhwarm-unit-dbus.service.drv' failed to build
error: 9 dependencies of derivation '/nix/store/iiahdavgqfxlhslvv7dgr6rm6w2mdh73-system-units.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ya6pv5657bz02k62j8hwq37wcwxhqn8p-user-units.drv' failed to build
error: 4 dependencies of derivation '/nix/store/jd63rxvbn1bqbl7b9130d78hn0b58srr-etc.drv' failed to build
error: 2 dependencies of derivation '/nix/store/xrfqr78pq4zs29p3kgy56d65qha6h1ks-nixos-system-nixos-thinkpad-t530-23.11.2451.2d2ea8eab9e4.drv' failed to build

To Reproduce Don't know how.

Expected behavior I expected that hydra subsitute would be downloaded and hydra would be started on my NixOS 23.11 installation.

Hydra Server:

Please fill out this data as well as you can, but don't worry if you can't -- just do your best.

Ma27 commented 6 months ago

I assume that this is the NixOS module and Hydra package from nixpkgs?

In fact, I could reproduce this issue on my Hydra fork, but merging in Hydra master fixed the issue. The following merge did the trick: https://github.com/Ma27/hydra/commit/cfcd6b6d5a099776a45a7eca06f4534edfe9aa7f

I assume that https://github.com/Ma27/hydra/commit/cfcd6b6d5a099776a45a7eca06f4534edfe9aa7f#diff-8e49a5c05bb74b6d179f6a5568f4e22334dd24bec14495ea4052c4e01146d916 is related.

Anyways, if that's the case then this is a nixpkgs bug because the Hydra "version" is too old.

qknight commented 6 months ago

@Ma27 so far I can't get the version you pointed out to run:

  nixpkgs.overlays = [(final: prev:  {
    hydra_unstable = prev.hydra_unstable.overrideAttrs {
      src = pkgs.fetchFromGitHub {
        owner = "NixOS";
        repo = "hydra";
        rev = "cfcd6b6d5a099776a45a7eca06f4534edfe9aa7f";
        hash = "sha256-6jUNlUr67snI3WijkVZcODxkjT/UxeqC3z0CQY4hrfs=";
      };
    };
    }
  )];

Fails with:

config.status: executing executable-scripts commands
building
build flags: -j2 SHELL=/nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15/bin/bash
make  all-recursive
make[1]: Entering directory '/build/source'
Making all in src
make[2]: Entering directory '/build/source/src'
Making all in hydra-evaluator
make[3]: Entering directory '/build/source/src/hydra-evaluator'
g++ -DHAVE_CONFIG_H -I. -I../..    -std=c++2a -I/nix/store/2iqsv9phqnxl4vqgcci7plr2v7c3k6y8-nix-2.17.1-dev/include/nix -I/nix/store/xyhqn7mhfkzkx58dw74xlxi5fx765df9-boehm-gc-8.2.2-dev/include -Wall -I ../libhydra -Wno-deprecated-declarations -g -O2 -include nix/config.h -c -o hydra_evaluator-hydra-evaluator.o `test -f 'hydra-evaluator.cc' || echo './'`hydra-evaluator.cc
In file included from hydra-evaluator.cc:1:
../libhydra/db.hh:5:10: fatal error: environment-variables.hh: No such file or directory
    5 | #include "environment-variables.hh"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [Makefile:443: hydra_evaluator-hydra-evaluator.o] Error 1
make[3]: Leaving directory '/build/source/src/hydra-evaluator'
make[2]: *** [Makefile:363: all-recursive] Error 1
make[2]: Leaving directory '/build/source/src'
make[1]: *** [Makefile:422: all-recursive] Error 1
make[1]: Leaving directory '/build/source'
make: *** [Makefile:350: all] Error 2
error: builder for '/nix/store/y4hdffacnqkrax8pj21sgz0wkl9anhzv-hydra-2023-11-17.drv' failed with exit code 2
error: 1 dependencies of derivation '/nix/store/m3jr6l9pkmdapkjqarzjiiwvp8iwyn9x-hydra-env.drv' failed to build
error: 1 dependencies of derivation '/nix/store/6q584dq7x8ipnvx9zs4gr7r74zj4y9fb-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/bk6z1lmdpkhdibn2inpjg41an50fi8dq-unit-hydra-evaluator.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/v73pydz30jb8gqmbmnzv7x04xczv54q3-unit-hydra-init.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/93nyimzg3l9gzj5d9vxkhxqv784v2vr5-unit-hydra-notify.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/5v59jr6qij0d9sachhg2a9nkmz2a7xdc-unit-hydra-queue-runner.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/zp4ifspcqhv5g60p7ydlwvb58sc14415-unit-hydra-send-stats.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/31xrhnzm5hh7fi05y0p3xm33gzxnr3qc-unit-hydra-server.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/kpzhvdw5ibsgm6hhq0dsp1shv8gdd83m-unit-hydra-update-gc-roots.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/gvrayyc9ayfgrrr63vpwzg2wi47gw33x-nixos-system-nixos-thinkpad-t530-23.11.2451.2d2ea8eab9e4.drv' failed to build

How to use hydra then? Should I use the hydra flake instead?

Ma27 commented 6 months ago

Fails with:

Oh sorry I forgot to mention that (because I had the exact same error as well on my upgrade journey). That's because the Hydra master is only compatible with the API from Nix 2.19. I built Hydra against 2.19 and then it worked fine for me.

How to use hydra then? Should I use the hydra flake instead?

That's what I'm doing these days.

Alternatively, Hydra on nixpkgs master seems to build fine, so you may want to request a backport to 23.11 for it (it'll also need 2.19 most likely, but I took care of that backport already in https://github.com/NixOS/nixpkgs/pull/279184#pullrequestreview-1807498750).

EDIT: upon taking a closer look I just realized that I can build /nix/store/f6lfb5617dfr245a7y1da7dqw9s8sa88-hydra-2023-11-17.drv just fine now oO I must say I'm a little confused now.

qknight commented 6 months ago

I can't imagine that on nixpkgs 23.11 release, the hydra in nixpkgs would have been released while still failing.

I update the nix-channel once more but still can't build it.

qknight commented 6 months ago

@Ma27 If you backport nix 2.19, this also means that we have to rebuild basically the complete OS, right? Or are you only using a different version for hydra then?

Something else I was considering, maybe we can get a previous version going instead, what do you think?

qknight commented 6 months ago

With nix 2.19 and the https://github.com/Ma27/hydra/commit/cfcd6b6d5a099776a45a7eca06f4534edfe9aa7f I get this now:

all fail

could this be a race condition because my machine is slow?!

nix and hydra updates


{ config, pkgs, lib, callPackage, ... }:
{
  nixpkgs.overlays = [(final: prev:  {
    # cp -r pkgs/tools/package-management/nix/* /etc/nixos/nix
    # extend with nix_2_19
    #  nix_2_19 = prev.nix.common {
    #    version = "2.19.2";
    #    hash = "sha256-iA8DqS+W2fWTfR+nNJSvMHqQ+4NpYMRT3b+2zS6JTvE=";
    #  };

    nixVersions = lib.recurseIntoAttrs (pkgs.callPackage /etc/nixos/nix {
      storeDir = config.nix.storeDir or "/nix/store";
      stateDir = config.nix.stateDir or "/nix/var";
      inherit (prev.darwin.apple_sdk.frameworks) Security;
    });
    # nixos/modules/services/continuous-integration/hydra/default.nix
    hydra_unstable_2_19 = final.hydra_unstable_cfcd.override { nix = final.nixVersions.nix_2_19; };
    hydra_unstable_cfcd = prev.hydra_unstable.overrideAttrs {
      src = pkgs.fetchFromGitHub {
        owner = "NixOS";
        repo = "hydra";
        rev = "cfcd6b6d5a099776a45a7eca06f4534edfe9aa7f";
        hash = "sha256-6jUNlUr67snI3WijkVZcODxkjT/UxeqC3z0CQY4hrfs=";
      };
    };
    }
  )];

And for the service

 services.hydra = {
    enable = true;
    hydraURL = "http://localhost:3000";
    notificationSender = "js@lastlog.de";
    buildMachinesFiles = [];
    useSubstitutes = true;
    package = pkgs.hydra_unstable_2_19;
  };

It was really hard to figure out how to get override/overrideAttrs work in conjunction and how to copy the nix source code so i can add the 2.19 version.

qknight commented 6 months ago

@Ma27 thanks for your help. I updated to nixos-unstable now.

Ma27 commented 5 months ago

If you backport nix 2.19, this also means that we have to rebuild basically the complete OS, right?

The default Nix version won't be touched on a stable release. And even if that'd be the case, that won't cause a full rebuild, not every package depends on Nix.

could this be a race condition because my machine is slow?!

Yes, a few other tests are racy. That's why I usually hit restart when building Hydra on my Hydra for a few times 😅 The failure above was new and reproducible even on my laptop (the other errors usually happen on my builders with a few mroe cores).

It's kinda unfortunate that we don't exactly know what's up there, right? The .drv you provided above was buildable for me even though I could reliably reproduce the errors on my own fork. I don't really have the time right now to dive into it, but I guess that should be fine given that it's buildable for you now :)