Public bug reported:

Package: cacti
Version: 1.2.31+ds1-3ubuntu2
Ubuntu Release: Ubuntu 26.10 (stonking)
MySQL Version: mysql-server 9.7.2-4ubuntu1

Description:
MySQL 9.7 deprecated and removed MD5(), SHA1(), and SHA() functions from the 
built-in server functions, moving them into the loadable component 
'file://component_classic_hashing'.

The Cacti package maintainer added logic in debian/cacti.postinst to install 
this component:
---------------------------------------------------------------------
if ! dbc_mysql_exec_command "SELECT MD5('cacti')" >/dev/null 2>&1 ; then
    dbc_mysql_exec_command "INSTALL COMPONENT 
'file://component_classic_hashing'" >/dev/null 2>&1 || true
fi
---------------------------------------------------------------------

However, this snippet is wrapped inside:
---------------------------------------------------------------------
# Only create common files (logfile) and grant permissions on first install
if [ ! -n "$2" ] ; then
---------------------------------------------------------------------

Because this condition checks whether $2 (the most recently configured
version) is empty, it ONLY executes on a brand-new installation.

On any upgrade from an earlier Cacti version (such as upgrading Ubuntu
26.04 LTS with MySQL 8.4 to Ubuntu 26.10 with MySQL 9.7), $2 is non-
empty (e.g., "1.2.30+ds1-1ubuntu2"). Consequently, the entire block is
skipped, and the 'classic_hashing' component is never installed.

Impact:
Following a distribution or package upgrade, Cacti's poller repeatedly fails 
with database errors in /var/log/cacti/cacti.log:
  "CMDPHP ERROR: A DB Cell Failed!, Error: FUNCTION cacti.MD5 does not exist"
  "CMDPHP SQL Backtrace: (/poller.php[945]:host_status_cache_check(), 
/poller.php[960]:db_fetch_cell(), ...)"

Steps to Reproduce:
1. Have an existing Ubuntu installation running Cacti with MySQL.
2. Upgrade to Ubuntu 26.10 / MySQL 9.7.
3. Observe that component_classic_hashing is not installed in MySQL and Cacti's 
poller logs MD5 SQL errors every 5 minutes.

Suggested Fix:
Move the MySQL 9.7 component check outside the 'if [ ! -n "$2" ]' block in 
cacti.postinst so that it runs whenever Cacti is configured or upgraded.

Workaround for Users:
Run manually:
  sudo mysql -e "INSTALL COMPONENT 'file://component_classic_hashing';"

ProblemType: Bug
DistroRelease: Ubuntu 26.10
Package: cacti 1.2.31+ds1-3ubuntu2
ProcVersionSignature: Ubuntu 7.3.0-9.9-generic 7.3.0-rc6
Uname: Linux 7.3.0-9-generic x86_64
ApportVersion: 2.36.0-0ubuntu1
Architecture: amd64
CasperMD5CheckResult: unknown
Date: Mon Oct 26 19:22:15 2026
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
SourcePackage: cacti
UpgradeStatus: Upgraded to stonking on 2026-10-26 (0 days ago)

** Affects: cacti (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug stonking third-party-packages

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2172267

Title:
  cacti.postinst: MySQL 9.7 classic_hashing component only installed on
  fresh install; upgrades fail with "FUNCTION cacti.MD5 does not exist"

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cacti/+bug/2172267/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to