Upgrading from 8.5.1 to 8.8.0 resulting in 500 Error

Even on a clean 8.5.1 installation thatā€™s working fine, weā€™re getting the same results after upgrading to 8.8.0.
500 Error at the browser and nothing getting logged that can point us in the right direction. Itā€™s almost as if suitecrm isnā€™t even starting because suitecrm.log is empty (0).
We havenā€™t configured LetsEncrypt yet and hosting on AWS EC2 with a subdomain (vs just using IP address)

Hereā€™s the configuration:
Ubuntu 24.04
MariaDB: 10.11.8
PHP: 8.2.27
Apache2: 2.4.63

I know a 500 is the most generic of error messages but any ideas are welcome.
Additionally, itā€™s almost like the upgrade isnā€™t completing. e.g., the upgradeWizard.log file is present in the legacy folder before the upgrade, but not after

Cheers and Thanks

Are you checking the php_errors.log as defined in your php.ini?

Yes, and Iā€™m trying an upgrade from 8.5.1 to 8.7.1 this time, with the same results. ā€œNo, noā€¦itā€™s not youā€¦itā€™s Me.ā€ Error below. But it doesnā€™t make sense because I reset permissions 3 times throughout the upgrade steps. www-data:www-data plus 2775 on all directories & 0644 on all files. The suitecrm/cache/prod/ has these perms as well.
Am I missing a permission on the initial 8.5.x install thatā€™s prohibiting the upgrade to run properly? Thanks for any advice.

PHP Fatal error: Uncaught RuntimeException: Unable to write in the ā€œcacheā€ directory (/var/www/html/suitecrm/cache/prod). in /var/www/html/suitecrm/vendor/symfony/http-kernel/Kernel.php:601\nStack trace:\n#0 /var/www/html/suitecrm/vendor/symfony/http-kernel/Kernel.php(505): Symfony\Component\HttpKernel\Kernel->buildContainer()\n#1 /var/www/html/suitecrm/core/backend/Kernel.php(112): Symfony\Component\HttpKernel\Kernel->initializeContainer()\n#2 /var/www/html/suitecrm/vendor/autoload_runtime.php(37): App\Kernel->init()\n#3 /var/www/html/suitecrm/public/index.php(5): require_once(ā€˜ā€¦ā€™)\n#4 {main}\n thrown in /var/www/html/suitecrm/vendor/symfony/http-kernel/Kernel.php on line 601, referer: http://suitecrm.xxxxxxxxxxxxxxxx.com/

There are 4 commands. Maybe your user is not www-data

Also, check command for clear the symfony cache

You donā€™t need to change anything on the older one.

looks like permission issue. Also checkout the below doc.

Here is my suggestion:

  1. run chmod and chown command on your downloaded zip file after you move it to that folder.
  2. Use mv command to change the name to a simpler form.

For example,

mv SuiteCRM-8.8.0 suitecrm

Then run,

sudo ./bin/console suitecrm:app:upgrade -t suitecrm

Thanks for the ideas: Iā€™ve done all that youā€™ve suggested, including renaming the zip to something simpler. But one of your suggestions caught my eye.
What did you mean by " There are 4 commands. Maybe your user is not www-data" ?
Should I be running the install as www-data instead of as root?
Cheers

Set the required permissions

If you are using the terminal you can do this by running:

find . -type d -not -perm 2755 -exec chmod 2755 {} \;

find . -type f -not -perm 0644 -exec chmod 0644 {} \;

find . ! -user www-data -exec chown www-data:www-data {} \;

chmod +x bin/console

Please have in mind that:

  • The user and group name (in the above example www-data ) needs to be replaced by the actual system user and group that your webserver runs under. This varies depending on your operating system. Common web server users are as follows:

    • www-data (Ubuntu Linux/Apache)
    • apache (Linux/Apache)

Also, check the site_url in your config.php file.

Yep, did those steps 3 times throughout the install.
Once after the download of the zip to the tmp/packages/upgrade/ directory,
After the first upgrade command
and
After the upgrade-finalize command.
Each time with no errors other than the typical deprecated warnings that occur at the start of each step.

And Iā€™m on Ubuntu 24.04 using Apache

php.ini file error_reporting
2.Setting the following in php.ini would help get rid of these errors*

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE & ~E_WARNING

Restart your Apache.


Check web root in the apache? Is it set still /var/www/html/suitecrm/public?


I do not know what are we missing here. It should run smoothly.

  1. Got the error reporting just like yours. For both php.ini files (in apache and cli)

  2. apache is pointing at /var/www/html/suitecrm/public
    <VirtualHost *:80>
    DocumentRoot /var/www/html/suitecrm/public
    <Directory /var/www/html/suitecrm/public>
    Options FollowSymLinks MultiViews
    AllowOverride All
    Require all granted

I did notice that I forgot to fix the RewriteBase in .htaccess this time before the upgrade. The one where you trim it back to just ā€œ/legacy/ā€. Thatā€™s still needed right?

Iā€™m going to rollback and fix that RewriteBase then attempt another upgrade.

Cheers

Yes, you need that. In the below file.

/var/www/html/suitecrm/public/legacy/.htaccess

Set to:

RewriteBase /legacy

Yes. Without the last ā€œ/ā€? Just the first one in front of legacy?

Yes, it should work without adding / after legacy. If it did not wok for you, then add in the end and try again.

1 Like

Quick question.
How do you feel about the Metadata Merge Modes on the ā€œfinalizeā€ step.

Iā€™m thinking something like:
root@suitecrm:/var/www/html/suitecrm# ./bin/console suitecrm:app:upgrade-finalize -t suitecrm -m override

By the way, those stupid PHP Deprecated notices still show up at the top of the ā€œ./bin/console suitecrm:app:upgrade -t suitecrmā€ step.

But all Green on the upgrade, including the Successfully installed package & Successfully cleared cache.

Maybe it is not mandatory step to do. Why you want to run that?

Did you restart your web server and php services once you update your php.ini file? :thinking:

systemctl restart php8.2-fpm

systemctl restart apache2

Before the upgrade? Just the apache.
Wait, where in your instructions (Webserver Setup Guide :: SuiteCRM Documentation) does it say to install php8.2-fpm?

This is my install baseline tools step:

sudo apt-get install apache2 apache2-utils libapache2-mod-php8. 2 php8. 2 php8. 2 -common php8. 2 -curl php8. 2 -xml php8. 2 -mysql php8. 2 -mbstring php8. 2 -zip php8. 2 -imap php8. 2 -gd libpcre3 libpcre3-dev zlib1g zlib1g-dev mariadb-server unzip

Try out these

  1. Restart your apache2 web server

systemctl restart apache2

  1. Set log level = FATAL

Admin ā†’ System settings ā†’ Log section

And let me know if your deprecation errors hide from the screen or not.