airbrake / phpbrake

The official Airbrake PHP error notifier

Home Page:https://airbrake.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Notifier trying to get /.git/HEAD

davidsneighbour opened this issue · comments

Whenever I am having an exception this is connected to a tracking before and after where phpbrake tries to read /.git/HEAD:

20230121-20:53:40-Selection-001

The error is located in vendor/airbrake/phpbrake/src/Notifier.php:505

Why is it trying to go from system root?

My setup is this:

// initialize tracking
$airbrakeId = Env::getString('AIRBRAKE_ID');
$airbrakeKey = Env::getString('AIRBRAKE_KEY');

// configure notifier for Airbrake
$notifier = new Notifier([
    'projectId' => $airbrakeId,
    'projectKey' => $airbrakeKey,
    'appVersion' => Config::getVersion(),
    //'rootDirectory' => Constants::getString('ROOT_DIR'),
    'environment' => Config::getEnvironment(),
]);

// register error handlers
Instance::set($notifier);
$handler = new ErrorHandler($notifier);
$handler->register();

It tries to go for system root with rootDirectory set and not set.

What might cause this behaviour? The actual error/exception is tracked properly.