[3.0.0-rc4] Images not found on remote server - League\\Glide\\Filesystem\\FileNotFoundException
I just went from my local to my remote server and some images are showing up others are getting a 500 error.
Using Version 3.0.0-rc4
This is showing up as the last stacktraces in storage/logs/laravel.log
production.ERROR: Could not find the image
890cc42b-6417-4f97-8680-9c77fa2a789c/20200618-124502.jpg. {"exception":"[object] (League\\Glide\\Filesystem\\FileNotFoundException(code: 0): Could not find the image
890cc42b-6417-4f97-8680-9c77fa2a789c/20200618-124502.jpg. at /var/www/example.com/web/vendor/league/glide/src/Server.php:629)
[stacktrace]
#0 /var/www/example.com/web/vendor/league/glide/src/Server.php(548): League\\Glide\\Server->makeImage()
#1 /var/www/example.com/web/vendor/area17/twill/src/Services/MediaLibrary/Glide.php(95): League\\Glide\\Server->getImageResponse()
#2 /var/www/example.com/web/vendor/area17/twill/src/Http/Controllers/Front/GlideController.php(12): A17\\Twill\\Services\\MediaLibrary\\Glide->render()
#3 /var/www/example.com/web/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(46): A17\\Twill\\Http\\Controllers\\Front\\GlideController->__invoke()
#4 /var/www/example.com/web/vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#5 /var/www/example.com/web/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#6 /var/www/example.com/web/vendor/laravel/framework/src/Illuminate/Routing/Router.php(798): Illuminate\\Routing\\Route->run()
#7 /var/www/example.com/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
Thumbnails are showing up correctly in the backend.
Perhaps relevant when I try to run
php artisan cache:clear I get
ERROR Failed to clear cache. Make sure you have the appropriate permissions. `
Thanks for any guidance or help...12 Replies
Hi @undersound, make sure your remote deployment has correct file permissions. See https://coderflex.com/blog/2-ways-to-setup-file-permissions-for-laravel-in-production
Coderflex
2 ways to setup file permissions for laravel in production | coderf...
File Permission is the most important thing on the web in general and defines who you are and what to do on the web, in the other words by giving the permission to specific files, you are telling a story of how and what other users can do with your file.
Hi @ifox.dev , which folder in particular do I need to take into account? ./storage right?
If i temporarily do chown -R www-data: and chmod -R 777 I am still getting no result
thanks for the post btw, very helpful, could not find a proper one, I am coming from drupal so it is a bit new to me this laravel thing π
storage and bootstrap/cache
ok let me check those
the glide eror might be unrelated tho
Did you make sure to put the files in the correct location under storage?
me@venus:/var/www/example.com/web$ ll bootstrap/cache/
total 372
drwxrwxr-x 2 me www-data 4096 Apr 5 12:02 ./
drwxr-xr-x 3 me www-data 4096 Apr 5 12:01 ../
-rwxrwxr-- 1 me www-data 14 Apr 5 12:01 .gitignore*
-rw-r--r-- 1 root root 34008 Apr 5 12:02 config.php
-rwxrwxr-- 1 me www-data 2728 Apr 5 12:01 packages.php*
-rw-r--r-- 1 root root 305052 Apr 5 12:02 routes-v7.php
-rwxrwxr-- 1 me www-data 19877 Apr 5 12:01 services.php*
me@venus:/var/www/example.com/web$ ll storage/
total 20
drwxrwxr-x 5 me www-data 4096 Jan 31 16:05 ./
drwxr-xr-x 14 me www-data 4096 Apr 5 12:20 ../
drwxrwxr-x 4 me www-data 4096 Mar 18 15:31 app/
drwxrwxr-x 6 me www-data 4096 Jan 31 16:05 framework/
drwxrwxr-x 2 me www-data 4096 Apr 5 12:18 logs/
I am not sure, I am uploading images via the backend through an image field
Nothing seems to happen in storage/app/public/uploads/ and storage/app/glide_cache/oh ok sorry I thought you were syncing your local uploads to a remote and they weren't showing up, but you're just trying to upload some from the media library
no error when uploading?
the record is showing up in the media library?
Oh you said they work in the backend ?
so how are you using them in your frontend for the ones that fail?
Yeah I just deployed my local instance whereI synced the code files through jenkins and imported the local db on production
Some show up some don't
In the frontend as well as in the media library
So i uploaded some images through an image field in the backend locally, the showed up in the frontend and then I deployed the website to production
ok just uploadeon through media library and tailing the laravel.log gave me a missing gd extension , arghhh, let me install that quickly
Ok everything is working now, can't believe I forgot that one π thanks
Still getting this one though
Failed to clear cache. Make sure you have the appropriate permissions.
Do read some stuff about it but this will probably be solved by following your link I suppose?Stack Overflow
Laravel showing "Failed to clear cache. Make sure you have the appr...
Laravel was displaying to me "Access denied for user 'homestead'@'localhost' (using password: YES)". One solution for this was clearing the cache and the config cache stored, all this with these th...
@undersound Have you managed to solve this? I bumped into the same problem when switching from local to remote AWS S3
Hey, do you mean the failed to clear cache error or the images not showing up in general? For the latter it was a missing gd extension in my case
I see, thankyou!