Home > Software engineering >  Symfony doesn't give full traces of Exceptions in production
Symfony doesn't give full traces of Exceptions in production

Time:09-14

We recently moved our infra to K8s, and since I have issue to get Traces of my Exceptions

We're on Symfony 3.4, and my Exception traces only gaves me web/app.php, but not root cause

Error: Call to a member function send() on null
#0 web/app.php(19): null

app.php is classic Symfony file, nothing relevent inside:

$kernel = new AppKernel('prod', false);
$request = Request::createFromGlobals();

$response = $kernel->handle($request);
$response->send();

$kernel->terminate($request, $response);

I tried to connect my localhost to my production DB, to see if I had the same issue, but no. I have correct full trace of my Exception

enter image description here

If I try in production with "app_dev.php" (which I enabled only for this test), I have same issue with no trace

enter image description here

Do you know what could cause this issue? A PHP configuration? I checked differences between php -i on previous infra & new one, but I don't see any relevant difference

Edit:

Monolog in config.yml:

monolog:
    handlers:
        main:
            type:      rotating_file
            max_files: 10
            path: '%kernel.logs_dir%/%kernel.environment%.general.log'
            level: INFO
            formatter: myapp.monolog.formatter.json_message

Edit 2: We bring part of old infra alive. And here the difference : Old infra, for Fatal Errors, we have the full trace: enter image description here On new infra, same fatal error is displayed without any more detail enter image description here

CodePudding user response:

The issue seems to comes from datadog agent that we added on our new infra.

Edit: Issue has been fixed in https://github.com/DataDog/dd-trace-php/releases/tag/0.79.0

  • Related