Giter VIP home page Giter VIP logo

sentry-laravel's Introduction

Sentry

Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoying technology. If you want to join us Check out our open positions

Official Sentry SDK for Laravel

CI Latest Stable Version License Total Downloads Monthly Downloads Discord

This is the official Laravel SDK for Sentry.

Getting Started

The installation steps below work on version 11.x of the Laravel framework.

For older Laravel versions and Lumen see:

Install

Install the sentry/sentry-laravel package:

composer require sentry/sentry-laravel

Enable capturing unhandled exception to report to Sentry by making the following change to your bootstrap/app.php:

<?php

use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Sentry\Laravel\Integration;

return Application::configure(basePath: dirname(__DIR__))
    ->withRouting(
        web: __DIR__.'/../routes/web.php',
        commands: __DIR__.'/../routes/console.php',
        health: '/up',
    )
    ->withMiddleware(function (Middleware $middleware) {
        //
    })
    ->withExceptions(function (Exceptions $exceptions) {
        Integration::handles($exceptions);
    })->create();

Alternatively, you can configure Sentry as a Laravel Log Channel, allowing you to capture info and debug logs as well.

Configure

Configure the Sentry DSN with this command:

php artisan sentry:publish --dsn=___PUBLIC_DSN___

It creates the config file (config/sentry.php) and adds the DSN to your .env file.

SENTRY_LARAVEL_DSN=___PUBLIC_DSN___

Usage

use function Sentry\captureException;

try {
    $this->functionThatMayFail();
} catch (\Throwable $exception) {
    captureException($exception);
}

To learn more about how to use the SDK refer to our docs.

Laravel Version Compatibility

The Laravel and Lumen versions listed below are all currently supported:

  • Laravel >= 11.x.x on PHP >= 8.2 is supported starting from 4.3.0
  • Laravel >= 10.x.x on PHP >= 8.1 is supported starting from 3.2.0
  • Laravel >= 9.x.x on PHP >= 8.0 is supported starting from 2.11.0
  • Laravel >= 8.x.x on PHP >= 7.3 is supported starting from 1.9.0
  • Laravel >= 7.x.x on PHP >= 7.2 is supported starting from 1.7.0
  • Laravel >= 6.x.x on PHP >= 7.2 is supported starting from 1.2.0

Please note that starting with version >= 2.0.0 we require PHP Version >= 7.2 because we are using our new PHP SDK underneath.

The Laravel versions listed below were supported in previous versions of the Sentry SDK for Laravel:

  • Laravel <= 4.2.x is supported until 0.8.x
  • Laravel <= 5.7.x on PHP <= 7.0 is supported until 0.11.x
  • Laravel >= 5.x.x on PHP >= 7.1 is supported until 2.14.x

Contributing to the SDK

Please refer to CONTRIBUTING.md.

Getting Help/Support

If you need help setting up or configuring the Laravel SDK (or anything else in the Sentry universe) please head over to the Sentry Community on Discord. There is a ton of great people in our Discord community ready to help you!

Resources

  • Documentation
  • Discord
  • Stack Overflow
  • Twitter Follow

License

Licensed under the MIT license, see LICENSE.

sentry-laravel's People

Contributors

ankurk91 avatar baijunyao avatar benconstable avatar besanek avatar cleptric avatar dcramer avatar erikgaal avatar getsentry-bot avatar hazat avatar jnoordsij avatar kayw-geek avatar leo108 avatar manavo avatar mattjohnsonpint avatar mitsuhiko avatar mrsimonbennett avatar niclasvaneyk avatar owenmelbz avatar patrickbrouwers avatar pgrimaud avatar rzv-me avatar sebastiaankloos avatar simbig avatar smknstd avatar spawnia avatar stayallive avatar summerkk avatar thelevti avatar travoltron avatar wimulkeman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sentry-laravel's Issues

Facade name collision with existing package

I'm trying to install Sentry on a Laravel 5 project but I'm already using Cartalyst Sentry for user authentication - which has an existing facade for "sentry." Is there a workaround for this?

Exceptions not showing up in self-hosted sentry whilst on production environment

I'm 100% sure this is something to do with this server but I've been running around all morning trying to figure out what it could be.

I'm running a laravel 5.2 app which is meant to send errors to a Sentry instance I host. It works in the development environment (currently using valet) and JS reporting works in both environments.

In the production environment exceptions aren't shown in Sentry. There is also no mention of Sentry in the Exception stacktrace (although I'm not sure there is meant to be).

The production server is running PHP7 through Serverpilot.

Currently loaded PHP modules:

php7.0-sp -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imap
intl
json
ldap
libxml
mbstring
mcrypt
mysqli
mysqlnd
odbc
openssl
pcntl
pcre
PDO
pdo_dblib
pdo_mysql
PDO_ODBC
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
snmp
soap
sockets
SPL
sqlite3
standard
tidy
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

Composer.json:

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.",
"laravel/cashier": "^6.0",
"sentry/sentry-laravel": "^0.3.0",
"guzzlehttp/guzzle": "^6.2"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.
",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.|3.0.",
"symfony/dom-crawler": "2.8.|3.0."
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r "copy('.env.example', '.env');""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\Foundation\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\Foundation\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}

composer7.0-sp show | grep "sentry" output

sentry/sentry 0.22.0 A PHP client for Sentry (http://getsentry.com)
sentry/sentry-laravel 0.3.0 Laravel integration for Sentry (http://getsentry.com)

User context in laravel 5.4

Hi i would like to ask how you can add user context to sentry's entry when Auth::user() is null. This is related to laravel's auth handling for laravel versions > 5.2. Thanks

Error with vendor:publish

Hey,

php artisan vendor:publish --provider="Sentry\SentryLaravel\SentryLaravelServiceProvider"
PHP Fatal error:  Uncaught exception 'ErrorException' with message 'array_merge(): Argument #2 is not an array' in /Users/syl/Sites/pro/aotd-website/vendor/sentry/sentry-laravel/src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php:72
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'array_merge(): ...', '/Users/syl/Site...', 72, Array)
#1 /Users/syl/Sites/pro/aotd-website/vendor/sentry/sentry-laravel/src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php(72): array_merge(Array, NULL)
#2 /Users/syl/Sites/pro/aotd-website/vendor/laravel/framework/src/Illuminate/Container/Container.php(735): Sentry\SentryLaravel\SentryLaravelServiceProvider->Sentry\SentryLaravel\{closure}(Object(Illuminate\Foundation\Application), Array)
#3 /Users/syl/Sites/pro/aotd-website/vendor/laravel/framework/src/Illuminate/Container/Container.php(633): Illuminate\Container\Container->build(Object(Closure), Array)
#4 /Users/syl/Sites/pro/aotd-website/vendor/laravel/framework/src/Illuminate/Foundat in /Users/syl/Sites/pro/aotd-website/vendor/sentry/sentry-laravel/src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php on line 72
PHP Fatal error:  Uncaught exception 'ErrorException' with message 'array_merge(): Argument #2 is not an array' in /Users/syl/Sites/pro/aotd-website/vendor/sentry/sentry-laravel/src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php:72
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'array_merge(): ...', '/Users/syl/Site...', 72, Array)
#1 /Users/syl/Sites/pro/aotd-website/vendor/sentry/sentry-laravel/src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php(72): array_merge(Array, NULL)
#2 /Users/syl/Sites/pro/aotd-website/vendor/laravel/framework/src/Illuminate/Container/Container.php(735): Sentry\SentryLaravel\SentryLaravelServiceProvider->Sentry\SentryLaravel\{closure}(Object(Illuminate\Foundation\Application), Array)
#3 /Users/syl/Sites/pro/aotd-website/vendor/laravel/framework/src/Illuminate/Container/Container.php(633): Illuminate\Container\Container->build(Object(Closure), Array)
#4 /Users/syl/Sites/pro/aotd-website/vendor/laravel/framework/src/Illuminate/Foundat in /Users/syl/Sites/pro/aotd-website/vendor/sentry/sentry-laravel/src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php on line 72

Using Laravel 5.2.

Got this in laravel.log:

[2016-05-06 09:40:05] local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'Sentry\SentryLaravel\SentryLaravelServiceProvider' not found' in /Users/syl/Sites/pro/aotd-website/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php:146
Stack trace:
#0 /Users/syl/Sites/pro/aotd-website/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(133): Symfony\Component\Debug\Exception\FatalErrorException->__construct()
#1 /Users/syl/Sites/pro/aotd-website/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(118): Illuminate\Foundation\Bootstrap\HandleExceptions->fatalExceptionFromError()
#2 /Users/syl/Sites/pro/aotd-website/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(0): Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown()
#3 /Users/syl/Sites/pro/aotd-website/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php(114): Illuminate\Foundation\ProviderRepository->createProvider()
#4 /Users/syl/Sites/pro/aotd-website/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php(60): Illuminate\Foundation\ProviderRepository->compileManifest()
#5 /Users/syl/Sites/pro/aotd-website/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(530): Illuminate\Foundation\ProviderRepository->load()
#6 /Users/syl/Sites/pro/aotd-website/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php(17): Illuminate\Foundation\Application->registerConfiguredProviders()
#7 /Users/syl/Sites/pro/aotd-website/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(203): Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap()
#8 /Users/syl/Sites/pro/aotd-website/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(208): Illuminate\Foundation\Application->bootstrapWith()
#9 /Users/syl/Sites/pro/aotd-website/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(105): Illuminate\Foundation\Console\Kernel->bootstrap()
#10 /Users/syl/Sites/pro/aotd-website/artisan(36): Illuminate\Foundation\Console\Kernel->handle()
#11 /Users/syl/Sites/pro/aotd-website/artisan(0): {main}()
#12 {main}  

Bests

laravel \Log::error('error') does not work

Hi,
I am using default laravel installation and calling \Log::error('error') does not send error message to the sentry. I can see this in the log file so it is working. If I throw an exception everything works as expected. Error is sent to the sentry and is logged to the file.

I am using sentry.io
laravel v5.2.43
sentry/sentry (1.5.0)
sentry/sentry-laravel (0.4.1)

Duplicate exceptions

In some cases we throw duplicate-ish exceptions. For example, if you unset APP_KEY:

RuntimeException: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.
#15 vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php(43): __construct
#14 vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(27): Illuminate\Encryption\{closure}
#13 vendor/laravel/framework/src/Illuminate/Container/Container.php(726): build
#12 vendor/laravel/framework/src/Illuminate/Container/Container.php(608): resolve
#11 vendor/laravel/framework/src/Illuminate/Container/Container.php(575): make
#10 vendor/laravel/framework/src/Illuminate/Foundation/Application.php(728): make
#9 vendor/laravel/framework/src/Illuminate/Container/Container.php(862): resolveClass
#8 vendor/laravel/framework/src/Illuminate/Container/Container.php(790): resolveDependencies
#7 vendor/laravel/framework/src/Illuminate/Container/Container.php(758): build
#6 vendor/laravel/framework/src/Illuminate/Container/Container.php(608): resolve
#5 vendor/laravel/framework/src/Illuminate/Container/Container.php(575): make
#4 vendor/laravel/framework/src/Illuminate/Foundation/Application.php(728): make
#3 vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(215): terminateMiddleware
#2 vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(189): terminate
#1 public/index.php(58): require_once
#0 server.php(21): null

and

RuntimeException: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.
#36 vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php(43): __construct
#35 vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(27): Illuminate\Encryption\{closure}
#34 vendor/laravel/framework/src/Illuminate/Container/Container.php(726): build
#33 vendor/laravel/framework/src/Illuminate/Container/Container.php(608): resolve
#32 vendor/laravel/framework/src/Illuminate/Container/Container.php(575): make
#31 vendor/laravel/framework/src/Illuminate/Foundation/Application.php(728): make
#30 vendor/laravel/framework/src/Illuminate/Container/Container.php(862): resolveClass
#29 vendor/laravel/framework/src/Illuminate/Container/Container.php(790): resolveDependencies
#28 vendor/laravel/framework/src/Illuminate/Container/Container.php(758): build
#27 vendor/laravel/framework/src/Illuminate/Container/Container.php(608): resolve
#26 vendor/laravel/framework/src/Illuminate/Container/Container.php(575): make
#25 vendor/laravel/framework/src/Illuminate/Foundation/Application.php(728): make
#24 vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(138): Illuminate\Pipeline\{closure}
#23 vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Routing\{closure}
#22 vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): then
#21 vendor/laravel/framework/src/Illuminate/Routing/Router.php(576): runRouteWithinStack
#20 vendor/laravel/framework/src/Illuminate/Routing/Router.php(535): dispatchToRoute
#19 vendor/laravel/framework/src/Illuminate/Routing/Router.php(513): dispatch
#18 vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\Foundation\Http\{closure}
#17 vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Routing\{closure}
#16 vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(30): handle
#15 vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Pipeline\{closure}
#14 vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Routing\{closure}
#13 vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(30): handle
#12 vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Pipeline\{closure}
#11 vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Routing\{closure}
#10 vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): handle
#9 vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Pipeline\{closure}
#8 vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Routing\{closure}
#7 vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(46): handle
#6 vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Pipeline\{closure}
#5 vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Routing\{closure}
#4 vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): then
#3 vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): sendRequestThroughRouter
#2 vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): handle
#1 public/index.php(54): require_once
#0 server.php(21): null
Richcurl

Error with new breadcrumb feature

I saw that now we can track breadcrumbs and thats pretty cool! But, unfortunately, one of our Laravel services have broke when we updated its dependencies. It was so painful that it even break the Exception Handler.

We removed the Sentry from the Exception Handler and got this log...

[2016-12-09 00:44:24] production.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Too few arguments to function Illuminate\Auth\AuthManager::createDriver(), 0 passed in /data/www/vendor/laravel/framework/src/Illuminate/Support/Manager.php on line 87 and exactly 1 expected in /data/www/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php:16
Stack trace:
#0 /data/www/vendor/laravel/framework/src/Illuminate/Support/Manager.php(87): Illuminate\Auth\AuthManager->createDriver()
#1 /data/www/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php(18): Illuminate\Support\Manager->createDriver(NULL)
#2 /data/www/vendor/laravel/framework/src/Illuminate/Support/Manager.php(63): Illuminate\Auth\AuthManager->createDriver(NULL)
#3 /data/www/vendor/laravel/framework/src/Illuminate/Support/Manager.php(137): Illuminate\Support\Manager->driver()
#4 /data/www/vendor/sentry/sentry-laravel/src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php(85): Illuminate\Support\Manager->__call('check', Array)
#5 /data/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(738): Sentry\SentryLaravel\SentryLaravelServiceProvider->Sentry\SentryLaravel\{closure}(Object(Illuminate\Foundation\Application), Array)
#6 /data/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build(Object(Closure), Array)
#7 /data/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('sentry', Array)
#8 /data/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(1167): Illuminate\Foundation\Application->make('sentry')
#9 /data/www/vendor/sentry/sentry-laravel/src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php(51): Illuminate\Container\Container->offsetGet('sentry')
#10 /data/www/vendor/sentry/sentry-laravel/src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php(45): Sentry\SentryLaravel\SentryLaravelServiceProvider->bindEvents(Object(Illuminate\Foundation\Application))
#11 [internal function]: Sentry\SentryLaravel\SentryLaravelServiceProvider->boot()
#12 /data/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array)
#13 /data/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(734): Illuminate\Container\Container->call(Array)
#14 /data/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(717): Illuminate\Foundation\Application->bootProvider(Object(Sentry\SentryLaravel\SentryLaravelServiceProvider))
#15 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation\{closure}(Object(Sentry\SentryLaravel\SentryLaravelServiceProvider), 21)
#16 /data/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(718): array_walk(Array, Object(Closure))
#17 /data/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\Foundation\Application->boot()
#18 /data/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(203): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap(Object(Illuminate\Foundation\Application))
#19 /data/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(222): Illuminate\Foundation\Application->bootstrapWith(Array)
#20 /data/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(117): Illuminate\Foundation\Http\Kernel->bootstrap()
#21 /data/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(87): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#22 /data/www/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#23 {main}  

As you can see in the log, the issue was about the AuthManager, and the AuthManager use some session stuff that we've disabled :(.

So, we removed the SentryServiceProvider and everything worked again. We're using PHP 7.1 with Laravel 5.1.

Don't report on local environment

Is there an easy way for it to not report when on local environment? We only need reports on production environment.

Would be nice to have a config option:

'environments' => ['production'],

PHP 5.3 long-form array syntax for 0.4.x series releases

I submitted the pull request, but this is for the issue it is intended to close out. Laravel 4.x supports PHP 5.3, and most of the code uses the long version of array syntax. array() vs. [] . However, there are three spots that use the short-form version of the array syntax and that breaks the plugin for those of us on old production machines. Ref fix on #59

sentry.breadcrumbs error=Auth guard [] is not defined

This error happen when the config/auth.php file doesn't exists.
In my case, I don't need of this file.

In this case, the auth process should be ignored.

Edit: is possible disable it by setting user_context => false. Then I don't know if it can be considered a bug.

Composer error for 0.6.1

Hello there,

It seems there is a problem with version 0.6.1. Let me explain:

When i follow your installation instructions, i installed sentry-laravel with composer require sentry/sentry-laravel. Which installed 0.6.1, latest.

But, unfortunately, sentry-laravel folder seems empty and of course, cannot load SentryLaravelServiceProvider. Here is screenshot:

screenshot from 2017-03-06 01-21-52

I saw this issue with two different laravel installation.
Then i fixed version to 0.6.0 and folder came up and now i can use.

I don't know, maybe its about my composer and my other dependencies. But this happened with 2 different laravel 5.4 installation on same setup.

Edit: now i've tried with laravel4.2 and inside a vagrant box, it installed like a charm. So, issue should change. Is there anyone else who get trouble with 5.4 :)

Sentry makes many querys

Hello friends I am using sentry with laravel 4.2 and I see that every time I get to a route all these querys are executed, is there any way to prevent sentry from doing so many querys?

captura
captura2

Add getPublicDSN function

This would make it easier to create Raven dialog, by just adding something like

@unless(empty($sentryID))
<script src="https://cdn.ravenjs.com/3.3.0/raven.min.js"></script>
<script>
    Raven.showReportDialog({
        eventId: '{{ $sentryID }}',
        dsn: '{{ Sentry::getPublicDSN() }}'
    });
</script>
@endunless

Get user data in sentry

Hello,
I want to send a Auth::user() in sentry dashboard. i want to know error which user caused the error. is there a way around?

sentryID is null

dd($this->sentryID);
return response()->view('errors.500', [
'sentryID' => $this->sentryID,
'exception' => $exception,
], 500);

Laravel 5.3, dd sentryID in render function always null.
do i need 'use Sentry'?

issue with laravel 5.4

in laravel 5.4 , event fire function renamed to dispatch ...

If you are manually implementing the Illuminate\Contracts\Events\Dispatcher interface in your application or package, you should rename the fire method to dispatch.

in project we get this :

PHP Fatal error: Uncaught Error: Call to undefined method Illuminate\Events\Dispatcher::firing() in /Users/roboticsexpert/Sites/UpperTime/vendor/sentry/sentry-laravel/src/Sentry/SentryLaravel/SentryLaravelEventHandler.php:29

Call to undefined method Raven_Client::check() while installing sentry-laravel

I am facing this error when I try to install sentry-laravel in my application, this is the output when I add the provider inside my providers array:
FatalErrorException in Facade.php line 215: Call to undefined method Raven_Client::check()

Providers list:

"providers" => [

        /*
         * Laravel Framework Service Providers...
         */
        'Illuminate\Broadcasting\BroadcastServiceProvider',
        'Illuminate\Foundation\Providers\ArtisanServiceProvider',
        'Illuminate\Auth\AuthServiceProvider',
        'Illuminate\Bus\BusServiceProvider',
        'Illuminate\Cache\CacheServiceProvider',
        'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
        'Illuminate\Cookie\CookieServiceProvider',
        'Illuminate\Database\DatabaseServiceProvider',
        'Illuminate\Encryption\EncryptionServiceProvider',
        'Illuminate\Filesystem\FilesystemServiceProvider',
        'Illuminate\Foundation\Providers\FoundationServiceProvider',
        'Illuminate\Hashing\HashServiceProvider',
        'Illuminate\Mail\MailServiceProvider',
        'Illuminate\Pagination\PaginationServiceProvider',
        'Illuminate\Pipeline\PipelineServiceProvider',
        'Illuminate\Queue\QueueServiceProvider',
        'Illuminate\Redis\RedisServiceProvider',
        'Illuminate\Auth\Passwords\PasswordResetServiceProvider',
        'Illuminate\Session\SessionServiceProvider',
        'Illuminate\Translation\TranslationServiceProvider',
        'Illuminate\Validation\ValidationServiceProvider',
        'Illuminate\View\ViewServiceProvider',

        /*
         * Application Service Providers...
         */
        'App\Providers\AppServiceProvider',
        'App\Providers\ConfigServiceProvider',
        'App\Providers\EventServiceProvider',
        'App\Providers\RouteServiceProvider',

        /*
        * Custome Service providers
        */
        'Collective\Html\HtmlServiceProvider',
        'Cartalyst\Sentry\SentryServiceProvider',
                'Codesleeve\LaravelStapler\Providers\L5ServiceProvider',
                Sentry\SentryLaravel\SentryLaravelServiceProvider::class,
    ],

laravel version: 5.2

Laravel 5.4 compatibility

Laravel 5.4 will probably be released this or next month and there is a compatibility issue which will have to be addressed.

There has been some changes to Illuminate\Events\Dispatcher, eg. in this commit. It no longer exposes the firing() method used in SentryLaravelEventHandler. From what I understand it is used to retrieve the name of the current event and direct the control flow accordingly.
In 5.4, when an wildcard event listener has been registered, the listener method will be called with two arguments:

  • Event name
  • Event payload

That said, following changes will be required in SentryLaravelEventHandler::onWildcardEvent.

  1. Add previously mentioned arguments:
public function onWildcardEvent($eventName, $payload)
  1. Instead of $args = func_get_args(); we can use the second argument which is the event payload. Eg.
$route = $args[0]->route;

will have to be replaced with

$route = $payload[0]->route;

While we're on the subject of the onWildcardEvent method it feels a bit messy for me. I refactored it here, tell me what do you think.

Also, event names have changed. Eg. Laravel no longer raises illuminate.log event, instead an instance of Illuminate\Log\Events\MessageLogged is sent. You can see more in this commit. I reflected these changes in the Gist.

For now it's all I have discovered in this subject. Tell me if you're interested in a Pull Request regarding these changes.

Laravel 5.4 class sentry does not exist

Hello,

So im using laravel 5.4 and WSL for development. I try to use composer install over git bash (windows 10),
im getting Class sentry does not exist .

PHP Fatal error:  Uncaught ReflectionException: Class Sentry does not exist in C:\Users\AlanAasmaa\Code\xxx\vendor\laravel\framework\src\Illuminate\Container\Container.php:719
Stack trace:
#0 C:\Users\AlanAasmaa\Code\xxx\vendor\laravel\framework\src\Illuminate\Container\Container.php(719): ReflectionClass->__construct('Sentry')
#1 C:\Users\AlanAasmaa\Code\xxx\vendor\laravel\framework\src\Illuminate\Container\Container.php(598): Illuminate\Container\Container->build('Sentry')
#2 C:\Users\AlanAasmaa\Code\xxx\vendor\laravel\framework\src\Illuminate\Container\Container.php(567): Illuminate\Container\Container->resolve('Sentry')
#3 C:\Users\AlanAasmaa\Code\xxx\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(702): Illuminate\Container\Container->make('Sentry')
#4 C:\Users\AlanAasmaa\Code\xxx\vendor\laravel\framework\src\Illuminate\Foundation\helpers.php(107): Illuminate\Foundation\Application->make('Sentry')
#5 C:\Users\AlanAasmaa\Code\xxx\app\Exceptions\Handler.php(36): app('Sentry')
# in C:\Users\AlanAasmaa\Code\xxx\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 719

I have debugged that the line is in app\Exceptions\Handler.php

       if ($this->shouldReport($exception)) {
            app('sentry')->captureException($exception);
        }

I think the error is somehow with laravel interface binding ?

queue integration

Hello,

does it integrate with laravel queues by default?
Looking at the classes I did not spot it

Laravel 5.4

In Laravel 5.4, the firing() method in the event Dispatcher has been removed. This means that this package is no longer compatible with the latest version.

It looks as though the current SentryLaravelEventHandler is really only listening to the following events:

  • Illuminate\Routing\Events\RouteMatched
  • router.matched
  • Illuminate\Database\Events\QueryExecuted
  • illuminate.query
  • illuminate.log

So I propose that the package actually is refactored a little, to have a dedicated event listener for each of these events (to remove the long list of nested conditionals).

Laravel Log function not reporting

If we use Log::error or any of the methods it does not report in Sentry. It is in the local log file. This seems to have started since 5.3

Sentry not using the $dontReport property

Hello,

I've setup sentry in Laravel 5.1.

I have a few exceptions setup in the $dontReport property, like 404, so that sentry doesn't log those errors and thus it doesn't get logged on slack.

However, the package doesn't seem to be paying attention to this property.

Do I have to do this manually ? Or can/should the package do this ?

For example, on bugsnag, it was the bugsnag package that handled the $dontReport property.

Thank you,

Sentry breadcrumbs problem

Sometimes there is a problem with "breadcrumbs".

I get following output in Sentry's Breadcrumbs:

error_reporting     Undefined offset: 1
line                         41
code                         8
file                         /var/www/api/vendor/sentry/sentry/lib/Raven/Breadcrumbs.php
-----
error_reporting     Undefined offset: 2
line                         41
code                         8
file                         /var/www/api/vendor/sentry/sentry/lib/Raven/Breadcrumbs.php
-----
... this goes on till index 99

Exception in SentryLaravelEventHandler.php with laravel 5.4

After migrating to lavarel 5.4 I am getting the following
PHP Fatal error: Uncaught Error: Call to undefined method Illuminate\Events\Dispatcher::firing() in /Users/olivier/Developer/CellmarkDMS/vendor/sentry/sentry-laravel/src/Sentry/SentryLaravel/SentryLaravelEventHandler.php:29

seems that the firing method is no longer available in Illuminate\Events\Dispatcher::firing()

Looked in laravel-debugbar project from which SentryLaravelEventHandler's event handling is inspired and we have the following (inBarryvdh\Debugbar\DataCollector\EventCollector):
// Pre-Laravel 5.4, using 'firing' to get the current event name.
if (method_exists($this->events, 'firing')) {
$name = $this->events->firing();
// Get the arguments passed to the event
$data = func_get_args();
}

Adding additional data to error

Hello,

Is it possible to add additional custom data to the logged errors ?
I'm specifically thinking of the logged in user id, first/last name etc.

I see the package already tries to guess the user id with $user->getAuthIdentifier(),, however I'm using Sentinel for ACL which doesn't has this.

Thank you,

Using proxy when submitting exceptions via PHP

Hi guys, recently we started to migrate all our exception handling over to Sentry.

However we've got a cluster of servers which have restricted internet connection, so the only way they can contact the internet is via a proxy.

E.g. when we use curl on the project we have a set up similar to

        $proxy = '147.128.9.224:8080';

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_PROXY, $proxy);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

        try {
            $file_contents = curl_exec($ch);
        }
        catch(Exception $e){
            $file_contents = false;
        }

        curl_close($ch);

So we just pass in the proxy to the curl request - how can we apply this same logic to the Sentry/Raven handler within laravel and within the standard php package?

Thanks

When is the data sent to Sentry?

Hi,

We're on php-fpm so fastcgi_finish_request() works properly in Laravel's Terminal Middleware (there seems to be an issue with it, unless it's php-fpm).

Anyway ...... I was wondering is the call to Sentry taking (or planning to take) advantage of Terminal Middleware? So the processing and sending of the error data isn't blocking the response.

Thanks.

Unable to pull event_id / Ident from a thrown exception

Say I've got a custom 500 view that, right now, shows an event ID (generated by laravel-exceptions in this case) that's passed in from the generator. I could just do something like this:

$event_id = app('sentry')->getIdent(app('sentry')->captureException($e));

to capture the event_id from the captured exception, but if I do that in Exceptions\Handler::report() then I can't access it when my view later gets called by the parent's render() routine.

A possible fix would be having something along the lines of Sentry::getLastEventId() as per clowdy/laravel-raven's identically named function (which I can just call from my custom view).

Any ideas?

Improve app paths

I'm not sure how best to approach this, but for example, 'routes' is outside of app_path, and so generating an error there results in a poor user experience. We could use base_path as the app root, but then it includes vendor, which is also a problem. This possibly needs upstream changes to sentry/sentry to make this behavior better.

Issue running in production only on Laravel 4

When I load in the service provider only on the production environment, by creating the following environment-specific config file in app/config/production/app.php:

<?php

return [

	'providers' => [
		'Sentry\SentryLaravel\SentryLaravelServiceProvider',
	],

	'aliases' => [
		'Sentry' => 'Sentry\SentryLaravel\SentryFacade',
	],

];

Sentry breaks for logged in users at this point on line 85 in the service provider:

                if ($app['auth']->check()) {
                    $user = $app['auth']->user();
                    $client->user_context(array(
                        'id' => $user->getAuthIdentifier(),
                    ));
                }

This is due to SentryLaravelServiceProvider's boot method running first (by virtue of it being at the top of the list of service providers). Here is a stack trace received in public/error_log:

PHP Fatal error:  Call to a member function connection() on null in /path/to/app/bootstrap/compiled.php on line 7453
PHP Stack trace:
PHP   1. {main}() /path/to/app/public/index.php:0
PHP   2. Illuminate\Foundation\Application->run() /path/to/app/public/index.php:49
PHP   3. Stack\StackedHttpKernel->handle() /path/to/app/bootstrap/compiled.php:657
PHP   4. Illuminate\Cookie\Guard->handle() /path/to/app/bootstrap/compiled.php:11040
PHP   5. Illuminate\Cookie\Queue->handle() /path/to/app/bootstrap/compiled.php:8375
PHP   6. Illuminate\Session\Middleware->handle() /path/to/app/bootstrap/compiled.php:8428
PHP   7. Barryvdh\Debugbar\Middleware\Stack->handle() /path/to/app/bootstrap/compiled.php:7821
PHP   8. Illuminate\Foundation\Application->handle() /path/to/app/vendor/barryvdh/laravel-debugbar/src/Middleware/Stack.php:34
PHP   9. Illuminate\Foundation\Application->boot() /path/to/app/bootstrap/compiled.php:695
PHP  10. array_walk() /path/to/app/bootstrap/compiled.php:634
PHP  11. Illuminate\Foundation\Application->Illuminate\Foundation\{closure}() /path/to/app/bootstrap/compiled.php:634
PHP  12. Sentry\SentryLaravel\SentryLaravelServiceProvider->boot() /path/to/app/bootstrap/compiled.php:633
PHP  13. Sentry\SentryLaravel\SentryLaravelServiceProvider->bindEvents() /path/to/app/vendor/sentry/sentry-laravel/src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php:38
PHP  14. Illuminate\Container\Container->offsetGet() /path/to/app/vendor/sentry/sentry-laravel/src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php:51
PHP  15. Illuminate\Foundation\Application->make() /path/to/app/bootstrap/compiled.php:353
PHP  16. Illuminate\Container\Container->make() /path/to/app/bootstrap/compiled.php:583
PHP  17. Illuminate\Container\Container->build() /path/to/app/bootstrap/compiled.php:205
PHP  18. Sentry\SentryLaravel\SentryLaravelServiceProvider->Sentry\SentryLaravel\{closure}() /path/to/app/bootstrap/compiled.php:233
PHP  19. Illuminate\Auth\AuthManager->check() /path/to/app/vendor/sentry/sentry-laravel/src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php:85
PHP  20. Illuminate\Support\Manager->__call() /path/to/app/vendor/sentry/sentry-laravel/src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php:85
PHP  21. call_user_func_array:{/path/to/app/bootstrap/compiled.php:8296}() /path/to/app/bootstrap/compiled.php:8296
PHP  22. Illuminate\Auth\Guard->check() /path/to/app/bootstrap/compiled.php:8296
PHP  23. Illuminate\Auth\Guard->user() /path/to/app/vendor/laravel/framework/src/Illuminate/Auth/Guard.php:105
PHP  24. Illuminate\Auth\EloquentUserProvider->retrieveById() /path/to/app/vendor/laravel/framework/src/Illuminate/Auth/Guard.php:144
PHP  25. Illuminate\Database\Eloquent\Model->newQuery() /path/to/app/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php:42
PHP  26. Illuminate\Database\Eloquent\Model->newQueryWithoutScopes() /path/to/app/bootstrap/compiled.php:6987
PHP  27. Illuminate\Database\Eloquent\Model->newBaseQueryBuilder() /path/to/app/bootstrap/compiled.php:6997
PHP  28. Illuminate\Database\Eloquent\Model->getConnection() /path/to/app/bootstrap/compiled.php:7020
PHP  29. Illuminate\Database\Eloquent\Model::resolveConnection() /path/to/app/bootstrap/compiled.php:7440

The service provider seemingly assumes the DatabaseServiceProvider as an example, has already been booted, which is not the case when SentryLaravelServiceProvider is run first. Is this an issue with the package?

Alternatively, is there a more appropriate way to make Sentry only operate in the production environment, that doesn't involve a production-only config file approach?

Issue with Laravel 4

Hi,

On my Laravel 4.2 app I have defined within my app/start/global.php file the following:

App::error(function(Exception $exception, $code) {
    Log::error($exception);
    ...
    if ( ! App::environment('local')) {
        switch ($code) {
            case 403:
                return Response::view('errors.403', [], 403);
            case 404:
                return Response::view('errors.404', [], 404);
            case 500:
                return Response::view('errors.500', [], 500);
            default:
                return Response::view('errors.default', [], $code);
        }
    }
});

but the problem is that the following code within src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php is not capturing the Exception:

$app->error(function (\Exception $e) use ($app) {
    $app['sentry']->captureException($e);
});

I guess it's because $app->error(function (\Exception $e) is actually similar to App::error(function(Exception $exception, $code) { and that my bit is overriding your bit?

Any workaround?

Sentry-Laravel breaks Artisan

From a support issue: Using Sentry with Laravel 5.2 on macOS breaks artisan.

The moment I comment out the "Sentry\SentryLaravel\SentryLaravelServiceProvider::class," and "'Sentry' => Sentry\SentryLaravel\SentryFacade::class," from the app.php file, artisan starts working again.

Auth guard driver is not found with custom guard.

I have created a custom Auth Guard in Laravel. But whenever I run a command with Artisan I get the following error: sentry.breadcrumbs error=Auth guard driver [wamp] is not defined.

When I run my queue it just keeps spamming that error over and over.

I'm pretty sure the guard is defined in my AuthServiceProvider:

/**
 * Register any authentication / authorization services.
 *
 * @return void
 */
public function boot()
{
    $this->registerPolicies();

    $this->registerTokensGuard();

    $this->registerWampUserProvider();
}

/**
 * Register the custom tokens guard.
 *
 * @return void
 */
private function registerTokensGuard()
{
    Auth::extend('tokens', function ($app, $name, array $config) {
        return new TokensGuard(
            Auth::createUserProvider($config['provider']),
            $app['request']
        );
    });
}

/**
 * Register the WAMP user provider.
 *
 * @return void
 */
private function registerWampUserProvider()
{
    Auth::provider('wamp', function ($app, array $config) {
        return new WampUserProvider(
            $app['hash'],
            $config['model'],
            $config['tokens']
        );
    });
}

Any known problems here?

Laravel 5.4 problem with jwt, and ide_helper

I upgraded to laravel 5.4 and now when I use my generator for the ide_helper I get this message each time:

sentry.breadcrumbs error=Auth guard driver [api] is not defined.

This is a longshot here in case someone else has run into this with the new release of 5.4... and can point me in the right direction. I'm opening issues on the ide_helper generator for Laravel as well and the JWTAuth package since I can't be sure which package is causing the issue.

Thanks

exceptions not showing up in sentry

I was using the raven package before with the configureMonologUsing method which was working fine. I replaced that with this package and not seeing exceptions in the sentry control panel.

This is on a local dev environment and I'm happy to provide more info or test anything that needs to be tested.

Limit amount of SQL queries reported

It would be nice to limit the amount of SQL queries that are reported - if you are running a cron task which does a lot of queries and it fails, it will report every single query run, that isn't nice. It also causes a big performance hit to log every single query when you are running a big cron task - which is why Laravel turned it off by default and optionally turn it on via DB::enableQueryLog()

Something like a config option with a sane value:

'max_queries' => 50

Issues in combination with Task scheduling

Hi,

Somehow when I install Sentry into my Laravel application it will continuously generate errors that will fill up my logs (>2gb a day). The errors seems to have issues with Amazon SQS (Which I'm not using in my application). It all started when I installed the Laravel Task Scheduling system which uses a cronjob.

Stack trace:

Next Aws\Sqs\Exception\SqsException: Error executing "ReceiveMessage" on "https://sqs.us-east-1.amazonaws.com/your-account-id/your-queue-name"; AWS HTTP error: Client error: `POST https://sqs.us-east-1.amazonaws.com/your-account-id/your-queue-name` resulted in a `403 Forbidden` response:
<?xml version="1.0"?><ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><Error><Type>Sender</Type><Code>I (truncated...)
 InvalidClientTokenId (client): The security token included in the request is invalid. - <?xml version="1.0"?><ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><Error><Type>Sender</Type><Code>InvalidClientTokenId</Code><Message>The security token included in the request is invalid.</Message><Detail/></Error><RequestId>17676a95-0471-5c5c-b8cf-25662a1a22a8</RequestId></ErrorResponse> in /var/www/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php:192
Stack trace:
#0 /var/www/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php(97): Aws\WrappedHttpHandler->parseError(Array, Object(GuzzleHttp\Psr7\Request), Object(Aws\Command), Array)
#1 /var/www/vendor/guzzlehttp/promises/src/Promise.php(203): Aws\WrappedHttpHandler->Aws\{closure}(Array)
#2 /var/www/vendor/guzzlehttp/promises/src/Promise.php(174): GuzzleHttp\Promise\Promise::callHandler(2, Array, Array)
#3 /var/www/vendor/guzzlehttp/promises/src/RejectedPromise.php(40): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}(Array)
#4 /var/www/vendor/guzzlehttp/promises/src/TaskQueue.php(61): GuzzleHttp\Promise\RejectedPromise::GuzzleHttp\Promise\{closure}()
#5 /var/www/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(96): GuzzleHttp\Promise\TaskQueue->run()
#6 /var/www/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(123): GuzzleHttp\Handler\CurlMultiHandler->tick()
#7 /var/www/vendor/guzzlehttp/promises/src/Promise.php(246): GuzzleHttp\Handler\CurlMultiHandler->execute(true)
#8 /var/www/vendor/guzzlehttp/promises/src/Promise.php(223): GuzzleHttp\Promise\Promise->invokeWaitFn()
#9 /var/www/vendor/guzzlehttp/promises/src/Promise.php(266): GuzzleHttp\Promise\Promise->waitIfPending()
#10 /var/www/vendor/guzzlehttp/promises/src/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList()
#11 /var/www/vendor/guzzlehttp/promises/src/Promise.php(269): GuzzleHttp\Promise\Promise->waitIfPending()
#12 /var/www/vendor/guzzlehttp/promises/src/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList()
#13 /var/www/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#14 /var/www/vendor/aws/aws-sdk-php/src/AwsClientTrait.php(59): GuzzleHttp\Promise\Promise->wait()
#15 /var/www/vendor/aws/aws-sdk-php/src/AwsClientTrait.php(78): Aws\AwsClient->execute(Object(Aws\Command))
#16 /var/www/vendor/laravel/framework/src/Illuminate/Queue/SqsQueue.php(114): Aws\AwsClient->__call('receiveMessage', Array)
#17 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(180): Illuminate\Queue\SqsQueue->pop()
#18 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(149): Illuminate\Queue\Worker->getNextJob(Object(Illuminate\Queue\SqsQueue), NULL)
#19 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(111): Illuminate\Queue\Worker->pop('sqs', NULL, 0, '3', '3')
#20 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(85): Illuminate\Queue\Worker->runNextJobForDaemon('sqs', NULL, 0, '3', '3')
#21 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(119): Illuminate\Queue\Worker->daemon('sqs', NULL, 0, 128, '3', '3')
#22 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(78): Illuminate\Queue\Console\WorkCommand->runWorker('sqs', NULL, 0, 128, true)
#23 [internal function]: Illuminate\Queue\Console\WorkCommand->fire()
#24 /var/www/bootstrap/cache/compiled.php(1257): call_user_func_array(Array, Array)
#25 /var/www/vendor/laravel/framework/src/Illuminate/Console/Command.php(169): Illuminate\Container\Container->call(Array)
#26 /var/www/vendor/symfony/console/Command/Command.php(256): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /var/www/vendor/laravel/framework/src/Illuminate/Console/Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 /var/www/vendor/symfony/console/Application.php(791): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 /var/www/vendor/symfony/console/Application.php(186): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 /var/www/vendor/symfony/console/Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#31 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#32 /var/www/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#33 {main}

Hope you can help me out!

Thanks,
Niels

Symfony\Component\Debug\Exception\FatalErrorException: Uncaught ErrorException: mb_convert_encoding()

We are getting this error reported in sentry once per hour, and it appears to be extending from the Raven lib. Are there any other reports of this/is there a fix for it? We are using PHP7.0 and nginx.

Symfony\Component\Debug\Exception\FatalErrorException: Uncaught ErrorException: mb_convert_encoding(): Unable to detect character encoding in /[folder_route]/vendor/sentry/sentry/lib/Raven/ReprSerializer.php:41
Stack trace:
#0 /[folder_route]/vendor/sentry/sentry/lib/Raven/Breadcrumbs/ErrorHandler.php(36): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'mb_convert_enco...', '/[folder_route]...', 41, Array)
#1 [internal function]: Raven_Breadcrumbs_ErrorHandler->handleError(2, 'mb_convert_enco...', '/[folder_route]...', 41, Array)
#2 /[folder_route]/vendor/sentry/sentry/lib/Raven/ReprSerializer.php(41): mb_convert_encoding('\xFF\xF3@\xC4\x00\x14\x00J\xB0\x0FO\x10\x00Bt...', 'UTF-8', 'auto')
#3 /[folder_route]/vendor/sentry/sentry/lib/Raven/Serializer.php(45): Raven_ReprSerializer->serializeValue('\xFF\xF3@\xC4\x00\x14\x00J\xB0\x0FO\x10\x00Bt...')
#4 /[folder_route]/vendor/sentry/sentry/lib/Raven/Serializer.php(40)
#0 vendor/sentry/sentry/lib/Raven/ReprSerializer.php(41): null

Should this package register with Monolog instead

The docs currently indicate that we should capture the exception with Sentry in the report() method of our app's exception handler. However, this means that every exception is being reported, even those in the $dontReport array.

To get around this, you would need to first check that the exception should be reported.

    public function report(Exception $e)
    {
        if ($this->shouldReport($e)) {
            Sentry::captureException($e);
        }

        return parent::report($e);
    }

Perhaps instead, this package should register the Raven client with Laravel's Monolog instance. That way when the parent report() method is called, Laravel will only report the exception to Sentry if the exception is to be reported.

php artisan sentry:test -> Timeout

I am on Laravel 5.4 and php artisan sentry:test

gives me

[sentry] Client configuration:
-> server: https://sentry.io/api/107080/store/
-> project: 107080
-> public_key: xxx
-> secret_key: xxx
[sentry] Generating test event
[sentry] Sending test event with ID: xxx
[sentry] There was an error sending the test event:
 Operation timed out after 2002 milliseconds with 0 bytes received

How to track this down?

How to "fix" reported IP when using a proxy?

Our site uses not only haproxy on the server side, but we're behind Cloudflare as well. As a result, all of our exceptions that are caught by Sentry are reporting "user = ip:127.0.0.1" under Tags, and "IP Address 127.0.0.1" under User.

We do set an "X-Forwarded-For" header with the correct IP address (left-most entry in a comma-delimited list), but I'm trying to figure out how to override the value that is automatically reported.

To make things "worse", this is for a Laravel 4.2 application. Request::ip() handles the X-Forwarded-For parsing, so I've tried the following in app/start/global.php:

App::error(function (Exception $exception, $code) {
    // Add context to Sentry

    $ip = Request::ip();
    Sentry::tags_context(array(
        'user' => 'ip:' . $ip
    ));

    Log::error($exception);
});

But Sentry adds the following to the error report:

There was 1 error encountered while processing this event
Discarded invalid value for parameter 'tags'
{
  "name": "tags",
  "value": [
    "user",
    "ip:123.123.123.123"
  ]
}

Any suggestions on how to fix this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.