Project

General

Profile

Actions

action #99327

closed

openqa-webui-daemon: DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::Pg::st execute failed: ERROR: syntax error at or near "AND"

Added by dawei_pang about 3 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
Urgent
Assignee:
Category:
Regressions/Crashes
Target version:
Start date:
2021-09-27
Due date:
2021-10-12
% Done:

0%

Estimated time:

Description

On openSUSE Leap15.3, upgrading openQA (webUI) to openQA-4.6.1632469706.fbd7c8362-lp153.4422.1.noarch, when restart an old job, the openQA webUI report "Unable to restart job.", and find some error information in syslog as following:

Sep 27 10:52:35 openqaweb openqa-webui-daemon[26069]: Use of uninitialized value in join or string at /usr/lib/perl5/vendor_perl/5.26.1/SQL/Abstract/Classic.pm line 1386.
Sep 27 10:52:35 openqaweb openqa-webui-daemon[26069]: [error] [Gy-cbZc0KfOV] DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::Pg::st execute failed: ERROR:  syntax error at or near "AND"
Sep 27 10:52:35 openqaweb openqa-webui-daemon[26069]: LINE 1: ...t_created, me.t_updated FROM assets me WHERE ( (  AND size i...
Sep 27 10:52:35 openqaweb openqa-webui-daemon[26069]:                                                              ^ [for Statement "SELECT me.id, me.type, me.name, me.size, me.checksum, me.last_use_job_id, me.fixed, me.t_created, me.t_updated FROM assets me WHERE ( (  AND size is not null ) )"] at /usr/share/openqa/script/../lib/OpenQA/Schema/Result/Jobs.pm line 592
Sep 27 10:52:52 openqaweb openqa-webui-daemon[26044]: Use of uninitialized value in join or string at /usr/lib/perl5/vendor_perl/5.26.1/SQL/Abstract/Classic.pm line 1386.
Sep 27 10:52:52 openqaweb openqa-webui-daemon[26044]: [error] [RzPx-HJfyCfQ] DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::Pg::st execute failed: ERROR:  syntax error at or near "AND"
Sep 27 10:52:52 openqaweb openqa-webui-daemon[26044]: LINE 1: ...t_created, me.t_updated FROM assets me WHERE ( (  AND size i...
Sep 27 10:52:52 openqaweb openqa-webui-daemon[26044]:                                                              ^ [for Statement "SELECT me.id, me.type, me.name, me.size, me.checksum, me.last_use_job_id, me.fixed, me.t_created, me.t_updated FROM assets me WHERE ( (  AND size is not null ) )"] at /usr/share/openqa/script/../lib/OpenQA/Schema/Result/Jobs.pm line 592
Sep 27 10:52:59 openqaweb openqa-webui-daemon[26053]: Use of uninitialized value in join or string at /usr/lib/perl5/vendor_perl/5.26.1/SQL/Abstract/Classic.pm line 1386.
Sep 27 10:52:59 openqaweb openqa-webui-daemon[26053]: [error] [9KkKZ89W758I] DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::Pg::st execute failed: ERROR:  syntax error at or near "AND"
Sep 27 10:52:59 openqaweb openqa-webui-daemon[26053]: LINE 1: ...t_created, me.t_updated FROM assets me WHERE ( (  AND size i...
Sep 27 10:52:59 openqaweb openqa-webui-daemon[26053]:                                                              ^ [for Statement "SELECT me.id, me.type, me.name, me.size, me.checksum, me.last_use_job_id, me.fixed, me.t_created, me.t_updated FROM assets me WHERE ( (  AND size is not null ) )"] at /usr/share/openqa/script/../lib/OpenQA/Schema/Result/Jobs.pm line 592

The followed changes make restart job work, but only as workaround.

--- a/lib/OpenQA/Schema/Result/Jobs.pm
+++ b/lib/OpenQA/Schema/Result/Jobs.pm
@@ -588,8 +588,9 @@ sub missing_assets {
             name => {-in => _compute_asset_names_considering_parent_jobs($parent_job_ids, $_->{name})},
         }
     } @relevant_assets;
-    my $assets          = $self->result_source->schema->resultset('Assets');
-    my @existing_assets = $assets->search({-or => \@assets_query, size => \'is not null'});
+    #my $assets          = $self->result_source->schema->resultset('Assets');
+    #my @existing_assets = $assets->search({-or => \@assets_query, size => \'is not null'});
+    my @existing_assets = $self->result_source->schema->resultset('Assets')->search(\@assets_query);
     return [] if scalar @$parent_job_ids == 0 && scalar @assets_query == scalar @existing_assets;
     my %missing_assets = map { ("$_->{type}/$_->{name}" => 1) } @relevant_assets;
     delete $missing_assets{$_->type . '/' . _strip_parent_job_id($parent_job_ids, $_->name)} for @existing_assets;
Actions #1

Updated by dawei_pang about 3 years ago

  • Description updated (diff)
Actions #2

Updated by dawei_pang about 3 years ago

  • Project changed from 208 to openQA Project
Actions #3

Updated by dawei_pang about 3 years ago

  • Subject changed from DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::Pg::st execute failed: ERROR: syntax error at or near "AND" to openqa-webui-daemon: DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::Pg::st execute failed: ERROR: syntax error at or near "AND"
Actions #4

Updated by okurz about 3 years ago

  • Category set to Regressions/Crashes
  • Priority changed from High to Urgent
  • Target version set to Ready
Actions #5

Updated by livdywan about 3 years ago

  • Assignee set to Xiaojing_liu

As discussed in the daily, Jane will try to clarify what the issue is/how to reproduce it and update the ticket so we can estimate it

Actions #6

Updated by mkittler about 3 years ago

Which PostgreSQL version is used here (e.g. what is the output of psql openqa -c 'select version();')? Does it happen under Leap 15.2 or TW as well?

Actions #7

Updated by mkittler about 3 years ago

Maybe the problem is that @assets_query is empty in your case (and DBIx cannot deal with that case).

Actions #8

Updated by dawei_pang about 3 years ago

mkittler wrote:

Which PostgreSQL version is used here (e.g. what is the output of psql openqa -c 'select version();')? Does it happen under Leap 15.2 or TW as well?

#psql --version
psql (PostgreSQL) 13.2

This is the first time to run openQA-4.6.163 on Leap15.3 since its compiling issue just fixed, openQA-4.6.162 works well without this issue in the same environment.

Actions #9

Updated by mkittler about 3 years ago

psql --version only prints the version of the client, not the version of the database server. (For that see the command I mentioned in my last comment.) However, likely all of my questions aren't that important anyways because it looks like an empty @assets_query could cause this (regardless of the OS/db version).

Actions #10

Updated by okurz about 3 years ago

dawei_pang wrote:

openQA-4.6.162 works well without this issue in the same environment.

do you happen to know which version exactly was the "last good"? The latest '4.6.162' could have been 4.6.1629997637.5c3f9e2dd from last month, the first '4.6.162' was likely 4.6.1619779004.cdb202dbd from 2021-05

Actions #11

Updated by mkittler about 3 years ago

  • Status changed from New to In Progress
  • Assignee changed from Xiaojing_liu to mkittler

Yes, that was the problem. So the issue should be fixed by https://github.com/os-autoinst/openQA/pull/4241. Since you're asking about the specific version, I'm pretty sure https://github.com/os-autoinst/openQA/pull/4136 broke it.

Actions #12

Updated by dawei_pang about 3 years ago

okurz wrote:

dawei_pang wrote:

openQA-4.6.162 works well without this issue in the same environment.

do you happen to know which version exactly was the "last good"? The latest '4.6.162' could have been 4.6.1629997637.5c3f9e2dd from last month, the first '4.6.162' was likely 4.6.1619779004.cdb202dbd from 2021-05

Before upgrading to 4.6.163, the openQA version is 4.6.1629897341.45cb977d4 for Leap15.3

Actions #13

Updated by dawei_pang about 3 years ago

mkittler wrote:

Yes, that was the problem. So the issue should be fixed by https://github.com/os-autoinst/openQA/pull/4241. Since you're asking about the specific version, I'm pretty sure https://github.com/os-autoinst/openQA/pull/4136 broke it.

Thank you. This issue is fixed in https://github.com/os-autoinst/openQA/pull/4241.

Actions #14

Updated by openqa_review about 3 years ago

  • Due date set to 2021-10-12

Setting due date based on mean cycle time of SUSE QE Tools

Actions #15

Updated by mkittler about 3 years ago

  • Status changed from In Progress to Resolved
Actions

Also available in: Atom PDF