Fixing Laravel Debugbar Exception: File does not exist

I spent way too long this morning debugging an issue with Debugbar for Laravel.

I had recently deleted the storage/debugbar directory while troubleshooting a different issue. Even though I had recreated the directory and all of the filesystem permissions seemed to be correct, I was still getting errors like this in my logs every time I loaded a page, and the debug bar would not show up at all:

local.ERROR: Debugbar exception: File does not exist at path /srv/storage/debugbar/01JP802XSAAA12MP4PZMARSPZD.json

Solution

Eventually I was able to solve it by following these steps:

  1. Run php artisan vendor:publish and choose Barryvdh\Debugbar\ServiceProvider to publish the config/debugbar.php file (if not already published)
  2. Modify the storage.driver section from 'file' to 'redis'
  3. Load a page and see the debugbar show up correctly
  4. Reset the driver to 'file'
  5. Reload the page and see the debugbar show up correctly
  6. Delete the config/debugbar.php file (if no other customizations are needed)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.