route:cache on PHP 7.4 Erroneous data format for unserializing #31056
-
Description:I was able to replicate this on Homestead and production, I was not able to reproduce this on older PHP version. The issue is that if you run artisan route:cache it will cache successfully, but at the moment of going to it via a browser it will throw an error: Steps To Reproduce:
|
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 6 replies
-
Also happening on 7.3.X on any server we deploy to (Plesk on Debian). We're not able to recreate the problem locally - the exception is handled as warning only. Laravel 6.10.1 |
Beta Was this translation helpful? Give feedback.
-
Possible solution was posted on Laracasts: https://laracasts.com/discuss/channels/laravel/laravel-artisan-routecache-causes-erroneous-data-exception?reply=572416 Duplicate: #30979 |
Beta Was this translation helpful? Give feedback.
-
That error also affects Horizon. If routes are cached supervisor can not start
horizon.log
EDIT: A problem occurred because I updated PHP to version 7.4 but my supervisor config for Horizon program contained php7.3 I removed version code and everything works fine now |
Beta Was this translation helpful? Give feedback.
-
Try to delete the routes.php file in cache data. It worked for me. |
Beta Was this translation helpful? Give feedback.
-
I had same error and fix updating PHP version to 7.4 in supervisor thanks |
Beta Was this translation helpful? Give feedback.
-
We're running within a dockerized environment (k8s), php 7.3.19, Laravel v6.18.7. We have consumer code built to restart itself ever few hours. Unfortunately, after a period of time, we run into this issue and our consumers stop working with crashlookbackoff. The given solutions, e.g. delete 'route.php' or delete cache, aren't real solutions for us. k8s is restarting the containers on our behalf. These are patches to the underlining problem -- which is ???. The thing is, most of the time the pods restart just fine. But when they fail, they all fail with the same error. We had 3 pods die last night, all with the same error:
|
Beta Was this translation helpful? Give feedback.
-
This happens if you update your dependencies but forget to re-cache the routes. You should also make sure the same version of PHP is running fpm as cli, so your web server PHP version is the same used to generate the routes cache. |
Beta Was this translation helpful? Give feedback.
-
If I delete the In my case I use Laravel 6.x on PHP 7.4 on Ubuntu 18 |
Beta Was this translation helpful? Give feedback.
This happens if you update your dependencies but forget to re-cache the routes. You should also make sure the same version of PHP is running fpm as cli, so your web server PHP version is the same used to generate the routes cache.