Strange error after it was working fine


My Setup

Important information about your setup

  1. Shared or Dedicated Server? Digital Ocean Same as the video
  2. Did your setup the server or install Magento yourself? My self
  3. What are your server specifications?Same as the video
  4. What version of Magento are you using? latest

What I’m trying to do

I followed the tutorial and everthing was fine after it worked for some time the front end and the back-end it start to load forever and don’t know why because I didn’t change anything after that I restored it form the snapshot to the point before installing Sample Data after that it worked again for like 10 minutes (this time I didn’t install the sample data) then it’s stopped working, when I try to access the back end or front end it show me :

I tried again to restore it from the snapshot but it’s still the same error.(the first time the error was different it wasn’t loading at all after restoring it worked fine for like 10 minutes, the second restore didn’t work and shows the error above in the screenshot above)

Hi @Saleh_Alnaggar and welcome!

Really slow load times can mostly be attributed to the Magento Cache being turned off. Sometimes after an update or other task these options can reset too Disabled.

The thing with there exception errors is that 99% of the time anything after the third line is mostly garbage. What stands out to me here is “…directory permission is read-only”.

Here are some leads in order of likelyness…

Lead 1
Sometimes, I’ve found that after loading a snapshot I have to manually delete some cached folders. Try running this from the Magento root directory as the “magento” user:

rm -rf var/cache var/log var/page_cache var/view_preprocessed

And then clear your Magento cache:

/bin/magento c:c

Lead 2
Failing that, just make sure that mysql hasn’t crashed. You can restart the service by running the following command as “root” user from any directory:

sudo service mysql restart

Lead 3
Failing both of those, you might want to try resetting your folder/file permissions. This is a long-shot but worth trying if everything else has failed. Run this from the Magento root directory as the “magento” user:

find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} + && find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} + && chmod u+x bin/magento

Thank you so much for your help. nothing have worked still the same I even tried to restore it a few times from the snapshot that I have take for the clean installation before installing the sample data but didn’t work. I can’t understand why it worked okay when I restored it the first time, I think I’m gonna start over from the begging by reinstall the Ubuntu 16.04.6 x64

That’s a shame. Before you do, try this one last thing:

Run these 3 commands from the Magento root directory as the “magento” user:

rm -rf generated/
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f en_US

Sorry I already did the reinstall, It got me angry because I did everything right and it worked for some time without any problem then got this problem I will try that if the problem comes back and again thank you so much for trying helping me, Have a nice day

1 Like

No problem. Good luck :+1: