Firemaps's avatar

Errors after composer update in production

Lesson learnt, don't run composer update in production.

I ran composer update in production and encountered some errors.

I was not able to log into my site. Getting error "UnexpectedValueException The stream or file "/home/forge/mysite.com/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied"

I was able to enable log in with ssh sudo chmod 777 -R storage

the storage directory now has a green background in terminal when I ssh.

However, now I cannot upload images with dropzone, a core feature of my site.

Getting error, which was previously working FileException Unable to write in the "uploads/1/photos" directory in File.php (line 113) at File->getTargetFile('uploads/1/photos', 'IMG_3660.jpg')

when I $ ls -l inside /public/uploads, I see 2 different sets of permissions.

// user 1 = drwxr-xr-x 3 forge forge 4096 Apr 26 00:11 1 // user 103 = drwxrwxr-x 2 forge forge 4096 Apr 26 00:11 103

What has caused this mismatch? How can I fix??

Really need some help or direction here please :-(

0 likes
2 replies
Firemaps's avatar

How I fixed this (With the guidance of Ben Johnson on gitter, a true hero)

ssh

Check if forge is set as the user $ ps -aux | grep "php"

if you get www-data and not forge, you might have the same problem as me

$ sudo chown -R forge:www-data /home/forge/mysite.com

$sudo chmod -R 770 /home/forge/mysite.com

Everything works as expected for me again

Thanks to Ben!!! Ben for president!!

Edit: git pull on server was not working

chgrp -R forge:www-data /home/forge/mysite.com // sorted this

$ git pull // works

Please or to participate in this conversation.