Tools/upgrade.php upgrade exits 255 after successful upgrade to 3.5.0.5 — silent CLI wrapper failure

Describe the issue or problem
Running php tools/upgrade.php upgrade completes all migrations successfully (log shows every migration step through Installer::addPluginVersions), but the process then exits with code 255 and prints nothing further — no “Successfully upgraded to version…” message, no error, no stack trace, nothing in PHP’s error log or stderr.

Steps I took leading up to the issue
upgrading OJS 3.5.0.5 from 3.5.0.4

Root cause isolated:
The core Upgrade/Installer::execute() sequence (preInstall → parseInstaller → executeInstaller → postInstall → updateVersion) completes correctly and returns true. We confirmed this by calling execute() directly in an isolated PHP script, bypassing PKP\cliTool\UpgradeTool, and it ran clean end-to-end, including postInstall, getNotes(), getNewVersion(), and getVersionString() — all returned expected values with exit code 0. The versions table was correctly updated to build 5 (current=1).

The failure is therefore isolated specifically to PKP\cliTool\UpgradeTool::upgrade() (in lib/pkp/classes/cliTool/UpgradeTool.php), somewhere between $installer->execute() returning true and the final printf("Successfully upgraded...") line — but we could not reproduce the crash when manually replicating that exact same sequence in a standalone script. This suggests something specific to how the CLI tool wrapper (tools/upgrade.php → UpgradeTool::__construct/execute) is invoked or how $argv/CommandLineTool parent behavior interacts on this environment — not a database or migration defect.

Impact: Cosmetic/reporting-layer only in our case — the upgrade itself succeeded and the version registered correctly in the DB. But the exit 255 with zero diagnostic output is misleading and could cause admins to believe the upgrade failed and attempt unnecessary remediation (rollback, re-running against an already-upgraded DB, etc.), especially since set_time_limit(0) and normal error handling don’t surface anything.

Request: Could the team confirm whether there’s a known issue in UpgradeTool::upgrade() around the final success-reporting block on PHP 8.3, or advise what additional diagnostics would help pinpoint it? Happy to provide full reproduction steps/logs if useful.

What application are you using?
OJS 3.3.0-5

Additional information
Environment:

  • OJS 3.5.0.5 (upgrading from 3.5.0.4)
  • PHP 8.3.30 (CLI + FPM)
  • MariaDB 11.8.8
  • Shared hosting (Hostinger / CloudLinux)

Hi @singhphd,

A successful upgrade using the command-line upgrade tool will complete with the message…

Successfully upgraded to version 3.5.0.5

…version depending on what you’re upgrading to, of course. (There is an equivalent “upgrade successful” screen when using the web-based upgrade tool.)

If you don’t see this message on completion of the upgrade, then it’s best not to consider your upgrade successful. The upgrade tool should present error messages, but there are some conditions that could cause it to not be able to report. For example, if there’s an execution time limit configured in your PHP configuration, then the upgrade tool may not be able to present a reason for early exit.

Check your PHP error log for details.

(If OJS self-reports the new version in the database after the upgrade fails, then the likeliest cause is a plugin error. After OJS updates its own version number in the database, it gives plugins an opportunity to update.)

Regards,
Alec Smecher
Public Knowledge Project Team

upgrading with disabled plugins worked. resolved.