Installation ruby-foreman-ansible error on Ubuntu 16.04 and Foreman 1.18

Hello,

We have:
Ubuntu 16.04
Foreman 1.18.0-1
foreman-proxy: 1.18.0-1

We try to install ansible plugin (ruby-foreman-ansible 2.0.1-1) and get always a error.

apt install ruby-foreman-ansible

error: dpkg: error processing package ruby-foreman-ansible (–configure):
subprocess installed post-installation script returned error exit status 6
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Logfile : /var/log/foreman-install.log

Resolving dependencies…
Some gems seem to be missing from your vendor/cache directory.
Bundler could not find compatible versions for gem “dynflow”:
In snapshot (Gemfile.lock):
dynflow (= 1.1.0)

In Gemfile:
dynflow (< 2.0.0, >= 1.0.0)

foreman-tasks (= 0.13.2) was resolved to 0.13.2, which depends on
  dynflow (>= 1.0.5, ~> 1.0)

foreman_ansible (= 2.0.1) was resolved to 2.0.1, which depends on
  dynflow (~> 0.8.14)

Running bundle update will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

bundle update not possible: Server is not connected to internet.

Please help
best regards
mobios

@dLobatog @bastilian could you please release new gems of foreman_ansible and foreman_ansibale_core, so we can update the DEBs?

1 Like

Any updates on this? The packages are still broken as of today.

https://github.com/theforeman/foreman-packaging/pull/2721 was supposed to fix it. Interestingly, I see 2.2.6 was pushed to 1.18 already http://deb.theforeman.org/pool/plugins/1.18/r/ruby-foreman-ansible/

what versions do you have now installed?

Currently using Ubuntu 16.04 and Foreman 1.18 for the deb.theforeman.org and it is failing on 2.2.6-1

PROD - Hearth [root@foreman /usr]# cat /etc/apt/sources.list.d/foreman.list.save
deb http://deb.theforeman.org/ xenial 1.18
deb http://deb.theforeman.org/ plugins 1.18

PROD - Hearth [root@foreman /usr]# apt install ruby-foreman-ansible
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
ruby-foreman-ansible
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/2,652 kB of archives.
After this operation, 19.6 MB of additional disk space will be used.
Selecting previously unselected package ruby-foreman-ansible.
(Reading database … 204996 files and directories currently installed.)
Preparing to unpack …/ruby-foreman-ansible_2.2.6-1_all.deb …
Unpacking ruby-foreman-ansible (2.2.6-1) …
Setting up ruby-foreman-ansible (2.2.6-1) …
dpkg: error processing package ruby-foreman-ansible (–configure):
subprocess installed post-installation script returned error exit status 6
Errors were encountered while processing:
ruby-foreman-ansible
E: Sub-process /usr/bin/dpkg returned an error code (1)

Can you find the exact error in /var/log? I’m guessing in dpkg or apt.

I set debug on the postinst script that is failing. It appears that ‘/usr/bin/foreman-ruby /usr/bin/bundle install --local --no-prune’ is existing with status of 6 causing the postinst script to fail.

  • cd /usr/share/foreman
  • [ ! -z ]
  • [ -n ]
  • /usr/bin/foreman-ruby /usr/bin/bundle install --local --no-prune
  • db_stop
  • echo STOP
    dpkg: error processing package ruby-foreman-ansible (–configure):
    subprocess installed post-installation script returned error exit status 6
    Errors were encountered while processing:
    ruby-foreman-ansible

In the foreman-installer.log file, I see this:

Could not find gem ‘foreman_remote_execution (< 2.0, >= 1.4.4)’, which is
required by gem ‘foreman_ansible (= 2.2.6)’, in any of the sources.
Don’t run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Resolving dependencies…
Some gems seem to be missing from your vendor/cache directory.
Bundler could not find compatible versions for gem “foreman_remote_execution”:
In Gemfile:
foreman_ansible (= 2.2.6) was resolved to 2.2.6, which depends on
foreman_remote_execution (< 2.0, >= 1.4.4)

Could not find gem ‘foreman_remote_execution (< 2.0, >= 1.4.4)’, which is
required by gem ‘foreman_ansible (= 2.2.6)’, in any of the sources.

I installed the ‘ruby-foreman-remote-execution’ package and that fixed the bundle errors which allowed the ansible plugin to install successfully. So at this time there is dependency for ‘ruby-foreman-remote-execution’ that is not in the dpkg info.

Thanks, that should be fixed with https://github.com/theforeman/foreman-packaging/pull/2925