2016-05-27 102 views
2

,當我試圖在運行我的生產服務器上我的php artisan migrate ...Bugsnag錯誤運行工匠命令

PHP Fatal error: Uncaught exception 'Exception' with message 'Bugsnag Error: Invalid API key' in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php:19 
Stack trace: 
#0 /var/app/current/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagLaravelServiceProvider.php(61): Bugsnag_Client->__construct(NULL) 
#1 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(738): Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider->Bugsnag\BugsnagLaravel\{closure}(Object(Illuminate\Foundation\Application), Array) 
#2 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build(Object(Closure), Array) 
#3 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('bugsnag', Array) 
#4 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(62): Illuminate\Foundation\Application->make('bugsnag', Array) 
#5 /var/app/current/vendor/bugsnag/bugsna in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php on line 19 
PHP Fatal error: Uncaught exception 'Exception' with message 'Bugsnag Error: Invalid API key' in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php:19 
Stack trace: 
#0 /var/app/current/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagLaravelServiceProvider.php(61): Bugsnag_Client->__construct(NULL) 
#1 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(738): Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider->Bugsnag\BugsnagLaravel\{closure}(Object(Illuminate\Foundation\Application), Array) 
#2 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build(Object(Closure), Array) 
#3 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('bugsnag', Array) 
#4 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(62): Illuminate\Foundation\Application->make('bugsnag', Array) 
#5 /var/app/current/vendor/bugsnag/bugsna in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php on line 19 

我在命令行中運行env得到這個錯誤,我有一個環境變量稱爲BUGSNAG_API_KEY和它的價值完全符合bugsnag.com上該項目的關鍵。

此外,我在我的項目這條線在./config/bugsnag.php

'api_key' => env('BUGSNAG_API_KEY'),

古怪,我終於再次嘗試相同的命令(php artisan migrate)和它的工作!但是它讓我非常不安,因爲它是一個生產服務器。所以我想了解這個問題。

錯誤似乎也記錄在Bugsnag順便說一句。

+0

當API密鑰不是字符串時,Bugnsnag源會引發此錯誤。 – TheFallen

回答

1

嘗試使用php artisan config:cache重新生成配置高速緩存。它將使用.env文件中的當前數據生成新的配置緩存。這對我有效。