Actions
action #99327
closedopenqa-webui-daemon: DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::Pg::st execute failed: ERROR: syntax error at or near "AND"
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