Upgrade has resulted in error 500

Can someone please help me - I’m desperate to get my CRM up and running again?!

Last job for Friday I thought I’d upgrade my scrm 7.12.7 to 7.12.8. Should be a quick an easy job I thought.
I made a backup copy of the CRM directory.
After running the upgrade wizard it failed due to a php file size limit. So I increased these.
However, then I could not log back in to SCRM. Sometimes I get to the login screen but then after logging in I get error 500. Trying to to get back to the login screen then immediately gives me the error 500.
URL is https://myurl/crm/index.php?module=Home&action=index

Ok. So I’ll just copy my backup back to the original directory.

Arghh! I still can’t login. How can this be??!!

Can anyone please explain what might be going on and what I could try, to get my CRM back PLEASE?

I have now noticed that if I delete the cookies for the site, I can get to the login screen. However logging-in gets me an error 500 at the URL as above.

Thanks
Terry

I noticed that the suitecrm.log is filling with this;

Fri Nov 25 05:42:01 2022 [3807810][-none-][FATAL] cron.php: missing expected allowed_cron_users entry in config.php. No cron user checks will occur.
Fri Nov 25 05:42:01 2022 [3807810][1][FATAL] Job failed: ./index.php?module=jjwg_Maps&entryPoint=jjwg_Maps&cron=1
Fri Nov 25 05:42:01 2022 [3807810][1][FATAL] Job 7c50db63-5c9b-c6a9-398e-638055fcf2dc (Geocode processing) failed in CRON run
Fri Nov 25 05:42:01 2022 [3807810][1][FATAL] Job 70856b0a-8d22-c0ce-95a8-638055c7a99c (Check Inbound Mailboxes) failed in CRON run
Fri Nov 25 05:43:02 2022 [3809952][-none-][FATAL] cron.php: missing expected allowed_cron_users entry in config.php. No cron user checks will occur.
Fri Nov 25 05:43:02 2022 [3809952][1][FATAL] Job failed: ./index.php?module=jjwg_Maps&entryPoint=jjwg_Maps&cron=1
Fri Nov 25 05:43:02 2022 [3809952][1][FATAL] Job 5f6fedce-e5de-10bb-2963-638055cfdb31 (Geocode processing) failed in CRON run
Fri Nov 25 05:43:02 2022 [3809952][1][FATAL] Job 5c7749ec-04ab-dce2-8748-6380555caf8b (Check Inbound Mailboxes) failed in CRON run
Fri Nov 25 05:44:01 2022 [3812431][-none-][FATAL] cron.php: missing expected allowed_cron_users entry in config.php. No cron user checks will occur.
Fri Nov 25 05:44:02 2022 [3812431][1][FATAL] Job f087777a-ecbb-ae51-93cb-638056a2adef (Check Inbound Mailboxes) failed in CRON run

The only reference to cron in my my config.php is as follows;

array (
‘max_cron_jobs’ => 20,
‘max_cron_runtime’ => 30,
‘min_cron_interval’ => 30,
),

Any ideas please?

I suspect that you simply ruined permissions with the file copies. Possibly you were logged in as root (or as your personal user) and when you copied, your files lost their www-data (or equivalent) ownerships. So now SuiteCRM can’t write (or even read) files and is failing all over.

Based on pgr’s reply, I don’t know if this might help with permissions…

Take a look in logs/prod at prod.log. This might show what permission problems you could be having.

Thank you for your replies @pgr @fanpilot.

I have checked and reset ownership and permissions as per install guide;

sudo chown -R www-data:www-data . (replaced with my user and group)
sudo chmod -R 755 .
sudo chmod -R 775 cache custom modules themes data upload
sudo chmod 775 config_override.php 2>/dev/null

Checked file ownership with ls -l All is good.

@fanpilot I’m not sure what you mean by logs/prod at prod.log. I cannot find any such file. I am on a hosted system with no access to php directly.

I’m no further ahead, I still get presented with an error 500 after login screen. Interestingly cron jobs are still running, because I have a schedule that sends out a birthday email to contacts on their birthdays each morning at 7am. It’s still emailing them out! I just cannot access Suitecrm!

I really need to get access as soon as possible. So…

What are the implications if I simply reinstall 7.12.7 (or maybe install the new 7.12.8) over the top of what is there? Or can I somehow run upgrade again??

Thanks for your help.

On a little more investigation I find this in the web server log errors:

[Fri Nov 25 14:14:37.605211 2022] [core:crit] [pid 3107725:tid 47623586645760] (13)Permission denied: [client XXX.XX.XXX.XXX:0] AH00529: /home1/terryl/public_html/crm/public/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that ‘/home1/terryl/public_html/crm/public/’ is executable
[Fri Nov 25 14:14:33.283888 2022] [core:crit] [pid 3107725:tid 47623584544512] (13)Permission denied: [client XXX.XX.XXX.XXX:0] AH00529: /home1/terryl/public_html/crm/public/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that ‘/home1/terryl/public_html/crm/public/’ is executable
[Fri Nov 25 13:52:00.691864 2022] [core:crit] [pid 2800672:tid 47623588747008] (13)Permission denied: [client XXX.XX.XXX.XXX:0] AH00529: /home1/terryl/public_html/crm/cache/jsLanguage/UpgradeWizard/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that ‘/home1/terryl/public_html/crm/cache/jsLanguage/UpgradeWizard/’ is executable, referer: https://mysite/crm/index.php

Looking at the times, this was when the upgrade was run and when it all seems to have gone wrong. No web errors since.

The log folder is in your install directory…

so… <install dir - like crm>/logs/prod/

I don’t know what it is on Linux tho.

@fanpilot he’s using 7.x, what you’re saying is for 8.x

@TerryL have you been checking also php_errors.log?

The location of that is defined in your php.ini

The following is in my error_log

[25-Nov-2022 21:19:47 UTC] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 32768 bytes) in /home/terryl/public_html/wp-content/plugins/ocean-extra/includes/freemius/includes/class-freemius.php on line 16597
[25-Nov-2022 21:19:55 UTC] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 32768 bytes) in /home/terryl/public_html/wp-content/plugins/ocean-extra/includes/freemius/includes/class-freemius.php on line 16597
[25-Nov-2022 21:19:57 UTC] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 32768 bytes) in /home/terryl/public_html/wp-content/plugins/ocean-extra/includes/freemius/includes/class-freemius.php on line 16597
[25-Nov-2022 21:20:00 UTC] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 32768 bytes) in /home/terryl/public_html/wp-content/plugins/ocean-extra/includes/freemius/includes/class-freemius.php on line 16597
[25-Nov-2022 23:03:10 UTC] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 32768 bytes) in /home/terryl/public_html/wp-content/plugins/ocean-extra/includes/freemius/includes/class-freemius.php on line 16597
[25-Nov-2022 23:03:11 UTC] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 32768 bytes) in /home/terryl/public_html/wp-content/plugins/ocean-extra/includes/freemius/includes/class-freemius.php on line 16597
[26-Nov-2022 00:25:11 UTC] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 32768 bytes) in /home/terryl/public_html/wp-content/plugins/ocean-extra/includes/freemius/includes/class-freemius.php on line 16597

Seems to me that there should be ample memory.

Aha… I just noticed, the above is occuring in my Wordpress site. On trying to get into the admin of wordpress i get an error 500.

Maybe it’s not a SuiteCRM problem after all. What the…??

OK. I’m sitting here red-faced. After realising there was a problem with my other website as well, I started looking at php version settings and memory settings. After a bit of fiddling and website plugin updating, I seem to have eliminated the problem.

I thank you @pgr & @fanpilot for your input. It was looking in the errors_log that finally hinted towards the problem.

Now the question is… do I dare try to upgrade to SuiteCRM 7.12.8 ???

Is using the upgrade wizard the best way to go? Any tips before I try it again?

The upgrade to 7.12.8 should be a breeze, just make sure your system is healthy before you start, navigate around, keep an eye on the logs.

Have a full backup ready - both files and full dump of database (a VM snapshot will also do just fine, and is much easier)

Ok, so I attempted the 7.12.7 → 7.12.8 upgrade using the upgrade wizard again. Here’s what happened…

During the preflight I got a ‘405 not allowed nginx’. I then reloaded the page and I was back at the upgrade-wizard. It said the preflight had passed. A quick look at the SCRM error_log showed this;

Error_log in Suitecrm
[26-Nov-2022 21:17:58 UTC] PHP Notice: Undefined variable: installdefs in /home/terryl/public_html/crm/ModuleInstall/ModuleScanner.php on line 964
[27-Nov-2022 10:19:26 Pacific/Auckland] PHP Notice: Trying to get property ‘id’ of non-object in /home/terryl/public_html/crm/modules/InboundEmail/InboundEmail.php on line 4581
[27-Nov-2022 10:19:26 Pacific/Auckland] PHP Notice: Trying to get property ‘filename’ of non-object in /home/terryl/public_html/crm/modules/InboundEmail/InboundEmail.php on line 4603
[27-Nov-2022 10:19:26 Pacific/Auckland] PHP Notice: Undefined property: stdClass::$disposition in /home/terryl/public_html/crm/modules/InboundEmail/InboundEmail.php on line 4605

I decided to push on, so i clicked next…

again I got the same 405 error screen. Reload did not get me back immediately like previously but back button got me there eventually, back at the upgrade-wizard screen.

It was still at the same position, that is hit next for preflight.

A quick look at the SCRM logs showed this;

upgradeWizard.log
Sat, 26 Nov 2022 21:29:16 +0000 [UpgradeWizard] - Backing up file: /home/terryl/public_html/crm/export.php
Sat, 26 Nov 2022 21:29:16 +0000 [UpgradeWizard] - file backup done.
Sat, 26 Nov 2022 21:29:16 +0000 [UpgradeWizard] - Running pre_install()…
Sat, 26 Nov 2022 21:29:16 +0000 [UpgradeWizard] - pre_install() done.
Sat, 26 Nov 2022 21:29:16 +0000 [UpgradeWizard] - Commit step finished SugarMerge run with the following results:Array
(
[Contacts] => Array
(
)

[Emails] => Array
    (
    )

[Accounts] => Array
    (
    )

)

Sat, 26 Nov 2022 21:29:16 +0000 [UpgradeWizard] - Starting file copy process…
Sat, 26 Nov 2022 21:31:40 +0000 [UpgradeWizard] - File copy done.
Sat, 26 Nov 2022 21:31:40 +0000 [UpgradeWizard] - Starting post_install()…
Sat, 26 Nov 2022 21:31:40 +0000 [UpgradeWizard] - Running post_install.
Sat, 26 Nov 2022 21:31:40 +0000 [UpgradeWizard] - Update Config
Sat, 26 Nov 2022 21:31:40 +0000 [UpgradeWizard] - Upgrading the database from 6.5.25 to version
Sat, 26 Nov 2022 21:31:40 +0000 [UpgradeWizard] - Running SQL file /home/terryl/public_html/crm/cache/upgrades/temp/tbTEoO/scripts/65x_to__mysql.sql
Sat, 26 Nov 2022 21:31:40 +0000 [UpgradeWizard] - *** ERROR: Schema change script [/home/terryl/public_html/crm/cache/upgrades/temp/tbTEoO/scripts/65x_to__mysql.sql] could not be found!
Sat, 26 Nov 2022 21:31:40 +0000 [UpgradeWizard] - Rebuilding JS Langauages
Sat, 26 Nov 2022 21:31:40 +0000 [UpgradeWizard] - Rebuilding Dashlets

SuiteCRM error_log
[26-Nov-2022 21:29:16 UTC] PHP Warning: chown(): UploadStream::stream_metadata is not implemented! in /home/terryl/public_html/crm/include/utils/sugar_file_utils.php on line 363
[26-Nov-2022 21:29:16 UTC] PHP Warning: chown(): UploadStream::stream_metadata is not implemented! in /home/terryl/public_html/crm/include/utils/sugar_file_utils.php on line 363
[26-Nov-2022 21:29:16 UTC] PHP Notice: Undefined index: installing in /home/terryl/public_html/crm/cache/upgrades/temp/tbTEoO/scripts/pre_install.php on line 63
[26-Nov-2022 21:29:47 UTC] PHP Fatal error: Uncaught Error: Class ‘ComposerAutoloaderInit2329c4a8a893839ff19cd60887a1e4be’ not found in /home/terryl/public_html/crm/vendor/autoload.php:7
Stack trace:
#0 /home/terryl/public_html/crm/include/entryPoint.php(65): require_once()
#1 /home/terryl/public_html/crm/index.php(47): require_once(’/home/terryl/pu…’)
#2 {main}
thrown in /home/terryl/public_html/crm/vendor/autoload.php on line 7
[26-Nov-2022 21:29:53 UTC] PHP Fatal error: Uncaught Error: Class ‘ComposerAutoloaderInit2329c4a8a893839ff19cd60887a1e4be’ not found in /home/terryl/public_html/crm/vendor/autoload.php:7
Stack trace:
#0 /home/terryl/public_html/crm/include/entryPoint.php(65): require_once()
#1 /home/terryl/public_html/crm/index.php(47): require_once(’/home/terryl/pu…’)
#2 {main}
thrown in /home/terryl/public_html/crm/vendor/autoload.php on line 7
[26-Nov-2022 21:30:03 UTC] PHP Fatal error: Uncaught Error: Class ‘ComposerAutoloaderInit2329c4a8a893839ff19cd60887a1e4be’ not found in /home/terryl/public_html/crm/vendor/autoload.php:7
Stack trace:
#0 /home/terryl/public_html/crm/include/entryPoint.php(65): require_once()
#1 /home/terryl/public_html/crm/cron.php(48): require_once(’/home/terryl/pu…’)
#2 {main}
thrown in /home/terryl/public_html/crm/vendor/autoload.php on line 7
[26-Nov-2022 21:31:03 UTC] PHP Fatal error: Uncaught Error: Class ‘ComposerAutoloaderInit2329c4a8a893839ff19cd60887a1e4be’ not found in /home/terryl/public_html/crm/vendor/autoload.php:7
Stack trace:
#0 /home/terryl/public_html/crm/include/entryPoint.php(65): require_once()
#1 /home/terryl/public_html/crm/cron.php(48): require_once(’/home/terryl/pu…’)
#2 {main}
thrown in /home/terryl/public_html/crm/vendor/autoload.php on line 7
[26-Nov-2022 21:31:40 UTC] PHP Notice: Undefined index: post_install in /home/terryl/public_html/crm/modules/UpgradeWizard/uw_utils.php on line 3186
[26-Nov-2022 21:31:44 UTC] PHP Warning: dir(/home/terryl/public_html/crm/cache/upgrades/temp/tbTEoO/scripts/files_to_add_post/modules/): failed to open dir: No such file or directory in /home/terryl/public_html/crm/include/dir_inc.php on line 62
[26-Nov-2022 21:31:44 UTC] PHP Warning: dir(/home/terryl/public_html/crm/cache/upgrades/temp/tbTEoO/scripts/files_to_add_post/themes/): failed to open dir: No such file or directory in /home/terryl/public_html/crm/include/dir_inc.php on line 62
[26-Nov-2022 21:31:48 UTC] PHP Warning: include(upload://upgrades/patch/SuiteCRM-Upgrade-7.12.x-to-7.12.8-restore/include/modules.php): failed to open stream: “UploadStream::stream_open” call failed in /home/terryl/public_html/crm/modules/UpgradeWizard/uw_utils.php on line 3643
[26-Nov-2022 21:31:48 UTC] PHP Warning: include(): Failed opening ‘upload://upgrades/patch/SuiteCRM-Upgrade-7.12.x-to-7.12.8-restore/include/modules.php’ for inclusion (include_path=’/home/terryl/public_html/crm:/home/terryl/public_html/crm/include/…:.:/opt/alt/php74/usr/share/pear’) in /home/terryl/public_html/crm/modules/UpgradeWizard/uw_utils.php on line 3643
[26-Nov-2022 21:31:48 UTC] PHP Notice: Undefined variable: moduleList in /home/terryl/public_html/crm/modules/UpgradeWizard/uw_utils.php on line 3644
[26-Nov-2022 21:31:48 UTC] PHP Notice: Undefined index: additional_step in /home/terryl/public_html/crm/modules/UpgradeWizard/index.php on line 502
[26-Nov-2022 21:31:50 UTC] PHP Notice: Undefined index: additional_step in /home/terryl/public_html/crm/modules/UpgradeWizard/index.php on line 502
[26-Nov-2022 21:32:02 UTC] PHP Warning: file_put_contents(cache/modules/Schedulers/lastrun): failed to open stream: No such file or directory in /home/terryl/public_html/crm/include/SugarQueue/SugarCronJobs.php on line 119
[26-Nov-2022 22:04:13 UTC] PHP Notice: Undefined index: ext2 in /home/terryl/public_html/crm/include/InlineEditing/InlineEditing.php on line 521
[26-Nov-2022 22:04:23 UTC] PHP Notice: Undefined index: ext2 in /home/terryl/public_html/crm/include/InlineEditing/InlineEditing.php on line 521
I decided to cancel the the upgrade-wizard. All seems to still run fine, but strangely the ‘ABOUT’ information shows;

Version 7.12.8
Sugar Version 6.5.25 (Build 344)

Did it upgrade after all ??? I don’t think so, not without issues anyway.

Any ideas as to what’s going on here please?

You can see the top-right menu, in the about option, if you’re on the new version or not.

It still looks unhealthy, I’m afraid. There really should be no web server 405 errors, and no complaints about not being able to read or write files…

If you need to retry the upgrade, clear the entire “cache/upgrades/temp” directory first, that sometimes fixes things.

Happy New Year to you all,

OK, so I’m having another go at upgrading from 7.12.7 → 7.13.0 and I could really do with some help PLEASE :slight_smile:

I started the upgrade and got the dreaded error screen again

error_log:

[12-Jan-2023 04:29:12 UTC] PHP Notice: Undefined variable: installdefs in /home/terryl/public_html/crm/ModuleInstall/ModuleScanner.php on line 964
[12-Jan-2023 04:30:33 UTC] PHP Notice: Undefined index: sqlSkippedQueries in /home/terryl/public_html/crm/modules/UpgradeWizard/commit.php on line 85
[12-Jan-2023 04:30:33 UTC] PHP Warning: chown(): UploadStream::stream_metadata is not implemented! in /home/terryl/public_html/crm/include/utils/sugar_file_utils.php on line 363
[12-Jan-2023 04:30:33 UTC] PHP Warning: chown(): UploadStream::stream_metadata is not implemented! in /home/terryl/public_html/crm/include/utils/sugar_file_utils.php on line 363
.
. lots of these!
.
[12-Jan-2023 04:32:12 UTC] PHP Warning: chown(): UploadStream::stream_metadata is not implemented! in /home/terryl/public_html/crm/include/utils/sugar_file_utils.php on line 363
[12-Jan-2023 04:32:12 UTC] PHP Notice: Undefined index: installing in /home/terryl/public_html/crm/cache/upgrades/temp/awsfN4/scripts/pre_install.php on line 63
[12-Jan-2023 04:32:18 UTC] PHP Fatal error: Uncaught Error: Class ‘ComposerAutoloaderInit2329c4a8a893839ff19cd60887a1e4be’ not found in /home/terryl/public_html/crm/vendor/autoload.php:7
Stack trace:
#0 /home/terryl/public_html/crm/include/entryPoint.php(65): require_once()
#1 /home/terryl/public_html/crm/index.php(47): require_once(’/home/terryl/pu…’)
#2 {main}
thrown in /home/terryl/public_html/crm/vendor/autoload.php on line 7
[12-Jan-2023 04:32:36 UTC] PHP Fatal error: Uncaught Error: Class ‘ComposerAutoloaderInit2329c4a8a893839ff19cd60887a1e4be’ not found in /home/terryl/public_html/crm/vendor/autoload.php:7
Stack trace:
#0 /home/terryl/public_html/crm/include/entryPoint.php(65): require_once()
#1 /home/terryl/public_html/crm/index.php(47): require_once(’/home/terryl/pu…’)
#2 {main}
thrown in /home/terryl/public_html/crm/vendor/autoload.php on line 7
[12-Jan-2023 04:32:44 UTC] PHP Fatal error: Uncaught Error: Class ‘ComposerAutoloaderInit2329c4a8a893839ff19cd60887a1e4be’ not found in /home/terryl/public_html/crm/vendor/autoload.php:7

It looks like the ComposerAutoloaderInit2329c4a8a893839ff19cd60887a1e4be does not match what is in autoload.php

Oh ok…
Eventually it looks like the upgrade completed anyway.
ABOUT in SuiteCRM says Version 7.13.0 Sugar Version 6.5.25 (Build 344)
So far everything seems to be working.

I also notice the following in error_log now;
[12-Jan-2023 05:18:14 UTC] PHP Notice: Undefined index: schema_change in /home/terryl/public_html/crm/modules/UpgradeWizard/commit.php on line 78
[12-Jan-2023 05:18:14 UTC] PHP Notice: Undefined index: sqlSkippedQueries in /home/terryl/public_html/crm/modules/UpgradeWizard/commit.php on line 85
[12-Jan-2023 05:18:14 UTC] PHP Notice: Undefined index: current_db_version in /home/terryl/public_html/crm/modules/UpgradeWizard/commit.php on line 456
[12-Jan-2023 05:18:14 UTC] PHP Notice: Undefined index: target_db_version in /home/terryl/public_html/crm/modules/UpgradeWizard/commit.php on line 456
[12-Jan-2023 05:18:14 UTC] PHP Notice: Undefined index: sugarMergeRunResults in /home/terryl/public_html/crm/modules/UpgradeWizard/commit.php on line 635
[12-Jan-2023 05:18:14 UTC] PHP Warning: Invalid argument supplied for foreach() in /home/terryl/public_html/crm/modules/UpgradeWizard/commit.php on line 635

Is there anything here that anyone can recommend I fix? Is there anything I should be concerned about?

Thanks Terry

If the “about” says it’s 7.13, then it is.

I wouldn’t worry too much as long as there are no FATALs, going forward. If there are, and they are referencing the “vendor” directory, you do this:

  • backup your vendor directory.
  • grab a full 7.13 package (not an upgrade) from the downloads site
  • unzip it somewhere and move the entire “vendor” directory from the package into your installation.

The same could be achieved by running composer, but for people unfamiliar with composer perhaps this will make things simpler.