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

Installation Issue on IIS - Exception Error 'Trying to get property of non-object' #631

Closed
tzielinskiaptn opened this issue Mar 10, 2015 · 21 comments

Comments

@tzielinskiaptn
Copy link

IIS 8.5 on Windows Server 2012 R2

Snipe-IT 1.2.6

Accessing the site triggers the following error:

[2015-03-10 13:37:06] production.ERROR: exception 'ErrorException' with message 'Trying to get property of non-object' in C:\inetpub\wwwroot\SnipeIT\app\storage\views\9f011697fa80bc551e752166741a6ea3:11
Stack trace:
#0 C:\inetpub\wwwroot\SnipeIT\app\storage\views\9f011697fa80bc551e752166741a6ea3(11): Illuminate\Exception\Handler->handleError(8, 'Trying to get p...', 'C:\inetpub\wwwr...', 11, Array)
#1 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\Engines\PhpEngine.php(37): include('C:\inetpub\wwwr...')
#2 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\Engines\CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('C:\inetpub\wwwr...', Array)
#3 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\View.php(134): Illuminate\View\Engines\CompilerEngine->get('C:\inetpub\wwwr...', Array)
#4 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\View.php(102): Illuminate\View\View->getContents()
#5 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\View.php(76): Illuminate\View\View->renderContents()
#6 C:\inetpub\wwwroot\SnipeIT\app\storage\views\692962850307934d31015df69a52404f(72): Illuminate\View\View->render()
#7 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\Engines\PhpEngine.php(37): include('C:\inetpub\wwwr...')
#8 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\Engines\CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('C:\inetpub\wwwr...', Array)
#9 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\View.php(134): Illuminate\View\Engines\CompilerEngine->get('C:\inetpub\wwwr...', Array)
#10 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\View.php(102): Illuminate\View\View->getContents()
#11 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\View.php(76): Illuminate\View\View->renderContents()
#12 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Http\Response.php(43): Illuminate\View\View->render()
#13 C:\inetpub\wwwroot\SnipeIT\vendor\symfony\http-foundation\Symfony\Component\HttpFoundation\Response.php(202): Illuminate\Http\Response->setContent(Object(Illuminate\View\View))
#14 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Routing\Router.php(1498): Symfony\Component\HttpFoundation\Response->__construct(Object(Illuminate\View\View))
#15 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Routing\Router.php(1031): Illuminate\Routing\Router->prepareResponse(Object(Illuminate\Http\Request), Object(Illuminate\View\View))
#16 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Routing\Router.php(996): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#17 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(777): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#18 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(747): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#19 C:\inetpub\wwwroot\SnipeIT\vendor\barryvdh\laravel-debugbar\src\Middleware\Stack.php(34): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true)
#20 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Session\Middleware.php(72): Barryvdh\Debugbar\Middleware\Stack->handle(Object(Illuminate\Http\Request), 1, true)
#21 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Cookie\Queue.php(47): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
#22 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Cookie\Guard.php(51): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
#23 C:\inetpub\wwwroot\SnipeIT\vendor\stack\builder\src\Stack\StackedHttpKernel.php(23): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
#24 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(643): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
#25 C:\inetpub\wwwroot\SnipeIT\public\index.php(49): Illuminate\Foundation\Application->run()
#26 {main}

Next exception 'ErrorException' with message 'Trying to get property of non-object (View: C:\inetpub\wwwroot\SnipeIT\app\views\backend\layouts\default.blade.php)' in C:\inetpub\wwwroot\SnipeIT\app\storage\views\9f011697fa80bc551e752166741a6ea3:11
Stack trace:
#0 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\Engines\PhpEngine.php(41): Illuminate\View\Engines\CompilerEngine->handleViewException(Object(ErrorException), 1)
#1 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\Engines\CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('C:\inetpub\wwwr...', Array)
#2 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\View.php(134): Illuminate\View\Engines\CompilerEngine->get('C:\inetpub\wwwr...', Array)
#3 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\View.php(102): Illuminate\View\View->getContents()
#4 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\View.php(76): Illuminate\View\View->renderContents()
#5 C:\inetpub\wwwroot\SnipeIT\app\storage\views\692962850307934d31015df69a52404f(72): Illuminate\View\View->render()
#6 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\Engines\PhpEngine.php(37): include('C:\inetpub\wwwr...')
#7 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\Engines\CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('C:\inetpub\wwwr...', Array)
#8 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\View.php(134): Illuminate\View\Engines\CompilerEngine->get('C:\inetpub\wwwr...', Array)
#9 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\View.php(102): Illuminate\View\View->getContents()
#10 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\View.php(76): Illuminate\View\View->renderContents()
#11 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Http\Response.php(43): Illuminate\View\View->render()
#12 C:\inetpub\wwwroot\SnipeIT\vendor\symfony\http-foundation\Symfony\Component\HttpFoundation\Response.php(202): Illuminate\Http\Response->setContent(Object(Illuminate\View\View))
#13 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Routing\Router.php(1498): Symfony\Component\HttpFoundation\Response->__construct(Object(Illuminate\View\View))
#14 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Routing\Router.php(1031): Illuminate\Routing\Router->prepareResponse(Object(Illuminate\Http\Request), Object(Illuminate\View\View))
#15 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Routing\Router.php(996): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#16 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(777): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#17 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(747): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#18 C:\inetpub\wwwroot\SnipeIT\vendor\barryvdh\laravel-debugbar\src\Middleware\Stack.php(34): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true)
#19 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Session\Middleware.php(72): Barryvdh\Debugbar\Middleware\Stack->handle(Object(Illuminate\Http\Request), 1, true)
#20 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Cookie\Queue.php(47): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
#21 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Cookie\Guard.php(51): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
#22 C:\inetpub\wwwroot\SnipeIT\vendor\stack\builder\src\Stack\StackedHttpKernel.php(23): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
#23 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(643): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
#24 C:\inetpub\wwwroot\SnipeIT\public\index.php(49): Illuminate\Foundation\Application->run()
#25 {main}

Next exception 'ErrorException' with message 'Trying to get property of non-object (View: C:\inetpub\wwwroot\SnipeIT\app\views\backend\layouts\default.blade.php) (View: C:\inetpub\wwwroot\SnipeIT\app\views\backend\layouts\default.blade.php)' in C:\inetpub\wwwroot\SnipeIT\app\storage\views\9f011697fa80bc551e752166741a6ea3:11
Stack trace:
#0 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\Engines\PhpEngine.php(41): Illuminate\View\Engines\CompilerEngine->handleViewException(Object(ErrorException), 1)
#1 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\Engines\CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('C:\inetpub\wwwr...', Array)
#2 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\View.php(134): Illuminate\View\Engines\CompilerEngine->get('C:\inetpub\wwwr...', Array)
#3 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\View.php(102): Illuminate\View\View->getContents()
#4 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\View\View.php(76): Illuminate\View\View->renderContents()
#5 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Http\Response.php(43): Illuminate\View\View->render()
#6 C:\inetpub\wwwroot\SnipeIT\vendor\symfony\http-foundation\Symfony\Component\HttpFoundation\Response.php(202): Illuminate\Http\Response->setContent(Object(Illuminate\View\View))
#7 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Routing\Router.php(1498): Symfony\Component\HttpFoundation\Response->__construct(Object(Illuminate\View\View))
#8 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Routing\Router.php(1031): Illuminate\Routing\Router->prepareResponse(Object(Illuminate\Http\Request), Object(Illuminate\View\View))
#9 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Routing\Router.php(996): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#10 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(777): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#11 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(747): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#12 C:\inetpub\wwwroot\SnipeIT\vendor\barryvdh\laravel-debugbar\src\Middleware\Stack.php(34): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true)
#13 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Session\Middleware.php(72): Barryvdh\Debugbar\Middleware\Stack->handle(Object(Illuminate\Http\Request), 1, true)
#14 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Cookie\Queue.php(47): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
#15 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Cookie\Guard.php(51): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
#16 C:\inetpub\wwwroot\SnipeIT\vendor\stack\builder\src\Stack\StackedHttpKernel.php(23): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
#17 C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(643): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
#18 C:\inetpub\wwwroot\SnipeIT\public\index.php(49): Illuminate\Foundation\Application->run()
#19 {main} [] []

@madd15
Copy link
Contributor

madd15 commented Mar 10, 2015

Can you please confirm that there is content in the settings table of your DB

@tzielinskiaptn
Copy link
Author

It looks like there is content. There are 19 columns in the settings table, and most appear to contain entries. The table itself is showing as 16KiB in size.

@snipe
Copy link
Owner

snipe commented Mar 12, 2015

Can you show me the first 20 lines of C:\inetpub\wwwroot\SnipeIT\app\storage\views\9f011697fa80bc551e752166741a6ea3?

@tzielinskiaptn
Copy link
Author

Absolutely:

    <!-- Basic Page Needs
    ================================================== -->
    <meta charset="utf-8" />
    <title>
        <?php $__env->startSection('title'); ?>
         <?php echo e(Setting::getSettings()->site_name); ?>

        <?php echo $__env->yieldSection(); ?>
    </title>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


     <!-- bootstrap -->

@snipe
Copy link
Owner

snipe commented Mar 12, 2015

Which one is line 11 for you?

@tzielinskiaptn
Copy link
Author

In Notepad++ Line 11 of that file is:

site_name); ?>

@snipe
Copy link
Owner

snipe commented Mar 12, 2015

Is there a value in the database in the settings table for site_name?

@tzielinskiaptn
Copy link
Author

The default field for site_name contains Snipe IT Asset Management there is nothing in the expression field.

DBs are not my strong suit, so please bear with me.

@snipe
Copy link
Owner

snipe commented Mar 12, 2015

It actually seems more Setting::getSettings() isn't returning a settings object, which is more confusing. It's not complaining that site_name isn't set, it's complaining that site_name is a property of a non-object. So, hmm... I've not seen this particular error before. Was there anything unusual that happened during your install?

@tzielinskiaptn
Copy link
Author

I remember there being an error returned during the 'php artisan app:install' process, but I forgot to screen capture it. Would there be an install log I could pull that would have that info?

@snipe
Copy link
Owner

snipe commented Mar 12, 2015

Yeah, look in app/storage/logs. Or drop the database tables and re-run the install. It doesn't sound like you have any production data in it right now.

@tzielinskiaptn
Copy link
Author

Ok, the error I encountered was:

[]
[2015-03-09 19:19:04] production.ERROR: exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1364 Field 'default_eula_text' doesn't have a default value' in C:\inetpub\wwwroot\SnipeIT\vendor\laravel\framework\src\Illuminate\Database\Connection.php:369

There is a stack trace, if you would like it I will post it.

I apologise, I haven't worked with HeidiSQL before. My SQL experience has been limited to creating ODBC links for our accounting machines. I'm more of a desktop/network end user support guy in a Windows/MS world.

Is there a document with the proper procedure for creating an appropriate DB instance and user account for SnipeIT to use?

@snipe
Copy link
Owner

snipe commented Mar 12, 2015

Can you grab the latest off of develop? That bug was fixed, but hasn't made it to a release yet.

@snipe
Copy link
Owner

snipe commented Mar 12, 2015

(Grab the latest off of develop, keep your config files as they are, drop your tables again and re-install via artisan)

@tzielinskiaptn
Copy link
Author

I can definitely do so.

I hate to ask, but how do I drop the tables?

@snipe
Copy link
Owner

snipe commented Mar 12, 2015

Do you have an interface to your database? You should be able to drop it from whatever UI you use there, or run

DROP TABLE `accessories`, `accessories_users`, `assets`, `asset_logs`, `asset_uploads`, `categories`, `depreciations`, `groups`, `history`, `licenses`, `license_seats`, `locations`, `manufacturers`, `migrations`, `models`, `requested_assets`, `requests`, `settings`, `status_labels`, `suppliers`, `throttle`, `users`, `users_groups`;

@tzielinskiaptn
Copy link
Author

Thank you, I found the command in my UI as well.

I will pull the develop, drop the tables, and re-run the install and will post back when that has been done.

Thank you so much for your help.

@snipe
Copy link
Owner

snipe commented Mar 12, 2015

No problem. I also just packaged up those fixes into a point release if that's easier. https://github.com/snipe/snipe-it/releases/tag/v1.2.6.1

@tzielinskiaptn
Copy link
Author

That's great, thank you.

@tzielinskiaptn
Copy link
Author

The point release solved the issue.

I dropped the tables, extracted the new files and ran the install again.

The tables were recreated and populated with production data.

I was able to access my site and log in.

Now I can start setting up and using the application.

Thank you so much.

@snipe
Copy link
Owner

snipe commented Mar 12, 2015

Awesome, sorry for the trouble. In the short time after we released 1.2.6, we discovered the migration bug, and then two different vendors updated their packages in a way that screwed things up (the REPL guy moved his repo, and Sentry changed a method in their package that broke things on our end with the older version). Upgrades and installs aren't usually this messy.

wrong-problem

Still, glad you got everything sorted out now.

@snipe snipe closed this as completed Mar 12, 2015
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