0

Yesterday my Web Profiler stopped working, in Symfony v.3.0.9 (on Win, with WAMP, PHP v7.0.4). Before that it worked just fine and I'm not sure exactly what happened when it stopped.

I first checked the JS errors being reported, then possible errors in dev.log, then tried clearing the cache (with cache:clear), also as an admin and also manually in file system. Nothing helped. There are no errors returned anywhere and there are no tries from client side to even call it with AJAX. I tried restarting Apache, Wamp & Windows.

Then, I tried composer update, which naturally brought up some new, unrelated issues, and eventually I ended up installing Symfony 3.1, but still no sign of Profiler.

My HTML page does have a body, so the solution here: Web Profiler not showing up in dev doesn't help me. All other mentions of this problem usually lead to some compiling issue, which I don't have (or didn't find it yet).

I also made sure I am running in dev mode, by putting breakpoints in app_dev.php directly.

Has anyone any other/new idea what could be going on?

Addition: I also tried updating Symfony to 3.2, without Profiler appearing.

Addition #2: Just wanted to share, that the only way I can get my Web Profiler to show is, after the cache is rebuilt, go into the var/cache/dev/appDevDebugProjectContainer.php, into the getProfilerService() function and manually comment out the line with:

$instance->disable();

Ugly as hell, but I haven't find any other solution until now. At least, now I see that somehow Symfony decides, based on some internal logic, to actually not show the profiler. At least there is some logic at works.

Community
  • 1
  • 1
userfuser
  • 1,350
  • 1
  • 18
  • 32
  • Are you saying that even the default home page on a fresh installation with no other changes is not working? – Cerad Jan 31 '17 at 13:51
  • I've just installed separately, new Symfony installation and the Profiler is there (but I can't do so (not easily, at least) with this original project, since it's a shared one, I have some pending files in there, which shouldn't be committed yet etc.. Yes, obviously I'm not using Git on this one :)). I would actually like to figure out why did this happen... – userfuser Jan 31 '17 at 14:14
  • The only time I have had trouble is when the html generation failed and I did not get a body section. Just like your link. Maybe use view source to see if there something obviously wrong. And yes, not having source control sucks. – Cerad Jan 31 '17 at 14:23
  • No, I have version control on this (svn), just can't do any 'local' commits to keep everything nicely saved. But anyway, I copied my whole project into new folder, reverted everything to main Repository, deleted all the pending files, deleted the /vendor folder and rebuilt it again (same as /var) and it's still not there. But none one of my colleagues (that are using the same repo) have this issue. – userfuser Jan 31 '17 at 14:27
  • 1
    Really reaching here but grab the composer.lock file from one of your colleagues, clear the vendor then do a composer install. At the very least this will ensure you have the exact same software versions. And instead of wamp you could try with bin/console server:start But I am just guessing here. – Cerad Jan 31 '17 at 14:33
  • Tnx for helping @Cerad. I tried that earlier, didn't work. Anyway, I was following it through the code, and found where the profiler is being loaded and disabled right away. Though I couldn't find why wasn't it enabled later. I will get back on it a bit later. – userfuser Jan 31 '17 at 14:59
  • Try putting following settings in config.yml `web_profiler: toolbar: true` – Archi Feb 06 '17 at 20:46
  • Thanks, but web_profiler: toolbar: true was there all the time. – userfuser Feb 06 '17 at 21:31
  • For all those answer-searching people out there - I finally solved my problem. One of my colleagues on the project intentionally added the `collect: false` into our `config_dev.php` and didn't let me know about it. :) I didn't see that coming. Thanks for your help. – userfuser Apr 03 '17 at 12:56

1 Answers1

1

The final answer to my "mysterious" issue was that someone in the team changed the profiler's setting in the config_dev.yml, and set the:

framework:
    profiler:
        collect: false

Getting that back to collect:true (which is also its default value) made it all work.

userfuser
  • 1,350
  • 1
  • 18
  • 32