Fatal Error Home page after upgrading from 8.2.4 to 8.4.0

Hi there, I just upgraded from 8.2.4 to 8.4.0

no problem during the update process but after this my suitecrm application is not working

After login the home page is almost blank

On apache log I found this error

PHP Fatal error: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in /var/www/html/suitecrm/public/legacy/modules/SugarFeed/SugarFeed.php:203\nStack trace:\n#0 /var/www/html/suitecrm/public/legacy/modules/SugarFeed/SugarFeed.php(203): fwrite()\n#1 /var/www/html/suitecrm/public/legacy/modules/SugarFeed/Dashlets/SugarFeedDashlet/SugarFeedDashlet.php(82): SugarFeed::getActiveFeedModules()\n#2 /var/www/html/suitecrm/public/legacy/modules/Home/index.php(226): SugarFeedDashlet->__construct()\n#3 /var/www/html/suitecrm/public/legacy/modules/Home/views/view.list.php(55): include(‘…’)\n#4 /var/www/html/suitecrm/public/legacy/include/MVC/View/SugarView.php(210): HomeViewList->display()\n#5 /var/www/html/suitecrm/public/legacy/include/MVC/Controller/SugarController.php(432): SugarView->process()\n#6 /var/www/html/suitecrm/public/legacy/include/MVC/Controller/SugarController.php(363): SugarController->processView()\n#7 /var/www/html/suitecrm/public/legacy/include/MVC/SugarApplication.php(101): SugarController->execute()\n#8 /var/www/html/suitecrm/public/legacy/index.php(52): SugarApplication->execute()\n#9 {main}\n thrown in /var/www/html/suitecrm/public/legacy/modules/SugarFeed/SugarFeed.php on line 203

I am using php 8.1

I just reset file permission using sudo chmod -R 755 on my SuiteCRM instance

Can anyone suggests me how can I fix the problem ?

Thanks in advance, Vincenzo

There are two fwrites in SugarFeed.php

One is relative to the file modules/SugarFeed/linkTypeCache.php

The other is modules/SugarFeed/moduleCache.php which must be writable by your web server user.

Don’t just change permissions, check file ownerships, that’s probably what got changed.

1 Like
  1. Find out the user that’s running the webserver

sudo ps -aux | grep apache

  1. If the user is www-data then use these commands.

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

  1. IF the user differs from www-data then adapt to this. where {user} is the user that is running the webserver.

find . -type d -not -perm 2775 -exec chmod 2775 {} ;
find . -type f -not -perm 0664 -exec chmod 0664 {} ;
find . ! -user {user} -exec chown {user}:{user} {} ;
chmod +x bin/console

1 Like

Hi @pgr thank you verymuch for your replay

I found php lines that you mentioned :slight_smile:

So suiteCRM try to write two files, linkTypeCache.php and moduleCache.php, in /var/www/html/suitecrm/public/legacy/cache/modules/SugarFeed directory

I checked the ownership of modules directory, this is the situation (partial copied/past)

root@ip-172-31-42-117:/var/www/html/suitecrm/public/legacy/cache/modules# ls -l
total 452
drwxr-sr-x 3 www-data www-data 4096 Sep 13 16:57 ACL
drwxr-sr-x 2 root root 4096 Sep 13 16:56 ACLActions
drwxr-sr-x 3 www-data www-data 4096 Sep 13 16:57 ACLRoles
drwxr-sr-x 2 root root 4096 Sep 13 16:56 AM_ProjectTemplates
drwxr-sr-x 2 root root 4096 Sep 13 16:56 AM_TaskTemplates
drwxr-sr-x 3 root root 4096 Sep 13 16:56 AOBH_BusinessHours
drwxr-sr-x 2 root root 4096 Sep 13 16:56 AOK_KnowledgeBase
drwxr-sr-x 2 root root 4096 Sep 13 16:56 AOK_Knowledge_Base_Categories
drwxr-sr-x 3 root root 4096 Sep 13 16:56 AOP_Case_Events
drwxr-sr-x 3 root root 4096 Sep 13 16:56 AOP_Case_Updates
[…]
drwxr-sr-x 3 www-data www-data 4096 Sep 13 16:57 Studio
drwxr-sr-x 2 root root 4096 Sep 13 16:56 SugarFeed
drwxr-sr-x 2 root root 4096 Sep 13 16:56 SurveyQuestionOptions
drwxr-sr-x 2 root root 4096 Sep 13 16:56 SurveyQuestionResponses
drwxr-sr-x 2 root root 4096 Sep 13 16:56 SurveyQuestions
drwxr-sr-x 2 root root 4096 Sep 13 16:56 SurveyResponses
drwxr-sr-x 2 root root 4096 Sep 13 16:56 Surveys
drwxr-sr-x 2 root root 4096 Sep 13 16:56 Tasks
drwxr-sr-x 3 root root 4096 Sep 13 16:56 TemplateSectionLine
drwxr-sr-x 3 www-data www-data 4096 Sep 13 16:57 Trackers
drwxr-sr-x 3 www-data www-data 4096 Sep 13 16:57 UpgradeWizard
drwxr-sr-x 2 root root 4096 Sep 13 16:56 UserPreferences
drwxr-sr-x 2 root root 4096 Sep 13 16:56 Users
drwxr-sr-x 2 root root 4096 Sep 13 16:56 jjwg_Address_Cache
drwxr-sr-x 2 root root 4096 Sep 13 16:56 jjwg_Areas
drwxr-sr-x 2 root root 4096 Sep 13 16:56 jjwg_Maps
drwxr-sr-x 2 root root 4096 Sep 13 16:56 jjwg_Markers
drwxr-sr-x 2 root root 4096 Sep 13 16:56 vCals

This is not good, Sept 13 is the date when I upgraded suitecrm and I don’t understand why some directory belongs to www-data and others to root.

I’ll fix this ASAP using commands suggested from @dhuntress , thank you too

Thanks to this Community :slight_smile:

Yes! File ownership it definitely is

Some are owned by www-data some are owned by root:root i see

It is definitely root folder/file ownership that’s knackering it as the www-data user does not have authority to modify files which are owned by root:root

Else all hell would break loose on the internet. :slight_smile:

1 Like

Make sure you run these in the root directory

In your case it’s /var/www/html/suitecrm

1 Like