Upgrade stuck on "System Check in Progress"

A few weeks ago I tried to run an upgrade and it crashed out in one of the later steps and at that stage if I returned to the Upgrade page the system would lock up completely until it timed out a few minutes later.

I resolved this by moving all the items in /suitecrm/cache/upgrades to a new folder.

I may have also deleted the file from suitecrm/upload that had caused the original failure.

Since then though, if I try to upgrade, it sticks on the first page saying “System check in progress” and will stay there for ages until eventually the page times out.

So far, I have tried resetting permissions and tried a quick repair, but the problem is still there.

It creates a /temp directory in the upgrades folder with a zero byte file titled: upgrade_progress.php but apart from that nothing seems to happen.

Is there an easy way of resolving this? Is it possible to install upgrades manually or work out what has changed in the system that is causing this timeout to occur?

Any suggestions are welcomed.

What do you see in your logs at the time of the upgrade hanging?

suitecrm.log
php_errors.log

Just in case this is useful to anyone else…

I had a timeout on my upgrade page after the file upload and this put me in a continuous loop. Every time I went back to the upgrade page it would try and pick up where it left off - but would create a new temporary upload folder in the cache/upgrade folder…and would then timeout again.

I finally worked out that I needed to completely delete the temp folder containing all of the versions which it was obviously trying to scan each time. The more times I tried to rerun the installer, the more I was making the problem worse!

2 Likes

Navigate to your installation folder:

modules/UpgradeWizard/systemCheck.php
Find the line in the file that initializes the $skipDirs array and add the two folders it mentions in the comment ‘cache’, and ‘upload’, to the array initialization.

// add directories here that should be skipped when doing file permissions checks (cache/upload is the nasty one)

$skipDirs = array(
	$sugar_config ['upload_dir'],
	'.well-known',
	'.svn',
	'.git',
	'cache',
	'upload',
);
2 Likes

Great - this seemed to fix the problem. Thanks for the tip.

While this might be a valid workaround, it is not a recommended setting.

It would be better to find out why permissions are degrading in those folders (check default_permissions in config.php, check if your cron is not running as root - it shouldn’t be, check SetUID and SetGID bits on parent directories, etc.).

Also timeouts are usually solvable with tweaks to php.ini:

memory_limit
max_execution_time
max_post_size
max_vars
etc

1 Like

By the way, this old post here was kind of prophetic because this kind of problems just kept happening more and more as our packages grew. This was caused by poorly written code from SugarCRM days…

Eventually this is the Issue with all the information:

and it links to a fix that should be included in the next version (7.11.11 and 7.10.23).