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

ErrorException on fresh install #291

Closed
blakestock opened this issue Oct 23, 2014 · 12 comments
Closed

ErrorException on fresh install #291

blakestock opened this issue Oct 23, 2014 · 12 comments

Comments

@blakestock
Copy link

Hi!

I'm trying to get Snipe-IT up and running and getting an error in the logs when trying to load the site. I used the Snipe-IT Installation scripts created by @GR360RY and it is running on an Ubuntu 14.04 VM. I've also gone through the documentation to make sure everything has been followed and configured, but I'm at a loss now.

If I need to include any further information please let me know, the stack trace is below:

[2014-10-23 14:56:10] production.ERROR: exception 'ErrorException' with message 'Trying to get property of non-object' in /var/www/snipeit/app/storage/views/ca2de54ab767c93a92a8973048ab1f0c:11
Stack trace:
#0 /var/www/snipeit/app/storage/views/ca2de54ab767c93a92a8973048ab1f0c(11): Illuminate\Exception\Handler->handleError(8, 'Trying to get p...', '/var/www/snipei...', 11, Array)
#1 /var/www/snipeit/bootstrap/compiled.php(9614): include('/var/www/snipei...')
#2 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('/var/www/snipei...', Array)
#3 /var/www/snipeit/bootstrap/compiled.php(9492): Illuminate\View\Engines\CompilerEngine->get('/var/www/snipei...', Array)
#4 /var/www/snipeit/bootstrap/compiled.php(9479): Illuminate\View\View->getContents()
#5 /var/www/snipeit/bootstrap/compiled.php(9470): Illuminate\View\View->renderContents()
#6 /var/www/snipeit/app/storage/views/660b41dfcf6e73c31efcf3d5a81f95f3(2): Illuminate\View\View->render()
#7 /var/www/snipeit/bootstrap/compiled.php(9614): include('/var/www/snipei...')
#8 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('/var/www/snipei...', Array)
#9 /var/www/snipeit/bootstrap/compiled.php(9492): Illuminate\View\Engines\CompilerEngine->get('/var/www/snipei...', Array)
#10 /var/www/snipeit/bootstrap/compiled.php(9479): Illuminate\View\View->getContents()
#11 /var/www/snipeit/bootstrap/compiled.php(9470): Illuminate\View\View->renderContents()
#12 /var/www/snipeit/app/storage/views/d2858d3b27e728c213fc21ec28856517(71): Illuminate\View\View->render()
#13 /var/www/snipeit/bootstrap/compiled.php(9614): include('/var/www/snipei...')
#14 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('/var/www/snipei...', Array)
#15 /var/www/snipeit/bootstrap/compiled.php(9492): Illuminate\View\Engines\CompilerEngine->get('/var/www/snipei...', Array)
#16 /var/www/snipeit/bootstrap/compiled.php(9479): Illuminate\View\View->getContents()
#17 /var/www/snipeit/bootstrap/compiled.php(9470): Illuminate\View\View->renderContents()
#18 /var/www/snipeit/bootstrap/compiled.php(10168): Illuminate\View\View->render()
#19 /var/www/snipeit/bootstrap/compiled.php(9700): Illuminate\Http\Response->setContent(Object(Illuminate\View\View))
#20 /var/www/snipeit/bootstrap/compiled.php(4858): Symfony\Component\HttpFoundation\Response->__construct(Object(Illuminate\View\View))
#21 /var/www/snipeit/bootstrap/compiled.php(4684): Illuminate\Routing\Router->prepareResponse(Object(Illuminate\Http\Request), Object(Illuminate\View\View))
#22 /var/www/snipeit/bootstrap/compiled.php(4670): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#23 /var/www/snipeit/bootstrap/compiled.php(706): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#24 /var/www/snipeit/bootstrap/compiled.php(687): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#25 /var/www/snipeit/vendor/barryvdh/laravel-debugbar/src/Middleware/Stack.php(34): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true)
#26 /var/www/snipeit/bootstrap/compiled.php(1146): Barryvdh\Debugbar\Middleware\Stack->handle(Object(Illuminate\Http\Request), 1, true)
#27 /var/www/snipeit/bootstrap/compiled.php(7311): Illuminate\Http\FrameGuard->handle(Object(Illuminate\Http\Request), 1, true)
#28 /var/www/snipeit/bootstrap/compiled.php(7908): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
#29 /var/www/snipeit/bootstrap/compiled.php(7855): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
#30 /var/www/snipeit/bootstrap/compiled.php(10897): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
#31 /var/www/snipeit/bootstrap/compiled.php(648): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
#32 /var/www/snipeit/public/index.php(49): Illuminate\Foundation\Application->run()
#33 {main}

Next exception 'ErrorException' with message 'Trying to get property of non-object (View: /var/www/snipeit/app/views/backend/layouts/default.blade.php)' in /var/www/snipeit/app/storage/views/ca2de54ab767c93a92a8973048ab1f0c:11
Stack trace:
#0 /var/www/snipeit/bootstrap/compiled.php(9616): Illuminate\View\Engines\CompilerEngine->handleViewException(Object(ErrorException))
#1 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('/var/www/snipei...', Array)
#2 /var/www/snipeit/bootstrap/compiled.php(9492): Illuminate\View\Engines\CompilerEngine->get('/var/www/snipei...', Array)
#3 /var/www/snipeit/bootstrap/compiled.php(9479): Illuminate\View\View->getContents()
#4 /var/www/snipeit/bootstrap/compiled.php(9470): Illuminate\View\View->renderContents()
#5 /var/www/snipeit/app/storage/views/660b41dfcf6e73c31efcf3d5a81f95f3(2): Illuminate\View\View->render()
#6 /var/www/snipeit/bootstrap/compiled.php(9614): include('/var/www/snipei...')
#7 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('/var/www/snipei...', Array)
#8 /var/www/snipeit/bootstrap/compiled.php(9492): Illuminate\View\Engines\CompilerEngine->get('/var/www/snipei...', Array)
#9 /var/www/snipeit/bootstrap/compiled.php(9479): Illuminate\View\View->getContents()
#10 /var/www/snipeit/bootstrap/compiled.php(9470): Illuminate\View\View->renderContents()
#11 /var/www/snipeit/app/storage/views/d2858d3b27e728c213fc21ec28856517(71): Illuminate\View\View->render()
#12 /var/www/snipeit/bootstrap/compiled.php(9614): include('/var/www/snipei...')
#13 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('/var/www/snipei...', Array)
#14 /var/www/snipeit/bootstrap/compiled.php(9492): Illuminate\View\Engines\CompilerEngine->get('/var/www/snipei...', Array)
#15 /var/www/snipeit/bootstrap/compiled.php(9479): Illuminate\View\View->getContents()
#16 /var/www/snipeit/bootstrap/compiled.php(9470): Illuminate\View\View->renderContents()
#17 /var/www/snipeit/bootstrap/compiled.php(10168): Illuminate\View\View->render()
#18 /var/www/snipeit/bootstrap/compiled.php(9700): Illuminate\Http\Response->setContent(Object(Illuminate\View\View))
#19 /var/www/snipeit/bootstrap/compiled.php(4858): Symfony\Component\HttpFoundation\Response->__construct(Object(Illuminate\View\View))
#20 /var/www/snipeit/bootstrap/compiled.php(4684): Illuminate\Routing\Router->prepareResponse(Object(Illuminate\Http\Request), Object(Illuminate\View\View))
#21 /var/www/snipeit/bootstrap/compiled.php(4670): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#22 /var/www/snipeit/bootstrap/compiled.php(706): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#23 /var/www/snipeit/bootstrap/compiled.php(687): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#24 /var/www/snipeit/vendor/barryvdh/laravel-debugbar/src/Middleware/Stack.php(34): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true)
#25 /var/www/snipeit/bootstrap/compiled.php(1146): Barryvdh\Debugbar\Middleware\Stack->handle(Object(Illuminate\Http\Request), 1, true)
#26 /var/www/snipeit/bootstrap/compiled.php(7311): Illuminate\Http\FrameGuard->handle(Object(Illuminate\Http\Request), 1, true)
#27 /var/www/snipeit/bootstrap/compiled.php(7908): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
#28 /var/www/snipeit/bootstrap/compiled.php(7855): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
#29 /var/www/snipeit/bootstrap/compiled.php(10897): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
#30 /var/www/snipeit/bootstrap/compiled.php(648): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
#31 /var/www/snipeit/public/index.php(49): Illuminate\Foundation\Application->run()
#32 {main}

Next exception 'ErrorException' with message 'Trying to get property of non-object (View: /var/www/snipeit/app/views/backend/layouts/default.blade.php) (View: /var/www/snipeit/app/views/backend/layouts/default.blade.php)' in /var/www/snipeit/app/storage/views/ca2de54ab767c93a92a8973048ab1f0c:11
Stack trace:
#0 /var/www/snipeit/bootstrap/compiled.php(9616): Illuminate\View\Engines\CompilerEngine->handleViewException(Object(ErrorException))
#1 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('/var/www/snipei...', Array)
#2 /var/www/snipeit/bootstrap/compiled.php(9492): Illuminate\View\Engines\CompilerEngine->get('/var/www/snipei...', Array)
#3 /var/www/snipeit/bootstrap/compiled.php(9479): Illuminate\View\View->getContents()
#4 /var/www/snipeit/bootstrap/compiled.php(9470): Illuminate\View\View->renderContents()
#5 /var/www/snipeit/app/storage/views/d2858d3b27e728c213fc21ec28856517(71): Illuminate\View\View->render()
#6 /var/www/snipeit/bootstrap/compiled.php(9614): include('/var/www/snipei...')
#7 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('/var/www/snipei...', Array)
#8 /var/www/snipeit/bootstrap/compiled.php(9492): Illuminate\View\Engines\CompilerEngine->get('/var/www/snipei...', Array)
#9 /var/www/snipeit/bootstrap/compiled.php(9479): Illuminate\View\View->getContents()
#10 /var/www/snipeit/bootstrap/compiled.php(9470): Illuminate\View\View->renderContents()
#11 /var/www/snipeit/bootstrap/compiled.php(10168): Illuminate\View\View->render()
#12 /var/www/snipeit/bootstrap/compiled.php(9700): Illuminate\Http\Response->setContent(Object(Illuminate\View\View))
#13 /var/www/snipeit/bootstrap/compiled.php(4858): Symfony\Component\HttpFoundation\Response->__construct(Object(Illuminate\View\View))
#14 /var/www/snipeit/bootstrap/compiled.php(4684): Illuminate\Routing\Router->prepareResponse(Object(Illuminate\Http\Request), Object(Illuminate\View\View))
#15 /var/www/snipeit/bootstrap/compiled.php(4670): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#16 /var/www/snipeit/bootstrap/compiled.php(706): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#17 /var/www/snipeit/bootstrap/compiled.php(687): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#18 /var/www/snipeit/vendor/barryvdh/laravel-debugbar/src/Middleware/Stack.php(34): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true)
#19 /var/www/snipeit/bootstrap/compiled.php(1146): Barryvdh\Debugbar\Middleware\Stack->handle(Object(Illuminate\Http\Request), 1, true)
#20 /var/www/snipeit/bootstrap/compiled.php(7311): Illuminate\Http\FrameGuard->handle(Object(Illuminate\Http\Request), 1, true)
#21 /var/www/snipeit/bootstrap/compiled.php(7908): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
#22 /var/www/snipeit/bootstrap/compiled.php(7855): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
#23 /var/www/snipeit/bootstrap/compiled.php(10897): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
#24 /var/www/snipeit/bootstrap/compiled.php(648): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
#25 /var/www/snipeit/public/index.php(49): Illuminate\Foundation\Application->run()
#26 {main}

Next exception 'ErrorException' with message 'Trying to get property of non-object (View: /var/www/snipeit/app/views/backend/layouts/default.blade.php) (View: /var/www/snipeit/app/views/backend/layouts/default.blade.php) (View: /var/www/snipeit/app/views/backend/layouts/default.blade.php)' in /var/www/snipeit/app/storage/views/ca2de54ab767c93a92a8973048ab1f0c:11
Stack trace:
#0 /var/www/snipeit/bootstrap/compiled.php(9616): Illuminate\View\Engines\CompilerEngine->handleViewException(Object(ErrorException))
#1 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('/var/www/snipei...', Array)
#2 /var/www/snipeit/bootstrap/compiled.php(9492): Illuminate\View\Engines\CompilerEngine->get('/var/www/snipei...', Array)
#3 /var/www/snipeit/bootstrap/compiled.php(9479): Illuminate\View\View->getContents()
#4 /var/www/snipeit/bootstrap/compiled.php(9470): Illuminate\View\View->renderContents()
#5 /var/www/snipeit/bootstrap/compiled.php(10168): Illuminate\View\View->render()
#6 /var/www/snipeit/bootstrap/compiled.php(9700): Illuminate\Http\Response->setContent(Object(Illuminate\View\View))
#7 /var/www/snipeit/bootstrap/compiled.php(4858): Symfony\Component\HttpFoundation\Response->__construct(Object(Illuminate\View\View))
#8 /var/www/snipeit/bootstrap/compiled.php(4684): Illuminate\Routing\Router->prepareResponse(Object(Illuminate\Http\Request), Object(Illuminate\View\View))
#9 /var/www/snipeit/bootstrap/compiled.php(4670): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#10 /var/www/snipeit/bootstrap/compiled.php(706): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#11 /var/www/snipeit/bootstrap/compiled.php(687): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#12 /var/www/snipeit/vendor/barryvdh/laravel-debugbar/src/Middleware/Stack.php(34): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true)
#13 /var/www/snipeit/bootstrap/compiled.php(1146): Barryvdh\Debugbar\Middleware\Stack->handle(Object(Illuminate\Http\Request), 1, true)
#14 /var/www/snipeit/bootstrap/compiled.php(7311): Illuminate\Http\FrameGuard->handle(Object(Illuminate\Http\Request), 1, true)
#15 /var/www/snipeit/bootstrap/compiled.php(7908): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
#16 /var/www/snipeit/bootstrap/compiled.php(7855): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
#17 /var/www/snipeit/bootstrap/compiled.php(10897): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
#18 /var/www/snipeit/bootstrap/compiled.php(648): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
#19 /var/www/snipeit/public/index.php(49): Illuminate\Foundation\Application->run()
#20 {main} [] []

Thanks!
Blake

@snipe
Copy link
Owner

snipe commented Oct 23, 2014

I'm not as familiar with @GR360RY's setup. Can you tell me what's on line 11 of /var/www/snipeit/app/storage/views/ca2de54ab767c93a92a8973048ab1f0c?

@blakestock
Copy link
Author

Line 11 of that file is:
site_name); ?>

@snipe
Copy link
Owner

snipe commented Oct 23, 2014

Can you confirm that your database has been created properly, etc?

@blakestock
Copy link
Author

It looks like it did,

mysql> use my_db;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+-----------------+
| Tables_in_my_db |
+-----------------+
| asset_logs |
| asset_uploads |
| assets |
| categories |
| depreciations |
| groups |
| history |
| license_seats |
| licenses |
| locations |
| manufacturers |
| migrations |
| models |
| settings |
| status_labels |
| throttle |
| users |
| users_groups |
+-----------------+
18 rows in set (0.00 sec)

I dont think there's data in there though, sorry but I'm not a developer or do this kind of work often, I know enough to be dangerous really. Please let me know if that's not the info you're looking for.

When I hit the site in my browser I get the following:

snipeit_error

@bullfrog3459
Copy link

@blakestock can you run in mysql "select * from settings;" without the quotes. It will list everything that is in the table.

@blakestock
Copy link
Author

@bullfrog3459 that might be a problem,

mysql> select * from settings;
Empty set (0.00 sec)

@blakestock
Copy link
Author

Looks like I missed a step to seed the DB, it seems to have fixed the problem though! There was an issue when running the command though, please see below:

blakestock@assets:/var/www/snipeit$ sudo php artisan db:seed
[sudo] password for blakestock:
Seeded: AssetsSeeder
Seeded: CategoriesSeeder
Seeded: LocationsSeeder
Seeded: ManufacturersSeeder
Seeded: ModelsSeeder
Seeded: DepreciationsSeeder
Seeded: StatuslabelsSeeder
Seeded: SettingsSeeder
Seeded: LicensesSeeder

[Illuminate\Database\QueryException]
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'asset_id' in 'field list' (SQL: insert into license_seats
(asset_id, assigned_to, created_at, deleted_at, license_id, notes, updated_at, user_id) values (1,
1, 2014-10-14 14:05:44, , 1, , 2014-10-11 14:05:44, 1), (2, 2, 2014-10-01 14:05:44, , 1, , 2014-09-28 14:05:44, 1)
, (3, 2, 2014-09-18 14:05:44, , 1, , 2014-09-15 14:05:44, 1), (, 0, 2014-09-05 14:05:44, , 1, , 2014-09-02 14:05:44
, 1), (, 2, 2014-08-23 14:05:44, , 1, , 2014-08-20 14:05:44, 1), (, 1, 2014-08-10 14:05:44, , 2, , 2014-08-07 14:05
:44, 1), (, 0, 2014-07-28 14:05:44, , 2, , 2014-07-25 14:05:44, 1))

db:seed [--class[="..."]] [--database[="..."]]

Looks like it didn't finish putting data in all the tables including the user table and I'm guessing that's why I can't login yet.

@bullfrog3459
Copy link

@blakestock it looks like that was the informational data so it shouldn't be of much concern as long as you can get into it and create your assets and licenses correctly.

@blakestock
Copy link
Author

Finally have it fully working now. Thanks for the help @bullfrog3459 and @snipe. The install script I used was from the README.md under the Documentation & Installation and it seems to be out dated. The ansible playbook install that @GR360RY created is what I had used at first. I had to start from scratch and just follow @snipe's documentation.

There's a couple things I'd like to add about the install process that were not noted though. It would be very helpful on the install page to list out all the prerequisites needed to get this up and running like composer, laravel 4.1, etc. Its pretty minor but would have been very helpful in getting things installed and running quicker. While going through the steps for the Linux install, I had to change the owner:group of app/storage from root:root to root:www-data, it installed as root:root but the site would not load until changing that. Last, the database did not get created by the install. I had to manually define the database in mysql prior to being able to run "php artisan app:install"

Thanks a ton for creating this application as it is the perfection solution for what I need in regards to asset and licensing management.

@snipe
Copy link
Owner

snipe commented Oct 24, 2014

@blakestock But Laravel 4.1 isn't a requirement, as such. It's pulled down using composer, so you don't need to have it installed in advance.

"I had to manually define the database in mysql " <-- meaning you had to create one?
"I had to change the owner:group of app/storage from root:root to root:www-data" <-- you should never, ever run any web application as root. Ever.

I appreciate the feedback, for sure, but the last two are things that are not related to this specific application, they are related to running any web application, and I have specifically tried to keep the documentation simple, as I don't want to be in the business of supporting "setting up a web server in general".

@blakestock
Copy link
Author

My apologies @snipe, while reading the documentation again on the introduction, I interpreted what the app is built on as needing that to function. That's due to me not reading carefully and not really knowing how to setup or run a web server properly.

Yes, I had to create the database by running "mysqladmin create database " on my own.
In regards, to the owner and group, I understand your stance on not supporting someone else's server and just developing the app. Like I said in a previous post, I know enough to be dangerous and I guess that is obviously true :) This app is internal only, but I'll have someone else look through it to harden it anyway.

Thanks again for developing this, there's really nothing else close to what you've made.

@snipe
Copy link
Owner

snipe commented Oct 24, 2014

Nothing to apologize for, @blakestock, and thank you for the kind words. :)

I've updated the docs to clarify both points a little better. http://docs.snipeitapp.com/linuxosx/README.html

I don't want to be in the business of supporting web apps in general, but you're not the first person to have the root issue, so it seems it's probably worth clarifying.

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

3 participants