Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony profiler throws 404

I've created new project in symfony and I get an error prompt on each site:

An error occurred while loading the web debug toolbar (404: Not Found).
Do you want to open the profiler?

When I open the profiler there is a message

Token not found
Token "59942c" was not found in the database.

Moreover, in the cache directory the profiler directory is empty! I checked permissions and they're proper. I tried cache:clear and removing cache manually, but that didn't help.

like image 500
Mati Avatar asked Jul 12 '15 11:07

Mati


3 Answers

It's often problem with event subscriber/listener. Try run

console debug:event

And check for errors

like image 152
Jan Galtowski Avatar answered Nov 20 '22 00:11

Jan Galtowski


This usually happens if the cache directory is not properly set up to allow the web servers' user to write data into them.

Under Linux, I would usually use this for development:

php app/console --env=dev cache:clear
php app/console --env=dev cache:warmup
chmod -R a+rwX app/cache/
setfacl -Rm g:www-data:rwX app/cache/
setfacl -Rm g:dev-user:rwX app/cache/

This ensures all required directories will be created and then assigned the required permissions. If you do not have ACL enabled, skip the setfacl commands.

OFC, replace www-data with your web servers' username, and dev-user with your username.

like image 30
marenkay Avatar answered Nov 20 '22 01:11

marenkay


This is a known bug in the profiler. Since Symfony 2.4, the profiler persisting the data used by the WDT is the very last thing done by Symfony.

The alert you see means that the profiler has not been able to find the token requested in the 2500ms allowed, However if you click OK in the alert, you should be redirected to the profiler and figure out what precisely is slow.

like image 3
numediaweb Avatar answered Nov 20 '22 01:11

numediaweb