1drop / shopware-sentry

Sentry plugin for Shopware
MIT License
20 stars 9 forks source link

No sentry tracking on Console #25

Open antondollmaier opened 5 years ago

antondollmaier commented 5 years ago

When a fatal error is being triggered during a run of php bin/console, e.g. during Cronjobs, Sentry itself fails with a Fatal Error:

PHP Fatal error:  Uncaught Error: Call to a member function getScheme() on null in /app/vendor/shopware/shopware/engine/Shopware/Plugins/Default/Backend/Auth/Bootstrap.php:430
Stack trace:
#0 /app/vendor/shopware/shopware/engine/Shopware/Plugins/Default/Backend/Auth/Bootstrap.php(231): Shopware_Plugins_Backend_Auth_Bootstrap->initLocale()
#1 /app/custom/plugins/OdSentry/Components/SentryClient.php(69): Shopware_Plugins_Backend_Auth_Bootstrap->checkAuth()
#2 /app/vendor/sentry/sentry/lib/Raven/ErrorHandler.php(81): OdSentry\Components\SentryClient->captureException(Object(ErrorException), NULL, NULL, NULL)
#3 /app/vendor/sentry/sentry/lib/Raven/ErrorHandler.php(151): Raven_ErrorHandler->handleException(Object(ErrorException), true)
#4 [internal function]: Raven_ErrorHandler->handleFatalError()
#5 {main}
  thrown in /app/vendor/shopware/shopware/engine/Shopware/Plugins/Default/Backend/Auth/Bootstrap.php on line 430

Removing Components/SentryClient.php#L69 does indeed "solve" the issue, as now a report is sent to Sentry, but that's really not a good fix.

Let me know if additional input is required.

muhkuh2005 commented 4 years ago

Can confirm this behaviour on PHP7.3.18, Shopware 5.6.7 and module version 2.0.1