katello-nightly-rpm-pipeline 1596 failed

Katello nightly pipeline failed:

https://ci.theforeman.org/job/katello-nightly-rpm-pipeline/1596/

foreman-pipeline-katello-rpm-nightly (failed) (remote job)

This seems to fail in the sync-plans phase, which seems to be fallout from Fixes #36024 - ignore already deleted sync plans by sbernhard · Pull Request #681 · theforeman/foreman_maintain · GitHub

cc @Bernhard_Suttner @ehelms

From the log:

I, [2023-02-22 23:50:44+0000 #63672]  INFO -- : --- Execution step 're-enable sync plans' [sync-plans-enable] started ---
D, [2023-02-22 23:50:44+0000 #63672] DEBUG -- : Running command PGPASSWORD='[FILTERED]' psql -h localhost  -p 5432 -U foreman -d foreman with stdin "SELECT 1 as ping"
D, [2023-02-22 23:50:44+0000 #63672] DEBUG -- : output of the command:
 ping 
------
    1
(1 row)
D, [2023-02-22 23:50:44+0000 #63672] DEBUG -- : Running command PGPASSWORD='[FILTERED]' psql -h localhost  -p 5432 -U foreman -d foreman with stdin "COPY (      SELECT id FROM katello_sync_plans WHERE id IN ()\n) TO STDOUT WITH CSV HEADER"
D, [2023-02-22 23:50:44+0000 #63672] DEBUG -- : output of the command:
 ERROR:  syntax error at or near ")"
LINE 1: COPY (      SELECT id FROM katello_sync_plans WHERE id IN ()
                                                                   ^
E, [2023-02-22 23:50:44+0000 #63672] ERROR -- : Illegal quoting in line 1. (CSV::MalformedCSVError)

I think the following should fix it:

diff --git definitions/features/sync_plans.rb definitions/features/sync_plans.rb
index 1484fd1..318a730 100644
--- definitions/features/sync_plans.rb
+++ definitions/features/sync_plans.rb
@@ -34,6 +34,8 @@ class Features::SyncPlans < ForemanMaintain::Feature
   end
 
   def validate_sync_plan_ids(ids)
+    return [] if ids.empty?
+
     ids_condition = ids.map { |id| "'#{id}'" }.join(',')
     query = <<-SQL
       SELECT id FROM katello_sync_plans WHERE id IN (#{ids_condition})

It does, so I posted Refs #36024 - don't fail on empty sync plan list by evgeni · Pull Request #687 · theforeman/foreman_maintain · GitHub

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.