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

Deleted Assets failing with "Server Error:500" #834

Closed
akosinski opened this issue Jun 4, 2015 · 6 comments
Closed

Deleted Assets failing with "Server Error:500" #834

akosinski opened this issue Jun 4, 2015 · 6 comments

Comments

@akosinski
Copy link

I have been using Snipe-IT for a couple of months now and its fantastic.

All parts work except today for the first time I tried to view the "Deleted" Assets and it comes back with the following:

Ouch.
Server Error: 500 (Internal Server Error)
What does this mean?
Something went wrong on our servers while we were processing your request. We're really sorry about this, and will work hard to get this resolved as soon as possible.
Perhaps you would like to go to our home page?

Its a windows install on Windows 2012 server.

I looked at the event logs and logs in inetpub but didn't see anything obvious..

Andy

@snipe
Copy link
Owner

snipe commented Jun 6, 2015

@akosinski Did you manually edit any data int he database? Also, can you please provide more info? http://snipeitapp.com/documentation/getting-help/

@akosinski
Copy link
Author

Hi,

We are running v1.2.5 on Windows 2012.

We did import a load of assets into the database via a HeidiSQL tool. It would not accept them as some NULL values could not be set correctly. We manually set the values in the database to allow them by right clicking on the fields and setting the

I clicked on the deleted assets and it created this in app/storage/logs...

[2015-06-09 13:29:01] production.ERROR: exception 'ErrorException' with message 'Trying to get property of non-object' in C:\inetpub\wwwroot\snipe-it\app\storage\views\20bad27bf8db88ff829c992ada40fec3:95
Stack trace:
#0 C:\inetpub\wwwroot\snipe-it\app\storage\views\20bad27bf8db88ff829c992ada40fec3(95): Illuminate\Exception\Handler->handleError(8, 'Trying to get p...', 'C:\inetpub\wwwr...', 95, Array)
#1 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(9830): include('C:\inetpub\wwwr...')
#2 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\View\Engines\CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('C:\inetpub\wwwr...', Array)
#3 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(9708): Illuminate\View\Engines\CompilerEngine->get('C:\inetpub\wwwr...', Array)
#4 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(9695): Illuminate\View\View->getContents()
#5 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(9686): Illuminate\View\View->renderContents()
#6 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(10388): Illuminate\View\View->render()
#7 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(9918): Illuminate\Http\Response->setContent(Object(Illuminate\View\View))
#8 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(5222): Symfony\Component\HttpFoundation\Response->__construct(Object(Illuminate\View\View))
#9 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(5030): Illuminate\Routing\Router->prepareResponse(Object(Illuminate\Http\Request), Object(Illuminate\View\View))
#10 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(5016): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#11 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(721): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#12 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(702): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#13 C:\inetpub\wwwroot\snipe-it\vendor\barryvdh\laravel-debugbar\src\Middleware\Stack.php(34): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true)
#14 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(7779): Barryvdh\Debugbar\Middleware\Stack->handle(Object(Illuminate\Http\Request), 1, true)
#15 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(8386): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
#16 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(8333): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
#17 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(10994): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
#18 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(664): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
#19 C:\inetpub\wwwroot\snipe-it\public\index.php(49): Illuminate\Foundation\Application->run()
#20 {main}

Next exception 'ErrorException' with message 'Trying to get property of non-object (View: C:\inetpub\wwwroot\snipe-it\app\views\backend\hardware\index.blade.php)' in C:\inetpub\wwwroot\snipe-it\app\storage\views\20bad27bf8db88ff829c992ada40fec3:95
Stack trace:
#0 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(9832): Illuminate\View\Engines\CompilerEngine->handleViewException(Object(ErrorException), 1)
#1 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\View\Engines\CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('C:\inetpub\wwwr...', Array)
#2 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(9708): Illuminate\View\Engines\CompilerEngine->get('C:\inetpub\wwwr...', Array)
#3 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(9695): Illuminate\View\View->getContents()
#4 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(9686): Illuminate\View\View->renderContents()
#5 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(10388): Illuminate\View\View->render()
#6 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(9918): Illuminate\Http\Response->setContent(Object(Illuminate\View\View))
#7 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(5222): Symfony\Component\HttpFoundation\Response->__construct(Object(Illuminate\View\View))
#8 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(5030): Illuminate\Routing\Router->prepareResponse(Object(Illuminate\Http\Request), Object(Illuminate\View\View))
#9 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(5016): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#10 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(721): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#11 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(702): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#12 C:\inetpub\wwwroot\snipe-it\vendor\barryvdh\laravel-debugbar\src\Middleware\Stack.php(34): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true)
#13 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(7779): Barryvdh\Debugbar\Middleware\Stack->handle(Object(Illuminate\Http\Request), 1, true)
#14 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(8386): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
#15 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(8333): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
#16 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(10994): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
#17 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(664): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
#18 C:\inetpub\wwwroot\snipe-it\public\index.php(49): Illuminate\Foundation\Application->run()
#19 {main} [] []

Thanks

Andy

@akosinski
Copy link
Author

Since you asked about the database being edited I have had a look at each table and the data and it appears that the "models" start from id7 which would indicate some where removed prior to its first use as everything else is in order.

Andy

@snipe
Copy link
Owner

snipe commented Jun 9, 2015

@akosinski You should try to never delete anything directly from the database, as you end up breaking the relationships, since you're then looking for asset model information on a model that no longer exists. (That's why we soft delete instead of hard deleting.)

Can you add 1-6 back in, or just create dummy entries for them and then move the assets assigned to them to non-deleted assets?

@akosinski
Copy link
Author

I took a backup and I added back in 6 random models (ID 1-6) and the deleted assets options is now working. Moral to the story is don't ever delete lines manually from the database in the interest of trying to be tidy... :)

Thanks for your help....

@snipe
Copy link
Owner

snipe commented Jun 10, 2015

Yes, that is an important moral to learn :) I'm glad you got it sorted out!

thumbs-up

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

No branches or pull requests

2 participants