Closed gdureuil closed 3 years ago
Hi. That is indeed weird.
As it is, we are missing information to debug it. Can you apply the steps in the following links?
This will help us tremendously. :+1:
In browser debugger, in network tab, I get this when clicking on a problem album (I masked tokens and cookies)
I enabled APP_DEBUG to true, but I have no more information. What can I provide you ?
I'm starting to think the problems came from artisan migrate on my latest updates. I'm using php8 as cli and fpm, and I think there were warnings during the latest migrate. Is PHP8 fully supported with Lychee ?
EDIT: I'll try restoring a backup from 2 days after last image upload and upgrade again. Will take some time.
OK i did a last test before trying a restore. I switched back to php7.4-fpm instead of php8.0-fpm for Lychee. The albums with problems seem to work now.
Seems like you have problems with php8.
Here is the new diagnostic after change php version.
Diagnostics
-------
Warning: Dropbox import not working. dropbox_key is empty.
Warning: lossless_optimization set to 1 but cwebp not found!
Warning: lossless_optimization set to 1 but svgo not found!
Warning: You may experience problems when uploading a large amount of photos. Take a look in the FAQ for details.
Info: Latest version of PHP is 8
System Information
--------------
Lychee Version (git): master (3d46ab0) - Data not in Cache
DB Version: 4.3.5
composer install: --no-dev
APP_ENV: local
APP_DEBUG: true
System: Linux
PHP Version: 7.4
Max uploaded file size: 100M
Max post size: 100M
MySQL Version: 10.3.29-MariaDB-0+deb10u1-log
Imagick: 1
Imagick Active: 1
Imagick Version: 1690
GD Version: 2.2.5
I have been using php8 for some time now on Lychee so it seems you have a regression somewhere.
I have been using php8 for some time now on Lychee so it seems you have a regression somewhere.
Lychee should be fully compatible with php8. So yes I'm surprised.
I enabled APP_DEBUG to true, but I have no more information. What can I provide you ?
you needed to go in the response tab. That is where more info would have appeared. :)
OK i'll switch back temporarily to php8-fpm to diagnose that, APP_DEBUG set to true. Here is the response on that error 500, json format.
{
"message": "round(): Argument #1 ($num) must be of type int|float, string given",
"exception": "TypeError",
"file": "/home/www-data/www/baka-gamer.net/screenshots/app/Models/Extensions/PhotoCast.php",
"line": 72,
"trace": [
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/app/Models/Extensions/PhotoCast.php",
"line": 72,
"function": "round"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/app/Actions/Album/Photos.php",
"line": 69,
"function": "toReturnArray",
"class": "App\\Models\\Photo",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/app/Actions/Album/Prepare.php",
"line": 41,
"function": "get",
"class": "App\\Actions\\Album\\Photos",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/app/Http/Controllers/AlbumController.php",
"line": 87,
"function": "do",
"class": "App\\Actions\\Album\\Prepare",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Routing/Controller.php",
"line": 54,
"function": "get",
"class": "App\\Http\\Controllers\\AlbumController",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php",
"line": 45,
"function": "callAction",
"class": "Illuminate\\Routing\\Controller",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
"line": 254,
"function": "dispatch",
"class": "Illuminate\\Routing\\ControllerDispatcher",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
"line": 197,
"function": "runController",
"class": "Illuminate\\Routing\\Route",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 695,
"function": "run",
"class": "Illuminate\\Routing\\Route",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 128,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/app/Http/Middleware/ReadCheck.php",
"line": 76,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "App\\Http\\Middleware\\ReadCheck",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php",
"line": 50,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Routing\\Middleware\\SubstituteBindings",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php",
"line": 78,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/app/Http/Middleware/VerifyCsrfToken.php",
"line": 61,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "App\\Http\\Middleware\\VerifyCsrfToken",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Session/Middleware/AuthenticateSession.php",
"line": 39,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Session\\Middleware\\AuthenticateSession",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php",
"line": 49,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\View\\Middleware\\ShareErrorsFromSession",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php",
"line": 121,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php",
"line": 64,
"function": "handleStatefulRequest",
"class": "Illuminate\\Session\\Middleware\\StartSession",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Session\\Middleware\\StartSession",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php",
"line": 37,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php",
"line": 67,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Cookie\\Middleware\\EncryptCookies",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 103,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 697,
"function": "then",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 672,
"function": "runRouteWithinStack",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 636,
"function": "runRoute",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 625,
"function": "dispatchToRoute",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 166,
"function": "dispatch",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 128,
"function": "Illuminate\\Foundation\\Http\\{closure}",
"class": "Illuminate\\Foundation\\Http\\Kernel",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/bepsvpt/secure-headers/src/SecureHeadersMiddleware.php",
"line": 21,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Bepsvpt\\SecureHeaders\\SecureHeadersMiddleware",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
"line": 21,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php",
"line": 31,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
"line": 21,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php",
"line": 40,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\TrimStrings",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php",
"line": 27,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php",
"line": 86,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/fideloper/proxy/src/TrustProxies.php",
"line": 57,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Fideloper\\Proxy\\TrustProxies",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 103,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 141,
"function": "then",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 110,
"function": "sendRequestThroughRouter",
"class": "Illuminate\\Foundation\\Http\\Kernel",
"type": "->"
},
{
"file": "/home/www-data/www/baka-gamer.net/screenshots/public/index.php",
"line": 74,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Kernel",
"type": "->"
}
]
}
Thanks for that latest info -- it provided all the clues we needed!
So the problem is triggered by videos. @ildyria couldn't reproduce it because he hates videos and probably doesn't even have any in his instance :wink:.
Thankfully it appears to be a trivial bug requiring a one-liner fix. I'm still running php7.4 though so my fix is untested. @gdureuil, would you mind giving it a spin? The fix is in #1113. If applying patches isn't your thing, you can simply replace the file Lychee/app/Models/Extensions/PhotoCast.php
in your installation with the contents of https://raw.githubusercontent.com/LycheeOrg/Lychee/fix-1110/app/Models/Extensions/PhotoCast.php. Let us know if it works!
I did a "git pull" as I see you put the fix in master. Configured my install back to php8.0 and problem albums are now working again.
Thank you very much for the fix !
Detailed description of the problem [REQUIRED]
Some of my albums have problem loading, with message "Server Error or API not found". Otehrs load OK.
Steps to reproduce the issue
Steps to reproduce the behavior: My install is at https://screenshots.baka-gamer.net and hosts gaming screenshots Try album named "A Hat In Time (SWITCH)", it loads OK. Try album named "Animal Crossing New Horizon (SWITCH)", it gives error "Server Error or API not found". Album is never accessible.
Output of the diagnostics [REQUIRED]
Browser and system
Windows 10 21H1 Family Firefox 92.0.1 x64 Edge 94.0.992.38 x64