snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

Trying to get property of non-object Ldap Sync

Open rjdeclute opened this issue 8 years ago • 4 comments

Expected Behavior (or desired behavior if a feature request)

(what you expect to happen goes here)


Actual Behavior

(what actually happens goes here)


Please confirm you have done the following before posting your bug report:


Provide answers to these questions:

  • Is this a fresh install or an upgrade? Upgrade
  • Version of Snipe-IT you're running 4.1.11
  • Version of PHP you're running 7.1.7
  • Version of MySQL/MariaDB you're running sql
  • What OS and web server you're running Snipe-IT on IIS
  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) GIT
  • WITH DEBUG TURNED ON, if you're getting an error in your browser, include that error

(1/1) ErrorExceptionTrying to get property of non-object

in LdapSync.php (line 192) at HandleExceptions->handleError(8, 'Trying to get property of non-object', 'C:\inetpub\wwwroot\inventory\app\Console\Commands\LdapSync.php', 192,array('r', 'S'))in LdapSync.php (line 192) at LdapSync->handle() at call_user_func_array(array(object(LdapSync), 'handle'), array())in BoundMethod.php (line 29) at BoundMethod::Illuminate\Container{closure}()in BoundMethod.php (line 87) at BoundMethod::callBoundMethod(object(Application), array(object(LdapSync), 'handle'), object(Closure))in BoundMethod.php (line 31) at BoundMethod::call(object(Application), array(object(LdapSync), 'handle'), array(), null)in Container.php (line 539) at Container->call(array(object(LdapSync), 'handle'))in Command.php (line 182) at Command->execute(object(ArrayInput), object(OutputStyle))in Command.php (line 252) at Command->run(object(ArrayInput), object(OutputStyle))in Command.php (line 167) at Command->run(object(ArrayInput), object(BufferedOutput))in Application.php (line 936) at Application->doRunCommand(object(LdapSync), object(ArrayInput), object(BufferedOutput))in Application.php (line 240) at Application->doRun(object(ArrayInput), object(BufferedOutput))in Application.php (line 148) at Application->run(object(ArrayInput), object(BufferedOutput))in Application.php (line 141) at Application->call('snipeit:ldap-sync', object(Collection), null)in Kernel.php (line 220) at Kernel->call('snipeit:ldap-sync', array('--location_id' => '', '--json_summary' => true))in Facade.php (line 221) at Facade::__callStatic('call', array('snipeit:ldap-sync', array('--location_id' => '', '--json_summary' => true)))in UsersController.php (line 1039) at UsersController->postLDAP(object(Request)) at call_user_func_array(array(object(UsersController), 'postLDAP'), array(object(Request)))in Controller.php (line 55) at Controller->callAction('postLDAP', array(object(Request)))in ControllerDispatcher.php (line 44) at ControllerDispatcher->dispatch(object(Route), object(UsersController), 'postLDAP')in Route.php (line 203) at Route->runController()in Route.php (line 160) at Route->run()in Router.php (line 572) at Router->Illuminate\Routing{closure}(object(Request))in Pipeline.php (line 30) at Pipeline->Illuminate\Routing{closure}(object(Request))in Authenticate.php (line 43) at Authenticate->handle(object(Request), object(Closure))in Pipeline.php (line 148) at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing{closure}(object(Request))in CreateFreshApiToken.php (line 49) at CreateFreshApiToken->handle(object(Request), object(Closure))in Pipeline.php (line 148) at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing{closure}(object(Request))in CheckForTwoFactor.php (line 49) at CheckForTwoFactor->handle(object(Request), object(Closure))in Pipeline.php (line 148) at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing{closure}(object(Request))in CheckLocale.php (line 42) at CheckLocale->handle(object(Request), object(Closure))in Pipeline.php (line 148) at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing{closure}(object(Request))in VerifyCsrfToken.php (line 65) at VerifyCsrfToken->handle(object(Request), object(Closure))in Pipeline.php (line 148) at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing{closure}(object(Request))in AddQueuedCookiesToResponse.php (line 37) at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))in Pipeline.php (line 148) at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing{closure}(object(Request))in EncryptCookies.php (line 59) at EncryptCookies->handle(object(Request), object(Closure))in Pipeline.php (line 148) at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing{closure}(object(Request))in Pipeline.php (line 102) at Pipeline->then(object(Closure))in Router.php (line 574) at Router->runRouteWithinStack(object(Route), object(Request))in Router.php (line 533) at Router->dispatchToRoute(object(Request))in Router.php (line 511) at Router->dispatch(object(Request))in Kernel.php (line 176) at Kernel->Illuminate\Foundation\Http{closure}(object(Request))in Pipeline.php (line 30) at Pipeline->Illuminate\Routing{closure}(object(Request))in Debugbar.php (line 51) at Debugbar->handle(object(Request), object(Closure))in Pipeline.php (line 148) at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing{closure}(object(Request))in CheckForDebug.php (line 25) at CheckForDebug->handle(object(Request), object(Closure))in Pipeline.php (line 148) at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing{closure}(object(Request))in TrustProxies.php (line 56) at TrustProxies->handle(object(Request), object(Closure))in Pipeline.php (line 148) at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing{closure}(object(Request))in CheckForSetup.php (line 27) at CheckForSetup->handle(object(Request), object(Closure))in Pipeline.php (line 148) at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing{closure}(object(Request))in NosniffGuard.php (line 17) at NosniffGuard->handle(object(Request), object(Closure))in Pipeline.php (line 148) at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing{closure}(object(Request))in ContentSecurityPolicyHeader.php (line 18) at ContentSecurityPolicyHeader->handle(object(Request), object(Closure))in Pipeline.php (line 148) at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing{closure}(object(Request))in ReferrerPolicyHeader.php (line 17) at ReferrerPolicyHeader->handle(object(Request), object(Closure))in Pipeline.php (line 148) at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing{closure}(object(Request))in XssProtectHeader.php (line 18) at XssProtectHeader->handle(object(Request), object(Closure))in Pipeline.php (line 148) at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing{closure}(object(Request))in FrameGuard.php (line 17) at FrameGuard->handle(object(Request), object(Closure))in Pipeline.php (line 148) at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing{closure}(object(Request))in ShareErrorsFromSession.php (line 49) at ShareErrorsFromSession->handle(object(Request), object(Closure))in Pipeline.php (line 148) at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing{closure}(object(Request))in StartSession.php (line 64) at StartSession->handle(object(Request), object(Closure))in Pipeline.php (line 148) at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing{closure}(object(Request))in CheckForMaintenanceMode.php (line 46) at CheckForMaintenanceMode->handle(object(Request), object(Closure))in Pipeline.php (line 148) at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing{closure}(object(Request))in Pipeline.php (line 102) at Pipeline->then(object(Closure))in Kernel.php (line 151) at Kernel->sendRequestThroughRouter(object(Request))in Kernel.php (line 116) at Kernel->handle(object(Request))in index.php (line 58)

  • What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error LDAP Sync with no specific Location Selected
  • If a stacktrace is provided in the error, include that too.
  • Any errors that appear in your browser's error console.
  • Confirm whether the error is reproducible on the demo: https://snipeitapp.com/demo.
  • Include any additional information you can find in storage/logs and your webserver's logs.
  • Include what you've done so far in the installation, and if you got any error messages along the way.
  • Indicate whether or not you've manually edited any data directly in the database

Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.

https://snipe-it.readme.io/docs/getting-help

rjdeclute avatar Jan 26 '18 18:01 rjdeclute

I'm having the same issue. Hopefully they get this fixed soon.

rosasmr avatar Feb 13 '18 20:02 rosasmr

A little more detail would be really helpful here. What is the specific command you both are using? Are you syncing by location? If so, are you using a name or an ID?

snipe avatar Feb 13 '18 22:02 snipe

Try changing line 192 in app/Console/Commands/LdapSync.php from:

} else if ($location) {

to:

} elseif ((isset($location)) && (!empty($location))) {

... and re-run it, and tell me if that changes anything for you.

snipe avatar Feb 13 '18 22:02 snipe

Awesome! Changing the code in LdapSync.php as specified above worked perfectly :)

brosevelt avatar Feb 14 '18 16:02 brosevelt