Category Archives: Uncategorized

Debugging a WP Toolkit scan failure: “Invalid field: auto_update”

While importing an existing WordPress installation into WP Toolkit on one of our cPanel servers, the scan failed with an error that, at first glance, made no sense:

Failed to register instance at '/home/example/public_html':
Failed to reset cache for the instance #51: Error: Invalid field: auto_update.

[error]FailedToExecuteWpCliCommand: exit status 1[/error]

The site was running WordPress 6.9.5. The server had WP-CLI 2.12.0. Both are far newer than anything that could plausibly not know about the auto_update field, which has existed since WordPress 5.5 and WP-CLI 2.5 — that’s 2020. And yet, here we were.

This post walks through the investigation, because the root cause turned out to be something that can silently affect any cPanel account, and the symptom points everywhere except the actual problem.

What the error means

During a scan, WP Toolkit runs WP-CLI commands like this against each installation it discovers:

wp plugin list --fields=name,status,update,auto_update

If WP-CLI can’t produce one of the requested columns, it errors out with Invalid field, and WP Toolkit fails to register the instance. So the question was simple: why would a current WP-CLI, against a current WordPress, refuse to produce a column it has supported for six years?

Ruling out the obvious suspects

Old WordPress core? No — wp core version reported 6.9.5.

A plugin disabling auto-updates? WP-CLI only exposes the auto_update column when the auto-update system is actually enabled for that site, so a plugin hooking automatic_updater_disabled could in theory cause this. But the error survived --skip-plugins --skip-themes, which rules out plugin and theme code entirely.

Constants or drop-ins? A quick wp eval-file diagnostic asking WordPress directly settled it:

array (
  'auto_update_enabled_plugin' => true,
  'updater_is_disabled'        => false,
  'file_mod_allowed'           => true,
  'DISALLOW_FILE_MODS'         => 'undefined',
  'AUTOMATIC_UPDATER_DISABLED' => 'undefined',
  'filter_auto_updater'        => false,
  'filter_file_mod'            => false,
)

Every gate was open. WordPress itself was perfectly happy to auto-update. The environment wasn’t the problem.

(Small CageFS aside: the diagnostic script had to live inside the user’s home directory. /tmp as root and /tmp inside the user’s cage are different filesystems, so a script dropped into /tmp as root simply doesn’t exist from the user’s point of view.)

The tell

If WordPress wasn’t hiding the field, then the command code itself had to be old — regardless of what the version string claimed. And there’s a quick way to check what the running command actually supports:

# wp help plugin list | grep auto_update
(no output)

The plugin list command in use didn’t document auto_update at all. The framework said 2.12.0, but the command behaved like something from 2020.

Root cause: a forgotten wp package install

WP-CLI supports user-installed packages under ~/.wp-cli/packages/. On this account, someone had at some point installed two of them:

# wp package list
+------------------------+----------+
| name                   | version  |
+------------------------+----------+
| wp-cli/doctor-command  | dev-main |
| wp-cli/profile-command | dev-main |
+------------------------+----------+

Harmless-looking. But packages are installed via Composer with their own dependency tree, and a look inside the vendor directory told the real story:

# ls ~/.wp-cli/packages/vendor/wp-cli/
checksum-command  core-command  cron-command  doctor-command
entity-command  extension-command  language-command  profile-command

Those old package installs had pulled in half of WP-CLI’s command suite as dependencies — including extension-command, which is what actually provides wp plugin list and wp theme list. And here’s the critical detail: anything in the packages vendor directory overrides the commands bundled in the phar.

So every wp invocation on this account — including the ones WP Toolkit’s scanner runs as the user — was loading a 2020-era plugin list implementation that predates the auto_update field. The phar itself was current; it just never got a say.

The fix

wp package uninstall seemed like the clean way out, but it failed (Composer return code 2 — it wants to reach Packagist to regenerate the autoloader, which doesn’t work from inside the cage). No matter — the packages directory is entirely disposable. It contains only optional packages and their autoloader, nothing about the sites themselves:

mv ~/.wp-cli/packages ~/.wp-cli/packages.bak

Immediately afterwards:

# wp plugin list --fields=name,status,update,auto_update
+---------------------+--------+-----------+-------------+
| name                | status | update    | auto_update |
+---------------------+--------+-----------+-------------+
| woocommerce         | active | none      | off         |
| elementor           | active | available | off         |
| ...                 |        |           |             |

A rescan in WP Toolkit registered the site cleanly.

One more footnote: the failed scans had referenced instance IDs that didn’t exist in wp-toolkit --list. That’s expected — WP Toolkit creates the instance record at the start of registration and rolls it back on failure, so failed attempts simply burn auto-increment IDs. Nothing to clean up.

Takeaways

  1. wp cli version doesn’t tell you what code your commands run. The framework version and the command implementations can diverge if packages are installed. wp help <command> shows what the running implementation actually supports.
  2. wp package install has a long tail. A package installed once for a debugging session years ago can silently pin core commands to ancient versions via its Composer dependencies — and keep them pinned through every WP-CLI upgrade since.
  3. When a tool errors on a field the whole stack should support, suspect the dispatch path, not the stack. WordPress was fine, WP-CLI was fine, WP Toolkit was fine. The problem was which code got loaded.
  4. If you manage cPanel servers: it’s worth a periodic sweep for ~/.wp-cli/packages/ directories across accounts. Any account that has one is a candidate for this exact failure mode.

Fix Unknown table engine ‘INNODB’ error on Munin

In newer MySQL versions, if you have InnoDB disabled, Munin will fail to run giving you the following error:

root@myserver [~]# munin-run mysql_connections
DBD::mysql::st execute failed: Unknown table engine 'INNODB' at /etc/munin/plugins/mysql_connections line 958.

This is caused because the error message is changing between versions and the mysql_ plugin for munin hasn’t been updated in order to recognize it.
The fix is pretty simple, just open /usr/share/munin/plugins/mysql_ with vim on line 958 (hint: vim +958 filename) and replace as bellow.

Original code

    if ($@) {
 	        if ($@ =~ /Cannot call SHOW INNODB STATUS because skip-innodb is defined/) {
 	            $data->{_innodb_disabled} = 1;
 	            return;
 	        }
 	        die $@;

Fixed code

    if ($@) {
 	        if ($@ =~ /Unknown table engine 'INNODB'|Unknown storage engine 'innodb'|Cannot call SHOW INNODB STATUS because skip-innodb is defined/i) {
 	            $data->{_innodb_disabled} = 1;
 	            return;
 	        }
 	        die $@;

Save the file and you’re good to go 🙂

iOS 5.0.1 beta fixes battery issue

[blackbirdpie url=”https://twitter.com/#!/iMZDL/status/132175470253973504″]

In a previous post I mentioned that after installing the GM (i.e. final) version of iOS 5, I’ve seen my battery life percentage drop below 20% in a matter of a few hours. Now after upgrading to beta 1 on Thursday and beta 2 yesterday, and I can confirm that the battery issue is now fixed 🙂
My iPhone 4 now easily goes over 24+ hours after a full charge with everything enabled! (3G, WiFi, Location services etc.)

VPS.NET Japan cloud test failure – Success!

[blackbirdpie url=”https://twitter.com/vpsnet/status/116838472219770880″]

Today at around 06:30 EDT, VPS.NET engineers did a test failure at their recently launched Japan cloud and it went really well!
No downtime, no data loss, nothing. Exactly as it should work. Kudos to the VPS.NET team! I really hope that they have found the perfect solution for their SANs and that they will begin rolling-out the new technology to their other SANs soon.

Below is the output of sar, about an hour and a half after the test. The lines that indicate that something was going on (i.e. the test failure) are highlighted.

root@dev:~# sar
Linux 2.6.32-5-xen-amd64 (dev) 	09/22/2011 	_x86_64_	(3 CPU)

[...]
04:35:01 AM     CPU     %user     %nice   %system   %iowait    %steal     %idle
04:45:01 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
04:55:01 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
05:05:01 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
05:15:01 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
05:25:01 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
05:35:01 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
05:45:01 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
05:55:01 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
06:05:01 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
06:15:01 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
06:25:01 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
06:35:01 AM     all      0.02      0.00      0.02      0.01      0.00     99.95
06:45:01 AM     all      0.07      0.00      0.04      0.24      0.00     99.66
06:55:01 AM     all      0.07      0.00      0.03      6.35      0.00     93.55
07:05:01 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
07:15:01 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
07:25:01 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
07:35:01 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
07:45:01 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
07:55:01 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
08:05:01 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
08:15:01 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
Average:        all      0.00      0.00      0.00      0.13      0.00     99.86
root@dev:~# uptime
 08:16:20 up 8 days,  4:35,  1 user,  load average: 0.00, 0.00, 0.00

VPS.NET Tokyo cloud launched

[blackbirdpie url=”https://twitter.com/vpsnet/status/113858818764570624″]

We are pleased to announce the new beta of our Japan cloud (Tokyo). We are offering old and new customers up to 9 beta nodes for free to test out the location.

Highlights include:
– The fastest, most technically advanced enterprise class SAN within all of our clouds
– Full support for Windows and Linux
– Full OnApp 2.2 support will be enabled during the beta
– Its Free!

VPS.NET just launched their Tokyo cloud today in beta. According to them, this new cloud features an all-new SAN deployment which will resolve issues like their recent (and not only) 50h downtime + customer data loss. SAN failures have been a major issue at VPS.NET during the last year and many customers who didn’t had their own backup strategy lost all their data because of file corruption after a SAN crash (hint: don’t rely on VPS.NET backups -unless R1Soft- and always have your own backup strategy!)

Continue reading