Project

General

Profile

Actions

action #179395

closed

coordination #154768: [saga][epic][ux] State-of-art user experience for openQA

coordination #157345: [epic] Improved test reviewer user experience

[beginner] ariel.suse-dmz.opensuse.org: »Can't call method "taskname" on an undefined value at template test/infopanel.html.ep line 49.« size:S

Added by nicksinger 9 days ago. Updated about 19 hours ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
Regressions/Crashes
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Observation

We received an e-mail from logwarn about the following errors:

[2025-03-24T08:27:26.368740Z] [error] [kLs_wpYg_yOq] Can't call method "taskname" on an undefined value at template test/infopanel.html.ep line 49.
Context:
  44:                         Result: <b><%= $job->result %></b>\
  45:                     % }
  46:                     % else {
  47:                         % my $state_detail = '';
  48:                         % if (my @gru_deps = $job->gru_dependencies) {
  49:                             % $state_detail = join(';', map { 'id: ' . $_->gru_task_id . ', name: ' . $_->gru_task->taskname } @gru_deps);
  50:                             % $state_detail = ", waiting for background tasks ($state_detail)";
  51:                         % }
  52:                         State: <b><%= $job->state %></b><%= $state_detail %>\
  53:                     % }
  54:                     % if ($job->t_finished) {
Traceback (most recent call first):
  File "template test/infopanel.html.ep", line 49, in "Mojo::Template::__ANON__"
…
  File "/usr/share/openqa/script/../lib/OpenQA/WebAPI/Controller/Test.pm", line 559, in "Mojolicious::Controller::render"
  File "/usr/share/openqa/script/../lib/OpenQA/WebAPI/Controller/Test.pm", line 538, in "OpenQA::WebAPI::Controller::Test::_show"
  File "/usr/lib/perl5/vendor_perl/5.26.1/Mojolicious.pm", line 193, in "OpenQA::WebAPI::Controller::Test::show"
…
  File "/usr/lib/perl5/vendor_perl/5.26.1/Mojolicious.pm", line 184, in "Mojolicious::Commands::run"
  File "/usr/share/openqa/script/../lib/OpenQA/WebAPI.pm", line 521, in "Mojolicious::start"
  File "/usr/share/openqa/script/openqa", line 23, in "OpenQA::WebAPI::run"

Acceptance Criteria

  • AC1: OpenQA job page does not result in a server error even if there is no gru_task for a gru_dependencies entry in the database
  • AC2: gru_dependencies is ensured to only have entries for still existing corresponding gru_task entries [checked]

Suggestions

  • The state where the job id had an entry in gru_dependencies but not in gru_task anymore lasted only for a moment. Currently the job is not in the gru_dependencies table anymore

Example

openqa=> select * from gru_dependencies limit 1;
 job_id  | gru_task_id 
---------+-------------
 4873132 |    21055332
(1 row)

openqa=> select * from gru_tasks where id=21055332;
    id    | taskname  |                                                                 args                                                                 |       run_at        | priority |      t_created    
  |      t_updated      
----------+-----------+--------------------------------------------------------------------------------------------------------------------------------------+---------------------+----------+-------------------
--+---------------------
 21055332 | git_clone | [{"\/var\/lib\/openqa\/share\/tests\/opensuse":null,"\/var\/lib\/openqa\/share\/tests\/opensuse\/products\/opensuse\/needles":null}] | 2025-02-21 13:10:59 |       10 | 2025-02-21 13:10:5
9 | 2025-02-21 13:10:59
(1 row)
Actions #1

Updated by okurz 8 days ago

  • Subject changed from ariel.suse-dmz.opensuse.org: »Can't call method "taskname" on an undefined value at template test/infopanel.html.ep line 49.« to [easy][beginner] ariel.suse-dmz.opensuse.org: »Can't call method "taskname" on an undefined value at template test/infopanel.html.ep line 49.«
Actions #2

Updated by okurz 8 days ago

  • Priority changed from Normal to Low
Actions #3

Updated by livdywan 7 days ago

  • Tags changed from o3, reactive work, alert to o3, reactive work, alert, beginner
Actions #4

Updated by okurz 6 days ago

  • Subject changed from [easy][beginner] ariel.suse-dmz.opensuse.org: »Can't call method "taskname" on an undefined value at template test/infopanel.html.ep line 49.« to [beginner] ariel.suse-dmz.opensuse.org: »Can't call method "taskname" on an undefined value at template test/infopanel.html.ep line 49.« size:S
  • Description updated (diff)
  • Status changed from New to Workable
Actions #5

Updated by okurz 6 days ago

  • Parent task set to #157345
Actions #6

Updated by tinita 6 days ago

  • Description updated (diff)

Now after the estimation it occurred to me that the explanation is quite easy:

my @gru_deps = $job->gru_dependencies

This is fetching all entries in gru_dependencies in one select.
Then in a loop it is fetching the entry in gru_tasks for each of the entries in another select, and this does not happen in a transaction.
But simply checking if $_->gru_task returns a defined value, otherwise skipping that iteration, will be enough.

Actions #7

Updated by tinita 6 days ago

  • Description updated (diff)
Actions #8

Updated by gpuliti 5 days ago

  • Status changed from Workable to In Progress
  • Assignee set to gpuliti
Actions #9

Updated by gpuliti 5 days ago

  • Status changed from In Progress to Feedback
Actions #10

Updated by gpuliti 2 days ago

  • Status changed from Feedback to In Progress
Actions #11

Updated by gpuliti 1 day ago

  • Status changed from In Progress to Workable
Actions #12

Updated by gpuliti 1 day ago

  • Status changed from Workable to In Progress
Actions #13

Updated by gpuliti about 19 hours ago

  • Status changed from In Progress to Resolved
Actions

Also available in: Atom PDF