Foreman Ansible Plugin install failure

Foreman Ansible plugin fails to Install correctly
Expected outcome:
Install the Ansible module to be able to run roles
Foreman and Proxy versions:
Foreman and Proxy plugin versions:
Distribution and version:
CentOS 8 Stream
Other relevant data:
Looks like their is an issue with the DB doing a migrate but not a 100% sure. I have been able to Install other plugins in, it always fails on the Ansible plugin.

[root@foreman ~]# foreman-installer --enable-foreman-plugin-ansible --enable-foreman-proxy-plugin-ansible
2022-01-31 16:04:47 [NOTICE] [root] Loading installer configuration. This will take some time.
2022-01-31 16:04:51 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2022-01-31 16:04:51 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2022-01-31 16:04:57 [NOTICE] [configure] Starting system configuration.
2022-01-31 16:05:06 [NOTICE] [configure] 250 configuration steps out of 1458 steps complete.
2022-01-31 16:05:07 [NOTICE] [configure] 500 configuration steps out of 1460 steps complete.
2022-01-31 16:05:07 [NOTICE] [configure] 750 configuration steps out of 1465 steps complete.
2022-01-31 16:05:19 [ERROR ] [configure] '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2022-01-31 16:05:19 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: change from 'notrun' to ['0'] failed: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2022-01-31 16:05:24 [NOTICE] [configure] 1000 configuration steps out of 1467 steps complete.
2022-01-31 16:05:25 [NOTICE] [configure] 1250 configuration steps out of 1467 steps complete.
2022-01-31 16:05:27 [NOTICE] [configure] System configuration has finished.

  There were errors detected during install.
  Please address the errors and re-run the installer to ensure the system is properly configured.
  Failing to do so is likely to result in broken functionality.

  The full log is at /var/log/foreman-installer/foreman.log

Issue was in the way Foreman tried to read the database too early. The culprit is a new graphql fields that try to load information from database linked here

The fix is Fixes #34366 - skip GraphQL types enhancements in migrations by ezr-ondrej · Pull Request #9080 · theforeman/foreman · GitHub this patch should be pushed out shortly.

Hot Fix:
You can run the following to pull the patch directly to your system if needed

curl | patch -p1

when it ask what file you are patching enter:


This is still happening for me on the latest version of AlmaLinux 8 and Foreman/Katello. I just did a fresh install today. When I try to apply the patch as root or using sudo I get this:

[root@foreman001 ~]# curl | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   980    0   980    0     0   4644      0 --:--:-- --:--:-- --:--:--  4644
can't find file to patch at input line 16
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
|From c2e23a16b5c6fba847c0aa76a09d4b5cb3f15b37 Mon Sep 17 00:00:00 2001
|From: =?UTF-8?q?Ond=C5=99ej=20Ezr?= <>
|Date: Tue, 1 Feb 2022 15:21:26 +0100
|Subject: [PATCH] Fixes #34366 - skip GraphQL types enhancements in migrations
|GraphQL types try to touch database, but that is not possible during the db migration.
|These fields enhancements needs to be disabled during migrations.
| config/application.rb | 2 +-
| 1 file changed, 1 insertion(+), 1 deletion(-)
|diff --git a/config/application.rb b/config/application.rb
|index 9c278aa21c6..c817ed90426 100644
|--- a/config/application.rb
|+++ b/config/application.rb
File to patch: /usr/share/foreman/config/application.rb
patching file /usr/share/foreman/config/application.rb
Hunk #1 FAILED at 317.
1 out of 1 hunk FAILED -- saving rejects to file /usr/share/foreman/config/application.rb.rej
[root@foreman001 ~]#