E: Package rubygem-foreman_maintain cannot be found

hi all, I can use foremain-maintain but when I run the command I get the error E: Package rubygem-foreman_maintain cannot be found., is that normal:

root@testdev:~# foreman-maintain upgrade check
Checking for new version of rubygem-foreman_maintain...
E: Package rubygem-foreman_maintain cannot be found.
Nothing to update, can't find new version of rubygem-foreman_maintain.
--target-version not specified
Possible target versions are:
nightly
root@testdev::~# dpkg-query -l | grep foreman-maintain
ii  ruby-foreman-maintain                  1.2.4-1+ubuntu2004                all          Foreman maintenance tool belt

I install foreman-maintain: root@testdev:~# apt install ruby-foreman-maintain

Foreman and Proxy versions: foreman 3.5.1 , foreman-proxy 3.5.1

Foreman and Proxy plugin versions:

Distribution and version: Ubuntu 20.04.4 LTS

thank you all

Why when I want to create backup I get below error:

root@testdev:~# foreman-maintain backup offline /tmp/backup
Starting backup: 2023-03-14 11:22:46 +0100
Running preparation steps required to run the next scenarios
================================================================================
Make sure Foreman DB is up:
/ Checking connection to the Foreman DB                               [OK]
--------------------------------------------------------------------------------


Running Backup
================================================================================
Confirm turning off services is allowed:
WARNING: This script will stop your services.

Do you want to proceed?, [y(yes), q(quit)] y
                                                                      [OK]
--------------------------------------------------------------------------------
Prepare backup Directory:
Creating backup folder /tmp/backup/foreman-backup-2023-03-14-11-22-46 [OK]
--------------------------------------------------------------------------------
Check if the directory exists and is writable:                        [OK]
--------------------------------------------------------------------------------
Generate metadata:
| Saving metadata to metadata.yml                                     [OK]
--------------------------------------------------------------------------------
Detect features available in the local proxy:                         [OK]
--------------------------------------------------------------------------------
Add maintenance_mode tables/chain to nftables/iptables:               [OK]
--------------------------------------------------------------------------------
Stop applicable services:

Stopping the following service(s):                                    [FAIL]
No services found matching your parameters
--------------------------------------------------------------------------------
Scenario [Backup] failed.

The following steps ended up in failing state:

  [service-stop]

Resolve the failed steps and rerun the command.
In case the failures are false positives, use
--whitelist="service-stop"



Running Failed backup cleanup
================================================================================
Start applicable services:

Starting the following service(s):                                    [FAIL]
No services found matching your parameters
--------------------------------------------------------------------------------
Remove maintenance mode table/chain from nftables/iptables:           [OK]
--------------------------------------------------------------------------------
Clean up backup directory:                                            [OK]
--------------------------------------------------------------------------------
Scenario [Failed backup cleanup] failed.

The following steps ended up in failing state:

  [service-start]

Resolve the failed steps and rerun the command.
In case the failures are false positives, use
--whitelist="service-start"


Done with backup: 2023-03-14 11:23:01 +0100
Backup didn't finish. Incomplete backup was removed.

This looks like the self upgrade is not yet supported on Debian. It checks the RPM package name:

I install foreman-maintain: root@testdev:~# apt install ruby-foreman-maintain

is there a way to fix it ? thanks for your replay @ekohl

Patches to foreman_maintain for real support. Perhaps in the mean time we should disable the feature on Debian so it doesn’t show up? Or at least show a proper message.

cc @evgeni

1 Like

I’ll have a look!

1 Like

I’ve opened a PR for the package name: use correct package name on Debian systems by evgeni · Pull Request #695 · theforeman/foreman_maintain · GitHub

@evgeni so I have to upgrade the packege or should I reinstall it ?

is the Fail here related to the changes ?

No, the backup issue is unrelated to that.

Ok thanks, do you know why I get the error ?

And should I reinstall foreman-maintain ?

No I do not. Creating a backup is part of our release pipeline, and that passed fine. So it’s nothing that we’d be aware of.

Would you mind sharing the contents of /var/log/foreman-maintain/foreman-maintain.log with us? feel free to do it via mail to evgeni at redhat dot com if you don’t want to upload it somewhere public.

of course I’ll send you and Danke :slight_smile:

How can I get the new version of forman-maintain ?

Thanks! Received.

A new version will be in the repos (but I don’t think there are any changes between the 1.2.4 you have ans the latest 1.2.7 release that would help you right now).

Looking at your log, my hunch is that it’s because of your german locale and something gets messed up.
Still need to confirm that here, but could you try with LC_ALL=en_US.utf8 LANG=en_US.utf8 LANGUAGE=en_US.utf8 or something similar?

1 Like

Mhh, no, setting my local Debian install to German doesn’t yield the same issue.

do you mean with the Faile when I create backup or when I run foreman-maintain upgrade check.

I can test that if you want @evgeni

when creating a backup

I think when I install new version I dont get this error: E: Package rubygem-foreman_maintain cannot be found. right ?

I’ll test that with local too, if it change anything… but when I install foreman I change language to EN… I’ll check

So its en_US.UTF-8:

# localectl list-locales
C.UTF-8
de_DE.UTF-8
en_US.UTF-8

Does anyone know why I get below error, satellite, satellite-capsule and satellite-installer are not installed, do I have to install them manually? I installed foreman on available Puppetserver

# foreman-maintain service status
Running Status Services
================================================================================
Get status of applicable services:

Displaying the following service(s):                                  [FAIL]
No services found matching your parameters
--------------------------------------------------------------------------------
Scenario [Status Services] failed.

The following steps ended up in failing state:

  [service-status]

Resolve the failed steps and rerun the command.
In case the failures are false positives, use
--whitelist="service-status"

The error in foreman-maintain.log:

D, [2023-03-15 09:23:43+0100 #78090] DEBUG -- : Running command dpkg-query --show puppetserver with stdin nil
D, [2023-03-15 09:23:43+0100 #78090] DEBUG -- : output of the command:
 puppetserver   7.9.0-1focal
E, [2023-03-15 09:23:43+0100 #78090] ERROR -- : No services found matching your parameters (RuntimeError)
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/definitions/features/service.rb:32:in `filtered_services'
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/definitions/procedures/service/base.rb:19:in `run_service_action'
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/definitions/procedures/service/status.rb:14:in `run'
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/lib/foreman_maintain/executable.rb:139:in `__run__'
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/lib/foreman_maintain/runner/execution.rb:83:in `block (2 levels) in run'
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/lib/foreman_maintain/runner/execution.rb:107:in `capture_errors'
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/lib/foreman_maintain/runner/execution.rb:82:in `block in run'
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/lib/foreman_maintain/runner/execution.rb:101:in `with_metadata_calculation'
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/lib/foreman_maintain/runner/execution.rb:81:in `run'
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/lib/foreman_maintain/runner.rb:131:in `run_step'
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/lib/foreman_maintain/runner.rb:120:in `run_steps'
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/lib/foreman_maintain/runner.rb:113:in `execute_scenario_steps'
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/lib/foreman_maintain/runner.rb:58:in `run_scenario'
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/lib/foreman_maintain/runner.rb:39:in `block in run'
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/lib/foreman_maintain/runner.rb:38:in `each'
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/lib/foreman_maintain/runner.rb:38:in `run'
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/lib/foreman_maintain/cli/base.rb:64:in `run_scenario'
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/lib/foreman_maintain/cli/service_command.rb:67:in `execute'
/usr/lib/ruby/vendor_ruby/clamp/command.rb:63:in `run'
/usr/lib/ruby/vendor_ruby/clamp/subcommand/execution.rb:11:in `execute'
/usr/lib/ruby/vendor_ruby/clamp/command.rb:63:in `run'
/usr/lib/ruby/vendor_ruby/clamp/subcommand/execution.rb:11:in `execute'
/usr/lib/ruby/vendor_ruby/clamp/command.rb:63:in `run'
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/lib/foreman_maintain/cli.rb:46:in `run'
/usr/lib/ruby/vendor_ruby/clamp/command.rb:132:in `run'
/usr/share/rubygems-integration/all/gems/foreman_maintain-1.2.4/bin/foreman-maintain:15:in `<top (required)>'
/usr/bin/foreman-maintain:23:in `load'
/usr/bin/foreman-maintain:23:in `<main>'
I, [2023-03-15 09:23:43+0100 #78090]  INFO -- : --- Execution step 'Get status of applicable services' finished ---
D, [2023-03-15 09:23:43+0100 #78090] DEBUG -- : Running command dpkg --status 'satellite' with stdin nil
D, [2023-03-15 09:23:43+0100 #78090] DEBUG -- : output of the command:
 dpkg-query: Paket »satellite« ist nicht installiert und es ist keine Information verfügbar
Verwenden Sie dpkg --info (= dpkg-deb --info) zum Untersuchen von Archiven.
D, [2023-03-15 09:23:43+0100 #78090] DEBUG -- : Running command dpkg --status 'satellite' with stdin nil
D, [2023-03-15 09:23:43+0100 #78090] DEBUG -- : output of the command:
 dpkg-query: Paket »satellite« ist nicht installiert und es ist keine Information verfügbar
Verwenden Sie dpkg --info (= dpkg-deb --info) zum Untersuchen von Archiven.
D, [2023-03-15 09:23:43+0100 #78090] DEBUG -- : Running command dpkg --status 'satellite-capsule' with stdin nil
D, [2023-03-15 09:23:43+0100 #78090] DEBUG -- : output of the command:
 dpkg-query: Paket »satellite-capsule« ist nicht installiert und es ist keine Information verfügbar
Verwenden Sie dpkg --info (= dpkg-deb --info) zum Untersuchen von Archiven.
D, [2023-03-15 09:23:43+0100 #78090] DEBUG -- : Running command dpkg --status 'capsule-installer' with stdin nil
D, [2023-03-15 09:23:43+0100 #78090] DEBUG -- : output of the command:
 dpkg-query: Paket »capsule-installer« ist nicht installiert und es ist keine Information verfügbar
Verwenden Sie dpkg --info (= dpkg-deb --info) zum Untersuchen von Archiven.
I, [2023-03-15 09:23:43+0100 #78090]  INFO -- : === Scenario 'Status Services' finished ===
I, [2023-03-15 09:23:43+0100 #78090]  INFO -- : foreman-maintain command finished with

No, you will not find the satellite packages anywhere for Debian.
Foreman Maintain just checks their availability, they are not required.

1 Like