Master jobs failing with "RuntimeError: Node indexes are 0-based. Can't be higher or equal to the total number of nodes."
Summary
Builds that have parallel
set seem to be inconsistently getting CI_NODE_TOTAL
exposed. This is affecting static-analysis, jest and other jobs beyond rspec knapsack jobs as shown with https://gitlab.com/gitlab-org/gitlab/-/pipelines/169164045/failures.
-
✅ https://gitlab.com/gitlab-org/gitlab/-/jobs/649357895 -
❌ - https://gitlab.com/gitlab-org/gitlab/-/jobs/649357899#L62
https://gitlab.com/gitlab-org/gitlab-qa-mirror/-/pipelines/169106832/failures
https://gitlab.com/gitlab-org/gitlab-qa-mirror/-/jobs/649099962
A good portion of master jobs are failing with the error:
RuntimeError: Node indexes are 0-based. Can't be higher or equal to the total number of nodes.
Stack trace
bundler: failed to load command: bin/qa (bin/qa)
RuntimeError: Node indexes are 0-based. Can't be higher or equal to the total number of nodes.
/usr/local/bundle/gems/knapsack-1.18.0/lib/knapsack/distributors/base_distributor.rb:13:in `initialize'
/usr/local/bundle/gems/knapsack-1.18.0/lib/knapsack/allocator.rb:4:in `new'
/usr/local/bundle/gems/knapsack-1.18.0/lib/knapsack/allocator.rb:4:in `initialize'
/usr/local/bundle/gems/knapsack-1.18.0/lib/knapsack/allocator_builder.rb:9:in `new'
/usr/local/bundle/gems/knapsack-1.18.0/lib/knapsack/allocator_builder.rb:9:in `allocator'
/home/gitlab/qa/qa/specs/runner.rb:21:in `paths_from_knapsack'
/home/gitlab/qa/qa/specs/runner.rb:61:in `perform'
/home/gitlab/qa/qa/scenario/template.rb:10:in `block in perform'
/home/gitlab/qa/qa/scenario/template.rb:8:in `tap'
/home/gitlab/qa/qa/scenario/template.rb:8:in `perform'
/home/gitlab/qa/qa/scenario/template.rb:33:in `perform'
/home/gitlab/qa/qa/scenario/template.rb:10:in `block in perform'
/home/gitlab/qa/qa/scenario/template.rb:8:in `tap'
/home/gitlab/qa/qa/scenario/template.rb:8:in `perform'
/home/gitlab/qa/qa/scenario/bootable.rb:28:in `launch!'
bin/qa:7:in `<top (required)>'
Screenshot / HTML page
Possible fixes
Edited by Kyle Wiebers