Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'ReflectionException' with message 'Class bugsnag does not exist' #41

Closed
Jaspur opened this issue Feb 26, 2015 · 5 comments
Closed

'ReflectionException' with message 'Class bugsnag does not exist' #41

Jaspur opened this issue Feb 26, 2015 · 5 comments

Comments

@Jaspur
Copy link

Jaspur commented Feb 26, 2015

PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class bugsnag does not exist' in /home/forge/foobar.nl/storage/framework/compiled.php:1029
Stack trace:
#0 /home/forge/foobar.nl/storage/framework/compiled.php(1029): ReflectionClass->__construct('bugsnag')
#1 /home/forge/foobar.nl/storage/framework/compiled.php(980): Illuminate\Container\Container->build('bugsnag', Array)
#2 /home/forge/foobar.nl/storage/framework/compiled.php(1493): Illuminate\Container\Container->make('bugsnag', Array)
#3 /home/forge/foobar.nl/storage/framework/compiled.php(1213): Illuminate\Foundation\Application->make('bugsnag')
#4 /home/forge/foobar.nl/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagExceptionHandler.php(25): Illuminate\Container\Container->offsetGet('bugsnag')
#5 /home/forge/foobar.nl/app/Exceptions/Handler.php(27): Bugsnag\BugsnagLaravel\BugsnagExceptionHandler->report(Object(ReflectionException))
#6 /home/forge/mijnplusmo in /home/forge/foobar.nl/storage/framework/compiled.php on line 1029
PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class bugsnag does not exist' in /home/forge/foobar.nl/storage/framework/compiled.php:1029
Stack trace:
#0 /home/forge/foobar.nl/storage/framework/compiled.php(1029): ReflectionClass->__construct('bugsnag')
#1 /home/forge/foobar.nl/storage/framework/compiled.php(980): Illuminate\Container\Container->build('bugsnag', Array)
#2 /home/forge/foobar.nl/storage/framework/compiled.php(1493): Illuminate\Container\Container->make('bugsnag', Array)
#3 /home/forge/foobar.nl/storage/framework/compiled.php(1213): Illuminate\Foundation\Application->make('bugsnag')
#4 /home/forge/foobar.nl/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagExceptionHandler.php(25): Illuminate\Container\Container->offsetGet('bugsnag')
#5 /home/forge/foobar.nl/app/Exceptions/Handler.php(27): Bugsnag\BugsnagLaravel\BugsnagExceptionHandler->report(Object(Symfony\Component\Debug\Exception\FatalErrorExc in /home/forge/foobar.nl/storage/framework/compiled.php on line 1029
@ConradIrwin
Copy link
Contributor

@Jaspur which version of Laravel are you using? Are you loading the BugsnagLaravelServiceProvider?

@thomasjsn
Copy link

I get this error as well

PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class bugsnag does not exist' in /var/www/staging/foobar/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php:776
Stack trace:
#0 /var/www/staging/foobar/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(776): ReflectionClass->__construct('bugsnag')
#1 /var/www/staging/foobar/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(656): Illuminate\\Container\\Container->build('bugsnag', Array)
#2 /var/www/staging/foobar/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(613): Illuminate\\Container\\Container->make('bugsnag', Array)
#3 /var/www/staging/foobar/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(1231): Illuminate\\Foundation\\Application->make('bugsnag')
#4 /var/www/staging/foobar/laravel/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagExceptionHandler.php(25): Illuminate\\Container\\Container->offsetGet('bugsnag')
#5 /var/www/staging/foobar in /var/www/staging/foobar/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 776

I am using Laravel 5.0.16, I am loading the service provider:

'Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider',

And alias:

'Bugsnag' => 'Bugsnag\BugsnagLaravel\BugsnagFacade',

I resolved it by making the vendor folder writable by the web server, but I don't get why that should be necessary.

@thomasjsn
Copy link

So I did a little bit more testing, I put the permissions on the vendor folder back (not writable by the web-server). No errors until I did a composer update, which did not update any packages but it did generate autoload files and optimized class loader.

Update:
Okey I found the problem... My /vendor folder was not writable, so when I did composer update the services.json file was deleted and the system did not have permissions to create a new one.

@snmaynard
Copy link
Contributor

Glad you solved it (and thanks for letting us know how @HebronNor)!

@tachu
Copy link

tachu commented Jun 21, 2016

I'm having the exact same error when running in Google app engine. They require you to run composer update from your environment and then deploying to appEngine. The app engine sandbox makes it so you can't write do disk. IS there a workaround for this? Why does it need to be able to write to disk if its already been composed?

t

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants