Unable to do scripted upgrade since 5.11.3

The issue I am facing:
I have been running PiHole on Rocky Linux 8 for a little over a year now with 0 issues. I have the environment variable PIHOLE_SKIP_OS_CHECK set to true and have been able to update using Foreman and ssh with no issues. On upgrade to 5.11.3 the upgrade failed as a dialog now appears warning about an unsupported os. This dialog should honor the PIHOLE_SKIP_OS_CHECK variable and not show up if true.

Details about my system:
Rocky Linux 8.6 running on QEMU/KVM virtual machine

What I have changed since installing Pi-hole:
Just standard system updates.

Why are you doing automated updates? You would be much better off reading the release notes prior to updating, then updating manually if the release meets your needs.

Some updates have been (and will be) breaking, and you don't want to kill your Pi-hole installation while you sleep.

I guess I worded that wrong. They are not fully automated, but I kick the job off manually from a Foreman server which allows me to run the same job through ssh to multiple servers. This way I can update a test server through the command line, make sure everything is working as intended, and then kick off the job to multiple production servers without having to log in to each one individually.

Just to be sure:
PIHOLE_SKIP_OS_CHECK is properly set on that VM (and not on the host OS per chance?).

Yes it is set on the VM and not the host. Here is a clipped version of the output from Foreman Job:
You can see the beginning sees the variable set and continues. The last line shows where the dialog appears warnin of what I already told it to override.

 63:
  [i] PIHOLE_SKIP_OS_CHECK env variable set to true - installer will continue
  64:
  [i] Checking for / installing Required dependencies for this install script...
  65:
  [i] Checking for git...
e[K  [βœ“] Checking for git
  66:
  [i] Checking for dialog...
e[K  [i] Checking for dialog (will be installed)
  67:
  [i] Checking for iproute...
e[K  [βœ“] Checking for iproute
  68:
  [i] Checking for newt...
e[K  [βœ“] Checking for newt
  69:
  [i] Checking for procps-ng...
e[K  [βœ“] Checking for procps-ng
  70:
  [i] Checking for which...
e[K  [βœ“] Checking for which
  71:
  [i] Checking for chkconfig...
e[K  [βœ“] Checking for chkconfig
  72:
  [i] Checking for ca-certificates...
e[K  [βœ“] Checking for ca-certificates
  73:
  [i] Processing dnf install(s) for: dialog, please wait...
  74:

  75:
Updating Subscription Management repositories.
  76:
powerdns-dnsdist-17                              15 kB/s | 2.0 kB     00:00    
  77:
epel                                             21 kB/s | 2.6 kB     00:00    
  78:
epel-modular                                     21 kB/s | 2.3 kB     00:00    
  79:
Extras                                           34 kB/s | 3.5 kB     00:00    
  80:
PowerTools                                       47 kB/s | 4.8 kB     00:00    
  81:
AppStream                                        57 kB/s | 4.8 kB     00:00    
  82:
BaseOS                                           62 kB/s | 4.3 kB     00:00    
  83:
Dependencies resolved.
  84:
================================================================================
  85:
 Package
  86:
       Arch   Version             Repository                               Size
  87:
================================================================================
  88:
Installing:
  89:
 dialog
  90:
       x86_64 1.3-13.20171209.el8 VanzarSystems_Rocky_Linux_8_6_AppStream 232 k
  91:

  92:
Transaction Summary
  93:
================================================================================
  94:
Install  1 Package
  95:

  96:
Total download size: 232 k
  97:
Installed size: 552 k
  98:
Downloading Packages:
  99:
dialog-1.3-13.20171209.el8.x86_64.rpm           1.3 MB/s | 232 kB     00:00    
 100:
--------------------------------------------------------------------------------
 101:
Total                                           1.2 MB/s | 232 kB     00:00     
 102:
Running transaction check
 103:
Transaction check succeeded.
 104:
Running transaction test
 105:
Transaction test succeeded.
 106:
Running transaction
 107:
  Preparing        :                                                        1/1 
 108:
  Installing       : dialog-1.3-13.20171209.el8.x86_64                      1/1 
 109:
  Running scriptlet: dialog-1.3-13.20171209.el8.x86_64                      1/1 
 110:
  Verifying        : dialog-1.3-13.20171209.el8.x86_64                      1/1
Scanning processes... [                                                        ]
Scanning processes... [                                                        ]
Scanning processes... [========================================================]
Scanning processes...                                                           
 111:
Scanning processor microcode... [                                              ]
Scanning processor microcode... [===========                                   ]
Scanning processor microcode... [=======================                       ]
Scanning processor microcode... [==================================            ]
Scanning processor microcode... [==============================================]
Scanning processor microcode...                                                 
 112:
Scanning linux images... [                                                     ]
Scanning linux images... [==========                                           ]
Scanning linux images... [=====================                                ]
Scanning linux images... [===============================                      ]
Scanning linux images... [==========================================           ]
Scanning linux images... [=====================================================]
Scanning linux images...                                                        
 113:

 114:
Running kernel seems to be up-to-date.
 115:

 116:
Failed to check for processor microcode upgrades.
 117:

 118:
No services need to be restarted.
 119:

 120:
No containers need to be restarted.
 121:

 122:
No user sessions are running outdated binaries.
 123:

 124:
No VM guests are running outdated hypervisor (qemu) binaries on this host.
 125:
 
 126:
Installed products updated.
 127:
Uploading Tracer Profile
 128:

 129:
Installed:
 130:
  dialog-1.3-13.20171209.el8.x86_64                                             
 131:

 132:
Complete!
 133:

 134:
Error opening terminal: unknown.
 135:
  [i] User opted not to continue installation on an unsupported RPM based distribution.

What such pastes from console into code fences, for readability:

```
line 1
line 2
etc
```

That output suggests that the installer did honor PIHOLE_SKIP_OS_CHECK and indeed continued to run despite an unsupported OS being detected.

From what I'm able to grasp from your further output, it would seem that a tty dialog would prompt for a a selection of Exit or Continue interactively.
The corresponding code shows no involvement with PIHOLE_SKIP_OS_CHECK, but seems to evaluate user input:

Your log suggests that either you've opted to Exit or that the call to dialog failed and thus trigggered the default answer (again Exit)

Did you actually see the dialog from the code above during update?
If you've scripted answering that dialog, could you check your chosen answer?

When I logged into the machine through ssh and ran pihole -up it goes through the same logging, but when it gets to the point that errored out in the foreman run, I see a dialog box telling me I have an unsupported os, and to be sure I have lighttpd, lighttpd-fastcgi, and php >=7 installed and then a continue or quit button.

Okay, I see what is happening.

What automation are you using with Foreman, Ansible or Puppet? And what is the command that the run is using? You might want to use the unattended install flag if you're doing this headless.

I can change one or two of the dialogs to not fire if UNSUPPORTED is true but the dialog listing the required packages would still show.

Thanks for bringing this situation up, it's not one that I considered.

Edit: Or we add Rocky to the supported OS list.

"Edit: Or we add Rocky to the supported OS list." this would be the ideal solution. For the Foreman automation I am not using Puppet or Ansible for it. I am doing it as an SSH job. I've added "--unattended" to my commandline in Foreman and we'll see how that works when there is a new update available. I don't have any that currently need the upgrade applied.

1 Like

Would implement:

1 Like

Can someone get me the output from /etc/os-release on Rocky?

NAME="Rocky Linux"
VERSION="8.6 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.6"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.6 (Green Obsidian)"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:rocky:rocky:8:GA"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
ROCKY_SUPPORT_PRODUCT="Rocky Linux"
ROCKY_SUPPORT_PRODUCT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8"

1 Like

Can you please, try to add TERM=linux or TERM=xterm before the installation command to allow the dialog command recognize the terminal type?

Maybe TERM=screen.

1 Like

I can, but I'm not sure this would help as in this situation there really isn't a terminal. The whole point of this discussion is that the dialog shouldn't even try to show if the PIHOLE_SKIP_OS_CHECK environment variable is set. I already know that I'm on an unsupported os and accepted the risks.

I tried twice with the latest update. Adding "unatended" had no effect. Adding "Term=linux" allowed the dialog to show and then the update just hangs waiting for input on that dialog box. I guess I'll just have to manually apply updates until Rocky is a supported OS.

e[K [βœ“] Checking for ca-certificates
56:
57:e)0e[Je[He[K
58:e[K
59: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€Unsupported RPM based distribution──────────────────┐e[K
60:β”‚e[K
61:β”‚e[K
62:β”‚e[K
63:β”‚e[K
64:β”‚e[K
65:β”‚e[K
66:β”‚e[K
67:β”‚e[K
68:β”‚e[K
69:β”‚e[K
70:β”‚e[K
71:β”‚e[K
72:β”‚e[K
73:β”‚e[K
74:β”‚e[K
75:β”‚e[K
76:─────────────────────────────────────────────────────────────────────e[K
77:β”‚Continue> < Exit >e[K
78:β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜Would you like to continue installation on an unsupported RPM
79:e[8Gbased distribution?
80:
81:anually:
82:
83:e[8G- lighttpd
84:e[8G- lighttpd-fastcgi
85:

Okay, I'm going to go rogue and add Rocky.

Give the install a try now. I've tentatively added Rocky to the supported list.

I built a fresh Rocky Linux VM, and running:
curl -sSL https://install.pi-hole.net | bash
The first part of the script shows "Supported OS" but I still get the dialog:
PiHole Dialog (sorry, I can't put an image directly in the post.)