rollbar / rollbar-php-laravel

Rollbar error monitoring integration for Laravel projects
https://docs.rollbar.com/docs/laravel
140 stars 38 forks source link

Possible conflict with Laravel Horizon? #81

Closed redhedded1 closed 5 years ago

redhedded1 commented 5 years ago

If this is not an issue related to Rollbar or a known issue I apologize in advance. I have searched extensively and cannot find anything useful about this error. It only happens upon changing the config/logging.php as follows:

  'channels' => [

        'rollbar' => [

            'driver' => 'monolog',
            'handler' => \Rollbar\Laravel\MonologHandler::class,
            'access_token' => env('ROLLBAR_TOKEN'),
            'level' => 'debug',
            'person_fn' => 'Auth::user',
            'capture_email' => true,
            'capture_username' => true

       ],

        'stack' => [

            'driver' => 'stack',
            'channels' => ['rollbar','daily'],

        ],

Laravel Framework 5.7.26 Laravel Horizon 2.0 Rollbar (rollbar/laravel) 4.0.3

Class hash does not exist

ReflectionException 
…/vendor/laravel/framework/src/Illuminate/Container/Container.php779

26    
ReflectionClass __construct
…/vendor/laravel/framework/src/Illuminate/Container/Container.php779

25
Illuminate\Container\Container build
…/vendor/laravel/framework/src/Illuminate/Container/Container.php658

24
Illuminate\Container\Container resolve
…/vendor/laravel/framework/src/Illuminate/Container/Container.php609

23
Illuminate\Container\Container make
…/vendor/laravel/framework/src/Illuminate/Foundation/Application.php759

22
Illuminate\Foundation\Application make
…/vendor/laravel/framework/src/Illuminate/Container/Container.php1222

21
Illuminate\Container\Container offsetGet
…/vendor/laravel/framework/src/Illuminate/Auth/CreatesUserProviders.php82

20
Illuminate\Auth\AuthManager createEloquentProvider
…/vendor/laravel/framework/src/Illuminate/Auth/CreatesUserProviders.php40

19
Illuminate\Auth\AuthManager createUserProvider
…/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php121

18
Illuminate\Auth\AuthManager createSessionDriver
…/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php94

17
Illuminate\Auth\AuthManager resolve
…/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php68

16
Illuminate\Auth\AuthManager guard
…/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php292

15
Illuminate\Auth\AuthManager __call
…/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php237

14
Illuminate\Support\Facades\Facade __callStatic
…/vendor/rollbar/rollbar-laravel/src/MonologHandler.php42

13
 call_user_func
…/vendor/rollbar/rollbar-laravel/src/MonologHandler.php42

12
Rollbar\Laravel\MonologHandler addContext
…/vendor/rollbar/rollbar-laravel/src/MonologHandler.php18

11
Rollbar\Laravel\MonologHandler write
…/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php39

10
Monolog\Handler\AbstractProcessingHandler handle
…/vendor/monolog/monolog/src/Monolog/Logger.php344

9
Monolog\Logger addRecord
…/vendor/monolog/monolog/src/Monolog/Logger.php707

8
Monolog\Logger error
…/vendor/laravel/framework/src/Illuminate/Log/Logger.php176

7
Illuminate\Log\Logger writeLog
…/vendor/laravel/framework/src/Illuminate/Log/Logger.php87

6
Illuminate\Log\Logger error
…/vendor/laravel/framework/src/Illuminate/Log/LogManager.php498

5
Illuminate\Log\LogManager error
…/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php114

4
Illuminate\Foundation\Exceptions\Handler report
…/app/Exceptions/Handler.php40

3
App\Exceptions\Handler report
…/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php81

2
Illuminate\Foundation\Bootstrap\HandleExceptions handleException
…/vendor/rollbar/rollbar/src/Handlers/ExceptionHandler.php37

1
 call_user_func
…/vendor/rollbar/rollbar/src/Handlers/ExceptionHandler.php37

0
Rollbar\Handlers\ExceptionHandler handle
[internal]0
jessewgibbs commented 5 years ago

@redhedded1 thanks for bringing this to our attention.

@ArturMoczulski can you take a look into this?

redhedded1 commented 5 years ago

Thank you. I wasn't clear about the fact that it only throws the error when accessing the horizon dashboard url. The Laravel application still works, and Rollbar dashboard/error logging is working fine.

ArturMoczulski commented 5 years ago

Can you verify that the issue doesn't happen if you turn off Rollbar?

redhedded1 commented 5 years ago

Yes. The app was using Horizon without issue. If I install Rollbar via composer and place the entries in the config/logging.php then the error occurs. Changing logging.php back to remove the rollbar entries is enough to bring Horizon back to working state. The below config disabling rollbar works fine.

    'channels' => [
      'stack' => [
        'driver' => 'stack',
        'channels' => ['daily']
    ],
ArturMoczulski commented 5 years ago

@redhedded1 despite my efforts, I wasn't able to reproduce the problem. I've tested on:

Laravel 5.7.28 Horizon 2.0 rollbar-php-laravel 4.0.3

One thing is that you said in the comment above you're using Laravel 5.7.26. I can't find this Laravel tag in their github repo. Are you sure that's your version?

Other than that, I believe we would have to do a video chat to debug the issue together. Would you be open to that?

redhedded1 commented 5 years ago

@ArturMoczulski Thank you for the information. I must have made a typo on the Laravel version because php artisan laravel --version returns Laravel Framework 5.7.27

If you were unable to reproduce, let me look over some things tomorrow since it is obvious I have done something incorrectly in my setup. Thank you again for checking it out, sorry for the bother.

ArturMoczulski commented 5 years ago

No worries. I'm here to help. If you get stuck I'm happy to chat or do a video call to help you resolve the issue.

redhedded1 commented 5 years ago

OK, I'm stuck. I cannot figure it out. Let's do that video call. What's your preferred method, Skype or whatever is fine and at your convenience. Thank you again for the assistance.

The only thing I did was configure HTTP authentication to access the Horizon dashboard in Production. Let's see what you think though over a video call.

ArturMoczulski commented 5 years ago

Sorry for the delay. Please email me on artur.moczulski@rollbar.com and we will schedule a call.

ArturMoczulski commented 5 years ago

@redhedded1 do you still need assistance with this?

redhedded1 commented 5 years ago

No I was able to resolve it just by upgrading Laravel, closing.

ArturMoczulski commented 5 years ago

Great to hear. Lmk if you need help with anything else