1

Running Symfony 2.7.8.

It has always worked like a charm: I did something like

{{ dump(undefinedVariable) }}

and it in dev mode twig told me that the variable was not defined.

Now it does not tell me anylonger: I have an ugly 500 error page (not symfony's) and no toolbar. Like I was running on prod instead of dev. But I'm sure I'm in dev, as if I remove the incriminated line the page gets rendered and I have symfony's bar telling me I'm in dev.

The strange thing is that the other developer running the same project on his machine does not experience the issue. Could it be something related to my configuration of Apache?

Thank you!

EDIT1: Apache log is clear. Symfony log last entries are:

[]
[2016-01-11 10:35:31] event.DEBUG: Notified event "kernel.response" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\HttpCacheListener::onKernelResponse". [] []
[2016-01-11 10:35:31] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelResponse". [] []
[2016-01-11 10:35:31] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener::onKernelResponse". [] []
[2016-01-11 10:35:31] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\SaveSessionListener::onKernelResponse". [] []
[2016-01-11 10:35:31] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\StreamedResponseListener::onKernelResponse". [] []
[2016-01-11 10:35:31] event.DEBUG: Notified event "kernel.finish_request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelFinishRequest". [] []
[2016-01-11 10:35:31] event.DEBUG: Notified event "kernel.finish_request" to listener "Symfony\Component\HttpKernel\EventListener\TranslatorListener::onKernelFinishRequest". [] []
[2016-01-11 10:35:31] event.DEBUG: Notified event "kernel.finish_request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelFinishRequest". [] []
[2016-01-11 10:35:31] event.DEBUG: Notified event "kernel.finish_request" to listener "Symfony\Component\Security\Http\Firewall::onKernelFinishRequest". [] []
[2016-01-11 10:35:31] event.DEBUG: Notified event "kernel.terminate" to listener "Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener::onTerminate". [] []
[2016-01-11 10:35:31] event.DEBUG: Notified event "kernel.terminate" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelTerminate". [] []

EDIT2: I think we can rule out Apache. The behavior is exactly the same if I use Symfony's webserver. Enabling the --verbose option does not provide any clue on why the 500 (but the server keeps running) :/

EDIT3 The response header from the server seems properly formatted, but I cannot get the body (at least the browsers consoles tell me there isn't any). This is the header:

Request URL:http://localhost:8000/app_dev.php/onboardingGuide/edit/31
Request Method:GET
Status Code:500 Internal Server Error
Remote Address:[::1]:8000
Response Headers
view source
Connection:close
Content-Length:0
Content-Type:text/html; charset=UTF-8
Date:Tue, 12 Jan 2016 09:52:55 GMT
Server:Apache/2.4.16 (Win32) OpenSSL/1.0.1p PHP/5.6.12
X-Powered-By:PHP/5.6.12
Request Headers
view source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:it-IT,it;q=0.8,en-US;q=0.6,en;q=0.4
Cache-Control:max-age=0
Connection:keep-alive
Cookie:PHPSESSID=etrtngod29m8odpepoi6kvgr66
Host:localhost:8000
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36
7
  • tried clearing cache? also, check your apache logs, the answer is probably in there. Commented Jan 11, 2016 at 9:55
  • yep, cache cleared. Have no clue about Apache logs, but I'm expecting there to have a stacktrace or whatever related to the error, not the fact that Twig did not display the error properly :/ Commented Jan 11, 2016 at 9:58
  • it does seem odd. if youre running a standard apache config on a linux server itll be in /var/logs/apache2/error.log. Check that out, or better still use tail -f /var/logs/apache2/error.log and reload the page. you should see the offending issue pop up. As youre not getting a Symfony error it does imply that its not getting as far that. Commented Jan 11, 2016 at 10:14
  • I'm running Apache on Windows but found the log. It's clear. See also my edited question for more info on Symfony's last log entries Commented Jan 11, 2016 at 10:40
  • What's inside your symfony-directory/app/logs/dev.log file? Commented Jan 11, 2016 at 10:41

2 Answers 2

1

Found the problem: it was a limit to "just" 128MB on php.ini memory_limit

Probably the stack trace is so big that it causes the error.

Hope this helps others :)

Sign up to request clarification or add additional context in comments.

Comments

0

downgrade your symfony bundle in composer.json and AFTER upgrade your symfony bundle in composer.json which was the version before your issue.

4 Comments

tried with 2.7.0 (I'm sure it worked back then), ran composer update, cleared cache. Checked that I'm indeed running on 2.7.0. Same issue
you must not testing in 2.7 but you must RE-upgrade to 2.7.8 your original used version. This is not a test with another version of symfony. This is a extrem clean method.
I removed vendor folder and run composer install (2.7.0). Same issue :(
Just to clarify: I'm not sure it started happening in 2.7.8, I'm just saying that "some time ago" it worked, and the only thing I thought about was a symfony version (considering that the config_dev is the same as the other developer)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.