Project

General

Profile

Actions

action #154735

closed

[error in gru journal] DBIx::Class::Storage::DBI::select_single(): Query returned more than one row size:S

Added by tinita 11 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
Feature requests
Target version:
Start date:
2024-02-01
Due date:
% Done:

0%

Estimated time:

Description

Observation

In osd gru journal I can find several of those messages:

Jan 31 14:47:54 openqa openqa-gru[20400]: DBIx::Class::Storage::DBI::select_single(): Query returned more than one row.  SQL that returns multiple rows is DEPRECATED for ->find and ->single at /usr/share/openqa/script/../lib/OpenQA/Schema/Result/ScheduledProducts.pm line 707

The code is getting one row of the WORKER_CLASS settings from a job and its parent and then compares them:
https://github.com/os-autoinst/openQA/blob/master/lib/OpenQA/Schema/Result/ScheduledProducts.pm#L707-L711

                $worker_class = $job->settings->find({key => 'WORKER_CLASS'});
                $worker_class = $worker_class ? $worker_class->value : '';
            }
            my $parent_worker_class
              = $schema->resultset('JobSettings')->find({job_id => $parent, key => 'WORKER_CLASS'});

Not sure how that's supposed to work as the WORKER_CLASSes are in multiple rows. I assume it "works" because the first row is usually consistent because postgres orders by id by default?

Suggestions

Actions #1

Updated by okurz 11 months ago

  • Tags set to reactive work
  • Category set to Feature requests
  • Target version set to Tools - Next
Actions #2

Updated by okurz 10 months ago

  • Target version changed from Tools - Next to Ready
Actions #3

Updated by okurz 10 months ago

  • Priority changed from Normal to Low
Actions #4

Updated by okurz 10 months ago

  • Target version changed from Ready to Tools - Next
Actions #5

Updated by okurz 6 months ago

  • Target version changed from Tools - Next to Ready
Actions #6

Updated by okurz 6 months ago

  • Target version changed from Ready to Tools - Next
Actions #7

Updated by okurz 6 months ago

  • Target version changed from Tools - Next to Ready
Actions #8

Updated by tinita 5 months ago

  • Subject changed from [error in gru journal] DBIx::Class::Storage::DBI::select_single(): Query returned more than one row to [error in gru journal] DBIx::Class::Storage::DBI::select_single(): Query returned more than one row size:S
  • Description updated (diff)
  • Status changed from New to Workable
Actions #9

Updated by livdywan 5 months ago

  • Status changed from Workable to In Progress
  • Assignee set to livdywan

I'm taking a look.

Actions #10

Updated by livdywan 5 months ago

We're using the same logic in 2 places, so while thinking how to handle it I also drafted an attempt at unifying the code. Not sure this is exactly the best option but it enables testing out the result.

https://github.com/os-autoinst/openQA/pull/5822

Actions #11

Updated by livdywan 5 months ago

  • Status changed from In Progress to Workable

https://github.com/os-autoinst/openQA/pull/5822

The draft confirmed we should probably merge (copy) all worker classes. I didn't get to implement it yet however.

Actions #12

Updated by livdywan 3 months ago

  • Description updated (diff)
Actions #13

Updated by okurz 3 months ago

  • Assignee deleted (livdywan)
Actions #14

Updated by mkittler 3 months ago

  • Status changed from Workable to In Progress
  • Assignee set to mkittler
Actions #16

Updated by mkittler 3 months ago

  • Status changed from In Progress to Resolved

The PR has been merged; we'll definitely no longer see these kinds of warnings.

Actions

Also available in: Atom PDF