Dynflow not initialized yet

Problem:
I have a problem where when I try to click the “Repo Discovery” on a newly created foreman instance, an error will occur.
The Dynflow world was not initialized yet. If your plugin uses it, make sure to call Rails.application.dynflow.require! in some initializer

Expected outcome:
I should be able to do repo discovery

Foreman and Proxy versions:
Foreman 3.8

Foreman and Proxy plugin versions:

Distribution and version:
RockyLinux 8

Other relevant data:
I managed to found a similar issue posted before Remote execution dynflow not initialized yet
However I don’t think my machine was underpowered
Here is the content of my /etc/systemd/system/foreman.service.d/installer.conf file

[Service]
User=foreman
Environment=FOREMAN_ENV=production
Environment=FOREMAN_HOME=/usr/share/foreman
Environment=FOREMAN_PUMA_THREADS_MIN=5
Environment=FOREMAN_PUMA_THREADS_MAX=5
Environment=FOREMAN_PUMA_WORKERS=-1

Here is the output of my facter command

[admin@foreman ~]$ facter
aio_agent_version => 7.27.0
augeas => {
  version => "1.13.0"
}
dmi => {
  bios => {
    release_date => "12/07/2018",
    vendor => "American Megatrends Inc.",
    version => "090008"
  },
  board => {
    manufacturer => "Microsoft Corporation",
    product => "Virtual Machine"
  },
  chassis => {
    asset_tag => "4057-4431-0009-2157-3186-0069-69",
    type => "Desktop"
  },
  manufacturer => "Microsoft Corporation",
  product => {
    name => "Virtual Machine"
  }
}
facterversion => 4.4.1
filesystems => xfs
fips_enabled => false
hypervisors => {
  hyperv => {
  }
}
identity => {
  gid => 1000,
  group => "admin",
  privileged => false,
  uid => 1000,
  user => "admin"
}
is_virtual => true
kernel => Linux
kernelmajversion => 4.18
kernelrelease => 4.18.0-513.5.1.el8_9.x86_64
kernelversion => 4.18.0
load_averages => {
  15m => 0.36,
  1m => 0.04,
  5m => 0.12
}
memory => {
  swap => {
    available => "2.20 GiB",
    available_bytes => 2363785216,
    capacity => "3.66%",
    total => "2.29 GiB",
    total_bytes => 2453663744,
    used => "85.71 MiB",
    used_bytes => 89878528
  },
  system => {
    available => "4.30 GiB",
    available_bytes => 4617777152,
    capacity => "49.06%",
    total => "8.44 GiB",
    total_bytes => 9064955904,
    used => "4.14 GiB",
    used_bytes => 4447178752
  }
}
os => {
  architecture => "x86_64",
  distro => {
    codename => "Green Obsidian",
    description => "Rocky Linux release 8.9 (Green Obsidian)",
    id => "Rocky",
    release => {
      full => "8.9",
      major => "8",
      minor => "9"
    }
  },
  family => "RedHat",
  hardware => "x86_64",
  name => "Rocky",
  release => {
    full => "8.9",
    major => "8",
    minor => "9"
  },
  selinux => {
    config_mode => "enforcing",
    config_policy => "targeted",
    current_mode => "enforcing",
    enabled => true,
    enforced => true,
    policy_version => "33"
  }
}
processors => {
  cores => 2,
  count => 4,
  isa => "x86_64",
  models => [
    "Intel(R) Xeon(R) Gold 6326 CPU @ 2.90GHz",
    "Intel(R) Xeon(R) Gold 6326 CPU @ 2.90GHz",
    "Intel(R) Xeon(R) Gold 6326 CPU @ 2.90GHz",
    "Intel(R) Xeon(R) Gold 6326 CPU @ 2.90GHz"
  ],
  physicalcount => 1,
  speed => "798.00 MHz",
  threads => 2
}

What does systemctl status foreman show you?

[admin@foreman ~]$ systemctl status foreman
● foreman.service - Foreman
   Loaded: loaded (/usr/lib/systemd/system/foreman.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/foreman.service.d
           └─installer.conf
   Active: active (running) since Thu 2023-11-23 17:13:43 HKT; 39min ago
     Docs: https://theforeman.org
 Main PID: 14603 (rails)
   Status: "Puma 6.3.1: worker: { 5/5 threads, 5 available, 0 backlog }"
    Tasks: 20 (limit: 126352)
   Memory: 396.1M
   CGroup: /system.slice/foreman.service
           └─14603 puma 6.3.1 (unix:///run/foreman.sock) [foreman]

Nov 23 17:13:43 foreman.ogcio foreman[14603]: * Puma version: 6.3.1 (ruby 2.7.8-p225) ("Mugi No Toki Itaru")
Nov 23 17:13:43 foreman.ogcio foreman[14603]: *  Min threads: 5
Nov 23 17:13:43 foreman.ogcio foreman[14603]: *  Max threads: 5
Nov 23 17:13:43 foreman.ogcio foreman[14603]: *  Environment: production
Nov 23 17:13:43 foreman.ogcio foreman[14603]: *          PID: 14603
Nov 23 17:13:43 foreman.ogcio foreman[14603]: * Activated unix:///run/foreman.sock
Nov 23 17:13:43 foreman.ogcio foreman[14603]: Sending status to systemd every 1.0 sec
Nov 23 17:13:43 foreman.ogcio foreman[14603]: * Starting control server on unix:///usr/share/foreman/tmp/sockets/pumactl.sock
Nov 23 17:13:43 foreman.ogcio foreman[14603]: Use Ctrl-C to stop
Nov 23 17:13:43 foreman.ogcio systemd[1]: Started Foreman.
[admin@foreman ~]$

The last comment in the other thread mentioned they needed to force FOREMAN_PUMA_WORKERS to be greater than 1. You currently have -1 in there.

If I’m reading the facts you provided right, then that machine has 4CPU cores and ~8GB of ram. Considering you want to do repo discovery I’d guess you also have katello installed. The hardware requirements for foreman with katello are much higher than what you currently have there.

Oh, I think I found out the problem. Hyper-V has a Dynamic Memory feature where they scale the VM’s ram dynamically. So on the host although I have set 20GB, the guest won’t have that much if it doesn’t require it. I have disabled that hyper-v dynamic memory feature and everything is working fine after a new override install. Thanks

1 Like