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

when update admin setting, show 500 internal server error, How to fix it? #1243

Closed
chenboshiun-zz opened this issue Oct 13, 2015 · 5 comments

Comments

@chenboshiun-zz
Copy link

Hello:

I have already installed snipe-it and edit Admin Setting, but discovered something issue when edit Admin Setting

Issue description:
when i went to change Admin Setting , show 500 internal server error and then i enable debug mode and show error as below:

(https://cloud.githubusercontent.com/assets/5372796/10450922/d6e3a6e4-71cf-11e5-9be5-498caa4d7711.png)

go to app/storage/logs and capture log:

Next exception 'Illuminate\Database\QueryException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'custom_css' in 'field list' (SQL: update settings set updated_at = 2015-10-13 17:27:51, per_page = 75, qr_code = 0, qr_text = , auto_increment_prefix = , header_color = , alert_email = , default_eula_text = , slack_endpoint = , slack_channel = , slack_botname = , default_currency = $, custom_css = where id = 1)' in /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Database/Connection.php:625
Stack trace:
#0 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Database/Connection.php(581): Illuminate\Database\Connection->runQueryCallback('update setting...', Array, Object(Closure)) #1 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Database/Connection.php(394): Illuminate\Database\Connection->run('update setting...', Array, Object(Closure))
#2 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Database/Connection.php(339): Illuminate\Database\Connection->affectingStatement('update setting...', Array) #3 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1925): Illuminate\Database\Connection->update('update setting...', Array)
#4 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(316): Illuminate\Database\Query\Builder->update(Array)
#5 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1515): Illuminate\Database\Eloquent\Builder->update(Array)
#6 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1448): Illuminate\Database\Eloquent\Model->performUpdate(Object(Illuminate\Database\Eloquent\Builder), Array)
#7 /home/jackchen/snipe-it-master/app/controllers/admin/SettingsController.php(139): Illuminate\Database\Eloquent\Model->save()
#8 [internal function]: Controllers\Admin\SettingsController->postEdit()
#9 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(231): call_user_func_array(Array, Array)
#10 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(93): Illuminate\Routing\Controller->callAction('postEdit', Array)
#11 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(62): Illuminate\Routing\ControllerDispatcher->call(Object(Controllers\Admin\SettingsController), Object(Illuminate\Routing\Route), 'postEdit')
#12 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Routing/Router.php(967): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'Controllers\Adm...', 'postEdit')
#13 [internal function]: Illuminate\Routing\Router->Illuminate\Routing{closure}()
#14 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Routing/Route.php(109): call_user_func_array(Object(Closure), Array)
#15 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1033): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#16 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1001): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#17 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(775): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#18 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(745): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#19 /home/jackchen/snipe-it-master/vendor/barryvdh/laravel-debugbar/src/Middleware/Stack.php(34): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true)
#20 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Session/Middleware.php(72): Barryvdh\Debugbar\Middleware\Stack->handle(Object(Illuminate\Http\Request), 1, true)
#21 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Cookie/Queue.php(47): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
#22 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Cookie/Guard.php(51): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
#23 /home/jackchen/snipe-it-master/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
#24 /home/jackchen/snipe-it-master/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(641): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
#25 /home/jackchen/snipe-it-master/public/index.php(49): Illuminate\Foundation\Application->run()

Version of Snipe-IT: v2.0-125-g9b04954
Version of OS: Ubuntu 14.04.3 LTS (GNU/Linux 3.19.0-25-generic x86_64)
Version of PHP: 5.5.9-1ubuntu4.13
Version of Laravel: 4.2.17
Version of Apache: Apache/2.4.7 (Ubuntu)
Version of MySQL: 5.5.44-0ubuntu0.14.04.1

Please help me solve this issue, Thank you

@snipe
Copy link
Owner

snipe commented Oct 13, 2015

Looks like your migrations are not up to date. Have you run php artisan migrate?

@chenboshiun-zz
Copy link
Author

No, I just ran command "php artisan migrate" in snipe-it-master directory , Now is fixed.

But, why show this error!? please give me your advice

thanks.

@snipe
Copy link
Owner

snipe commented Oct 13, 2015

The error was showing up because the migrations weren't run. Migrations are what bring the database table structure up to date, so that when the code changes to expect new fields, the new fields are actually in the database.

@snipe
Copy link
Owner

snipe commented Oct 13, 2015

(You should always run migrations after upgrading Snipe-IT. It's in every release's notes, and also in the documentation. http://docs.snipeitapp.com/upgrading.html )

@snipe snipe closed this as completed Oct 13, 2015
@chenboshiun-zz
Copy link
Author

okay. Thank you very much. : )

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

2 participants