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

Ldap import, some users are not loaded #1487

Closed
marcobarbaro opened this issue Oct 21, 2019 · 9 comments
Closed

Ldap import, some users are not loaded #1487

marcobarbaro opened this issue Oct 21, 2019 · 9 comments

Comments

@marcobarbaro
Copy link

sysPass Version
3.1 (310.19081801)
Config: 310.19081801
App: 310.19081801
DB: 310.19081801

Describe the bug
I'm trying to import a lot of ldap users (13 users belonging to a group) from our active directory, pointing to LDAP option, but at the end only 9 are loaded. I've already checked if "display name" is empty and cannot find any evidence that makes the 4 missing users different from the 9 loaded.

Event log
[2019-10-21 14:27:24] syspass.EXCEPTION: logger {"message":"Directory does not exist
#0 /var/www/html/sysPass/lib/SP/Services/Account/AccountAclService.php(83): SP\Util\FileUtil->rmdir_recursive(String)
#1 /var/www/html/sysPass/lib/SP/Providers/Acl/AclHandler.php(156): SP\Services\Account\AccountAclService->clearAcl(Integer)
#2 /var/www/html/sysPass/lib/SP/Providers/Acl/AclHandler.php(117): SP\Providers\Acl\AclHandler->processUser(Object(SP\Core\Events\Event))
#3 /var/www/html/sysPass/lib/SP/Core/Events/EventDispatcherBase.php(121): SP\Providers\Acl\AclHandler->updateEvent(String,Object(SP\Core\Events\Event))
#4 /var/www/html/sysPass/app/modules/web/Controllers/UserController.php(293): SP\Core\Events\EventDispatcherBase->notifyEvent(String,Object(SP\Core\Events\Event))
#5 [internal function]: SP\Modules\Web\Controllers\UserController->deleteAction()
#6 /var/www/html/sysPass/lib/SP/Bootstrap.php(240): call_user_func_array(Array,Array)
#7 [internal function]: SP\Bootstrap->SP{closure}(Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#8 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(886): call_user_func(Object(Closure),Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#9 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route),Object(Klein\DataCollection\RouteCollection),Array)
#10 /var/www/html/sysPass/lib/SP/Bootstrap.php(464): Klein\Klein->dispatch(Object(Klein\Request))
#11 /var/www/html/sysPass/lib/Base.php(75): SP\Bootstrap->run(Object(DI\Container))
#12 /var/www/html/sysPass/index.php(28): require(String)","caller":"N/A"}
[2019-10-21 14:27:24] syspass.EXCEPTION: logger {"message":"Directory does not exist
#0 /var/www/html/sysPass/lib/SP/Services/Account/AccountAclService.php(83): SP\Util\FileUtil->rmdir_recursive(String)
#1 /var/www/html/sysPass/lib/SP/Providers/Acl/AclHandler.php(156): SP\Services\Account\AccountAclService->clearAcl(Integer)
#2 /var/www/html/sysPass/lib/SP/Providers/Acl/AclHandler.php(117): SP\Providers\Acl\AclHandler->processUser(Object(SP\Core\Events\Event))
#3 /var/www/html/sysPass/lib/SP/Core/Events/EventDispatcherBase.php(121): SP\Providers\Acl\AclHandler->updateEvent(String,Object(SP\Core\Events\Event))
#4 /var/www/html/sysPass/app/modules/web/Controllers/UserController.php(293): SP\Core\Events\EventDispatcherBase->notifyEvent(String,Object(SP\Core\Events\Event))
#5 [internal function]: SP\Modules\Web\Controllers\UserController->deleteAction()
#6 /var/www/html/sysPass/lib/SP/Bootstrap.php(240): call_user_func_array(Array,Array)
#7 [internal function]: SP\Bootstrap->SP{closure}(Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#8 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(886): call_user_func(Object(Closure),Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#9 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route),Object(Klein\DataCollection\RouteCollection),Array)
#10 /var/www/html/sysPass/lib/SP/Bootstrap.php(464): Klein\Klein->dispatch(Object(Klein\Request))
#11 /var/www/html/sysPass/lib/Base.php(75): SP\Bootstrap->run(Object(DI\Container))
#12 /var/www/html/sysPass/index.php(28): require(String)","caller":"N/A"}
[2019-10-21 14:27:24] syspass.EXCEPTION: logger {"message":"Directory does not exist
#0 /var/www/html/sysPass/lib/SP/Services/Account/AccountAclService.php(83): SP\Util\FileUtil->rmdir_recursive(String)
#1 /var/www/html/sysPass/lib/SP/Providers/Acl/AclHandler.php(156): SP\Services\Account\AccountAclService->clearAcl(Integer)
#2 /var/www/html/sysPass/lib/SP/Providers/Acl/AclHandler.php(117): SP\Providers\Acl\AclHandler->processUser(Object(SP\Core\Events\Event))
#3 /var/www/html/sysPass/lib/SP/Core/Events/EventDispatcherBase.php(121): SP\Providers\Acl\AclHandler->updateEvent(String,Object(SP\Core\Events\Event))
#4 /var/www/html/sysPass/app/modules/web/Controllers/UserController.php(293): SP\Core\Events\EventDispatcherBase->notifyEvent(String,Object(SP\Core\Events\Event))
#5 [internal function]: SP\Modules\Web\Controllers\UserController->deleteAction()
#6 /var/www/html/sysPass/lib/SP/Bootstrap.php(240): call_user_func_array(Array,Array)
#7 [internal function]: SP\Bootstrap->SP{closure}(Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#8 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(886): call_user_func(Object(Closure),Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#9 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route),Object(Klein\DataCollection\RouteCollection),Array)
#10 /var/www/html/sysPass/lib/SP/Bootstrap.php(464): Klein\Klein->dispatch(Object(Klein\Request))
#11 /var/www/html/sysPass/lib/Base.php(75): SP\Bootstrap->run(Object(DI\Container))
#12 /var/www/html/sysPass/index.php(28): require(String)","caller":"N/A"}
[2019-10-21 14:27:24] syspass.EXCEPTION: logger {"message":"Directory does not exist
#0 /var/www/html/sysPass/lib/SP/Services/Account/AccountAclService.php(83): SP\Util\FileUtil->rmdir_recursive(String)
#1 /var/www/html/sysPass/lib/SP/Providers/Acl/AclHandler.php(156): SP\Services\Account\AccountAclService->clearAcl(Integer)
#2 /var/www/html/sysPass/lib/SP/Providers/Acl/AclHandler.php(117): SP\Providers\Acl\AclHandler->processUser(Object(SP\Core\Events\Event))
#3 /var/www/html/sysPass/lib/SP/Core/Events/EventDispatcherBase.php(121): SP\Providers\Acl\AclHandler->updateEvent(String,Object(SP\Core\Events\Event))
#4 /var/www/html/sysPass/app/modules/web/Controllers/UserController.php(293): SP\Core\Events\EventDispatcherBase->notifyEvent(String,Object(SP\Core\Events\Event))
#5 [internal function]: SP\Modules\Web\Controllers\UserController->deleteAction()
#6 /var/www/html/sysPass/lib/SP/Bootstrap.php(240): call_user_func_array(Array,Array)
#7 [internal function]: SP\Bootstrap->SP{closure}(Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#8 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(886): call_user_func(Object(Closure),Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#9 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route),Object(Klein\DataCollection\RouteCollection),Array)
#10 /var/www/html/sysPass/lib/SP/Bootstrap.php(464): Klein\Klein->dispatch(Object(Klein\Request))
#11 /var/www/html/sysPass/lib/Base.php(75): SP\Bootstrap->run(Object(DI\Container))
#12 /var/www/html/sysPass/index.php(28): require(String)","caller":"N/A"}
[2019-10-21 14:27:24] syspass.EXCEPTION: logger {"message":"Directory does not exist
#0 /var/www/html/sysPass/lib/SP/Services/Account/AccountAclService.php(83): SP\Util\FileUtil->rmdir_recursive(String)
#1 /var/www/html/sysPass/lib/SP/Providers/Acl/AclHandler.php(156): SP\Services\Account\AccountAclService->clearAcl(Integer)
#2 /var/www/html/sysPass/lib/SP/Providers/Acl/AclHandler.php(117): SP\Providers\Acl\AclHandler->processUser(Object(SP\Core\Events\Event))
#3 /var/www/html/sysPass/lib/SP/Core/Events/EventDispatcherBase.php(121): SP\Providers\Acl\AclHandler->updateEvent(String,Object(SP\Core\Events\Event))
#4 /var/www/html/sysPass/app/modules/web/Controllers/UserController.php(293): SP\Core\Events\EventDispatcherBase->notifyEvent(String,Object(SP\Core\Events\Event))
#5 [internal function]: SP\Modules\Web\Controllers\UserController->deleteAction()
#6 /var/www/html/sysPass/lib/SP/Bootstrap.php(240): call_user_func_array(Array,Array)
#7 [internal function]: SP\Bootstrap->SP{closure}(Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#8 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(886): call_user_func(Object(Closure),Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#9 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route),Object(Klein\DataCollection\RouteCollection),Array)
#10 /var/www/html/sysPass/lib/SP/Bootstrap.php(464): Klein\Klein->dispatch(Object(Klein\Request))
#11 /var/www/html/sysPass/lib/Base.php(75): SP\Bootstrap->run(Object(DI\Container))
#12 /var/www/html/sysPass/index.php(28): require(String)","caller":"N/A"}
[2019-10-21 14:27:24] syspass.EXCEPTION: logger {"message":"Directory does not exist
#0 /var/www/html/sysPass/lib/SP/Services/Account/AccountAclService.php(83): SP\Util\FileUtil->rmdir_recursive(String)
#1 /var/www/html/sysPass/lib/SP/Providers/Acl/AclHandler.php(156): SP\Services\Account\AccountAclService->clearAcl(Integer)
#2 /var/www/html/sysPass/lib/SP/Providers/Acl/AclHandler.php(117): SP\Providers\Acl\AclHandler->processUser(Object(SP\Core\Events\Event))
#3 /var/www/html/sysPass/lib/SP/Core/Events/EventDispatcherBase.php(121): SP\Providers\Acl\AclHandler->updateEvent(String,Object(SP\Core\Events\Event))
#4 /var/www/html/sysPass/app/modules/web/Controllers/UserController.php(293): SP\Core\Events\EventDispatcherBase->notifyEvent(String,Object(SP\Core\Events\Event))
#5 [internal function]: SP\Modules\Web\Controllers\UserController->deleteAction()
#6 /var/www/html/sysPass/lib/SP/Bootstrap.php(240): call_user_func_array(Array,Array)
#7 [internal function]: SP\Bootstrap->SP{closure}(Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#8 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(886): call_user_func(Object(Closure),Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#9 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route),Object(Klein\DataCollection\RouteCollection),Array)
#10 /var/www/html/sysPass/lib/SP/Bootstrap.php(464): Klein\Klein->dispatch(Object(Klein\Request))
#11 /var/www/html/sysPass/lib/Base.php(75): SP\Bootstrap->run(Object(DI\Container))
#12 /var/www/html/sysPass/index.php(28): require(String)","caller":"N/A"}
[2019-10-21 14:27:24] syspass.EXCEPTION: logger {"message":"Directory does not exist
#0 /var/www/html/sysPass/lib/SP/Services/Account/AccountAclService.php(83): SP\Util\FileUtil->rmdir_recursive(String)
#1 /var/www/html/sysPass/lib/SP/Providers/Acl/AclHandler.php(156): SP\Services\Account\AccountAclService->clearAcl(Integer)
#2 /var/www/html/sysPass/lib/SP/Providers/Acl/AclHandler.php(117): SP\Providers\Acl\AclHandler->processUser(Object(SP\Core\Events\Event))
#3 /var/www/html/sysPass/lib/SP/Core/Events/EventDispatcherBase.php(121): SP\Providers\Acl\AclHandler->updateEvent(String,Object(SP\Core\Events\Event))
#4 /var/www/html/sysPass/app/modules/web/Controllers/UserController.php(293): SP\Core\Events\EventDispatcherBase->notifyEvent(String,Object(SP\Core\Events\Event))
#5 [internal function]: SP\Modules\Web\Controllers\UserController->deleteAction()
#6 /var/www/html/sysPass/lib/SP/Bootstrap.php(240): call_user_func_array(Array,Array)
#7 [internal function]: SP\Bootstrap->SP{closure}(Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#8 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(886): call_user_func(Object(Closure),Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#9 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route),Object(Klein\DataCollection\RouteCollection),Array)
#10 /var/www/html/sysPass/lib/SP/Bootstrap.php(464): Klein\Klein->dispatch(Object(Klein\Request))
#11 /var/www/html/sysPass/lib/Base.php(75): SP\Bootstrap->run(Object(DI\Container))
#12 /var/www/html/sysPass/index.php(28): require(String)","caller":"N/A"}
[2019-10-21 14:27:24] syspass.INFO: logger {"message":"Extensions checked","caller":"SP\Core\PhpExtensionChecker::checkMandatory"}
[2019-10-21 14:27:24] syspass.INFO: logger {"message":"Loaded icons cache","caller":"SP\Core\UI\Theme::initIcons"}
[2019-10-21 14:27:24] syspass.INFO: logger {"message":"Loaded actions cache","caller":"SP\Core\Acl\Actions::loadCache"}
[2019-10-21 14:27:33] syspass.INFO: logger {"message":"Extensions checked","caller":"SP\Core\PhpExtensionChecker::checkMandatory"}
[2019-10-21 14:27:33] syspass.INFO: logger {"message":"Loaded icons cache","caller":"SP\Core\UI\Theme::initIcons"}
[2019-10-21 14:27:33] syspass.INFO: logger {"message":"Loaded actions cache","caller":"SP\Core\Acl\Actions::loadCache"}
[2019-10-21 14:27:33] syspass.INFO: logger {"message":"Loaded MIME types cache","caller":"SP\Core\MimeTypes::loadCache"}
[2019-10-21 14:27:42] syspass.INFO: logger {"message":"Extensions checked","caller":"SP\Core\PhpExtensionChecker::checkMandatory"}
[2019-10-21 14:27:42] syspass.INFO: logger {"message":"Loaded icons cache","caller":"SP\Core\UI\Theme::initIcons"}
[2019-10-21 14:27:42] syspass.INFO: logger {"message":"Loaded actions cache","caller":"SP\Core\Acl\Actions::loadCache"}
[2019-10-21 14:27:42] syspass.EXCEPTION: logger {"message":"Errore durante la connessione (BIND)
#0 /var/www/html/sysPass/lib/SP/Providers/Auth/Ldap/LdapConnection.php(114): SP\Providers\Auth\Ldap\LdapConnection->bind()
#1 /var/www/html/sysPass/lib/SP/Providers/Auth/Ldap/LdapConnection.php(95): SP\Providers\Auth\Ldap\LdapConnection->connectAndBind()
#2 /var/www/html/sysPass/lib/SP/Providers/Auth/Ldap/Ldap.php(96): SP\Providers\Auth\Ldap\LdapConnection->checkConnection()
#3 /var/www/html/sysPass/lib/SP/Services/Ldap/LdapImportService.php(164): SP\Providers\Auth\Ldap\Ldap->factory(Object(SP\Providers\Auth\Ldap\LdapParams),Object(SP\Core\Events\EventDispatcher),Boolean)
#4 /var/www/html/sysPass/lib/SP/Services/Ldap/LdapImportService.php(175): SP\Services\Ldap\LdapImportService->getLdap(Object(SP\Providers\Auth\Ldap\LdapParams))
#5 /var/www/html/sysPass/app/modules/web/Controllers/ConfigLdapController.php(268): SP\Services\Ldap\LdapImportService->importUsers(Object(SP\Providers\Auth\Ldap\LdapParams),Object(SP\Services\Ldap\LdapImportParams))
#6 [internal function]: SP\Modules\Web\Controllers\ConfigLdapController->importAction()
#7 /var/www/html/sysPass/lib/SP/Bootstrap.php(240): call_user_func_array(Array,Array)
#8 [internal function]: SP\Bootstrap->SP{closure}(Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#9 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(886): call_user_func(Object(Closure),Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#10 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route),Object(Klein\DataCollection\RouteCollection),Array)
#11 /var/www/html/sysPass/lib/SP/Bootstrap.php(464): Klein\Klein->dispatch(Object(Klein\Request))
#12 /var/www/html/sysPass/lib/Base.php(75): SP\Bootstrap->run(Object(DI\Container))
#13 /var/www/html/sysPass/index.php(28): require(String)","caller":"N/A"}
[2019-10-21 14:27:53] syspass.INFO: logger {"message":"Extensions checked","caller":"SP\Core\PhpExtensionChecker::checkMandatory"}
[2019-10-21 14:27:53] syspass.INFO: logger {"message":"Loaded icons cache","caller":"SP\Core\UI\Theme::initIcons"}
[2019-10-21 14:27:53] syspass.INFO: logger {"message":"Loaded actions cache","caller":"SP\Core\Acl\Actions::loadCache"}
[2019-10-21 14:27:54] syspass.EXCEPTION: logger {"message":"Login/email utente duplicati
#0 /var/www/html/sysPass/lib/SP/Services/User/UserService.php(260): SP\Repositories\User\UserRepository->create(Object(SP\DataModel\UserData))
#1 /var/www/html/sysPass/lib/SP/Services/Ldap/LdapImportService.php(227): SP\Services\User\UserService->create(Object(SP\DataModel\UserData))
#2 /var/www/html/sysPass/app/modules/web/Controllers/ConfigLdapController.php(268): SP\Services\Ldap\LdapImportService->importUsers(Object(SP\Providers\Auth\Ldap\LdapParams),Object(SP\Services\Ldap\LdapImportParams))
#3 [internal function]: SP\Modules\Web\Controllers\ConfigLdapController->importAction()
#4 /var/www/html/sysPass/lib/SP/Bootstrap.php(240): call_user_func_array(Array,Array)
#5 [internal function]: SP\Bootstrap->SP{closure}(Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#6 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(886): call_user_func(Object(Closure),Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#7 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route),Object(Klein\DataCollection\RouteCollection),Array)
#8 /var/www/html/sysPass/lib/SP/Bootstrap.php(464): Klein\Klein->dispatch(Object(Klein\Request))
#9 /var/www/html/sysPass/lib/Base.php(75): SP\Bootstrap->run(Object(DI\Container))
#10 /var/www/html/sysPass/index.php(28): require(String)","caller":"N/A"}
[2019-10-21 14:28:11] syspass.INFO: logger {"message":"Extensions checked","caller":"SP\Core\PhpExtensionChecker::checkMandatory"}
[2019-10-21 14:28:11] syspass.INFO: logger {"message":"Loaded icons cache","caller":"SP\Core\UI\Theme::initIcons"}
[2019-10-21 14:28:11] syspass.INFO: logger {"message":"Loaded actions cache","caller":"SP\Core\Acl\Actions::loadCache"}

Platform (please complete the following information):

  • OS: Centos
  • OS: 7.5.1804
  • Browser: Chrome
@nuxsmin
Copy link
Owner

nuxsmin commented Oct 24, 2019

Hello, it seems to be caused by " Login/email utente duplicati". The import process will try to import users which have set name and email, and if any is duplicated it will fail to import.

Regards

@shindelhu
Copy link

Hi, same issue here, except I have 378 users and 229 imported. Getting internal server error.
As far as I can see, the related log is:

#7 /opt/rh/httpd24/root/var/www/html/syspass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route),Object(Klein\DataCollection\RouteCollection),Array)
#8 /opt/rh/httpd24/root/var/www/html/syspass/lib/SP/Bootstrap.php(464): Klein\Klein->dispatch(Object(Klein\Request))
#9 /opt/rh/httpd24/root/var/www/html/syspass/lib/Base.php(75): SP\Bootstrap->run(Object(DI\Container))
#10 /opt/rh/httpd24/root/var/www/html/syspass/index.php(28): require(String)","caller":"N/A"}

OS: RH7
Openldap

Thanks in advance

@pbiggin23
Copy link

Hi, can I start off by saying how nice it is to use SysPass!

Just wanted to report same/similar issue here. Getting similar internal servers.

[2019-12-17 11:03:08] syspass.ERROR: logger {"message":"Could not set locale","caller":"SP\Core\Language::setLocales"} [2019-12-17 11:03:08] syspass.INFO: logger {"message":"Extensions checked","caller":"SP\Core\PhpExtensionChecker::checkMandatory"} [2019-12-17 11:03:08] syspass.ERROR: logger {"message":"Could not set locale","caller":"SP\Core\Language::setLocales"} [2019-12-17 11:03:08] syspass.INFO: logger {"message":"Loaded icons cache","caller":"SP\Core\UI\Theme::initIcons"} [2019-12-17 11:03:08] syspass.INFO: logger {"message":"Loaded actions cache","caller":"SP\Core\Acl\Actions::loadCache"} [2019-12-17 11:03:09] syspass.EXCEPTION: logger {"message":"Duplicated user login/email #0 /var/www/html/syspass/lib/SP/Services/User/UserService.php(260): SP\Repositories\User\UserRepository->create(Object(SP\DataModel\UserData)) #1 /var/www/html/syspass/lib/SP/Services/Ldap/LdapImportService.php(227): SP\Services\User\UserService->create(Object(SP\DataModel\UserData)) #2 /var/www/html/syspass/app/modules/web/Controllers/ConfigLdapController.php(268): SP\Services\Ldap\LdapImportService->importUsers(Object(SP\Providers\Auth\Ldap\LdapParams),Object(SP\Services\Ldap\LdapImportParams)) #3 [internal function]: SP\Modules\Web\Controllers\ConfigLdapController->importAction() #4 /var/www/html/syspass/lib/SP/Bootstrap.php(240): call_user_func_array(Array,Array) #5 [internal function]: SP\Bootstrap->SP\{closure}(Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array) #6 /var/www/html/syspass/vendor/klein/klein/src/Klein/Klein.php(886): call_user_func(Object(Closure),Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array) #7 /var/www/html/syspass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route),Object(Klein\DataCollection\RouteCollection),Array) #8 /var/www/html/syspass/lib/SP/Bootstrap.php(464): Klein\Klein->dispatch(Object(Klein\Request)) #9 /var/www/html/syspass/lib/Base.php(75): SP\Bootstrap->run(Object(DI\Container)) #10 /var/www/html/syspass/index.php(28): require(String)","caller":"N/A"} [2019-12-17 11:03:09] syspass.EXCEPTION: logger {"message":"Duplicated user login/email #0 /var/www/html/syspass/lib/SP/Services/User/UserService.php(260): SP\Repositories\User\UserRepository->create(Object(SP\DataModel\UserData)) #1 /var/www/html/syspass/lib/SP/Services/Ldap/LdapImportService.php(227): SP\Services\User\UserService->create(Object(SP\DataModel\UserData)) #2 /var/www/html/syspass/app/modules/web/Controllers/ConfigLdapController.php(268): SP\Services\Ldap\LdapImportService->importUsers(Object(SP\Providers\Auth\Ldap\LdapParams),Object(SP\Services\Ldap\LdapImportParams)) #3 [internal function]: SP\Modules\Web\Controllers\ConfigLdapController->importAction() #4 /var/www/html/syspass/lib/SP/Bootstrap.php(240): call_user_func_array(Array,Array) #5 [internal function]: SP\Bootstrap->SP\{closure}(Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array) #6 /var/www/html/syspass/vendor/klein/klein/src/Klein/Klein.php(886): call_user_func(Object(Closure),Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array) #7 /var/www/html/syspass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route),Object(Klein\DataCollection\RouteCollection),Array) #8 /var/www/html/syspass/lib/SP/Bootstrap.php(464): Klein\Klein->dispatch(Object(Klein\Request)) #9 /var/www/html/syspass/lib/Base.php(75): SP\Bootstrap->run(Object(DI\Container)) #10 /var/www/html/syspass/index.php(28): require(String)","caller":"N/A"}

OS: Debian
Active Directory

From the testing I can see the issue is down to users with the same last names.
[2019-12-17 11:03:09] syspass.EXCEPTION: logger {"message":"Duplicated user login/email

The login attribute set is to sAMAccountName. (I have also changed this to userPrincaplName which does the same, uid and login does not import anybody)

Which for our logins we user their last name as part of the login but we make sure it is unique.
e.g. John Smith's samaccoutname would be smith1234
Paul Smith's samaccount name would be smith1567

I have searched and made sure that they aren't using the same email address email field attribute in AD anywhere else or it has been misspelled anywhere else. The email is made up by [email protected]

So the two areas that I thought it would be using on the import I have definitely made sure that is unique.

From what I have seen in other places everyone is having a similar issue.

I have also set a security group in AD to only allow certain users to login and not search across the whole base dn. This still brings up the error like the log above.

I can confirm that the ldap setup is working correctly as I can log in using my own AD Credentials.

Any help would be greatly appreciated. Thanks in advance.

@nuxsmin
Copy link
Owner

nuxsmin commented Dec 21, 2019

Hello @pbiggin23

I'm glad to know you found sysPass useful 😊

Regarding your issue, could you run the following SQL on sysPass database? (please replace login/email):

SELECT id
            FROM User
            WHERE UPPER(login) = UPPER('set_login_here') 
            OR (UPPER('set_login_here') = ssoLogin AND ssoLogin IS NOT NULL AND ssoLogin <> '')
            OR (UPPER('set_email_here') = email AND email IS NOT NULL AND email <> '')

This sentence is used to check whether there is any duplicated login/email.

Regards

@nuxsmin
Copy link
Owner

nuxsmin commented Dec 21, 2019

@shindelhu please could you provide the entire backtrace?

@pbiggin23
Copy link

Hello @pbiggin23

I'm glad to know you found sysPass useful 😊

Regarding your issue, could you run the following SQL on sysPass database? (please replace login/email):

SELECT id
            FROM User
            WHERE UPPER(login) = UPPER('set_login_here') 
            OR (UPPER('set_login_here') = ssoLogin AND ssoLogin IS NOT NULL AND ssoLogin <> '')
            OR (UPPER('set_email_here') = email AND email IS NOT NULL AND email <> '')

This sentence is used to check whether there is any duplicated login/email.

Regards

Hello @nuxsmin thanks for taking the time to reply. Only just got back to work to test this out.

Running the above sql code returns empty data set and I have tried entering different logins and email address.

Doing Select * from User;

Only shows 5 usernames and none of them have anything that matches that could cause the duplcation error.

Only shows the imported users and not any of the failed usernames or anything that has any similarity to the usernames that need to be imported.

My thinking is that it is something related when connecting to AD/LDAP and if there is another username with the same surname it doesn't like it.

@pbiggin23
Copy link

pbiggin23 commented Mar 9, 2020

Hey @nuxsmin

I finally found a solution...........

It dawned on me that all the users that were having issues with their AD accounts logging in were old accounts. That was the correlation.

So I checked the attribute editor on the accounts in AD and found that userAccountControl was set to with 0x220 = (PASSWD_NOTREQD | NORMAL_ACCOUNT which is an int value of 544

Found another account that was working with SysPass and they had their value as 0x200 = (NORMAL_ACCOUNT) with a value of 512

As we had created local SysPass accounts for some users that we had to delete them from SysPass first (as the local had the same firstname and surname as their AD accounts) and then change the value on userAccountControl to 512 then went through the Configuration -> LDAP and imported the users. The account imported fine but errored on all the accounts already imported(as expected)

Wether or not this attribute has changed from Window Server I don't know.

Doing a little bit of research from this Link Didn't really shed much light either as the accounts are allowed to changed passwords.

Just to confirm that we will get the duplicate user name error if the Firstname and Surname are the same regardless of the login? As I thought that would be a better unique value to search on?

@misterunknown
Copy link

@pbiggin23 @nuxsmin I have the same problem currently, which I solved by changing the FILTER_USER_OBJECT constant like this:

lib/SP/Providers/Auth/Ldap/LdapMsAds.php

41c41
<     const FILTER_USER_OBJECT = '(&(!(UserAccountControl:1.2.840.113556.1.4.804:=34))(|(objectCategory=person)(objectClass=user)))';
---
>     const FILTER_USER_OBJECT = '(&(!(UserAccountControl:1.2.840.113556.1.4.804:=2))(|(objectCategory=person)(objectClass=user)))';

I changed the 34 to 2. 2 means that the account mustn't be deactivated. I'm not sure what 32 (dec) means in this context, but it also prevented some of my users from being imported. Maybe this could be made optional or customizable. I'm always uncomfortable editing application code like this.

@nuxsmin
Copy link
Owner

nuxsmin commented Jun 25, 2020

@pbiggin23 I'm glad you get it working. Thanks for the feedback!

Just to confirm that we will get the duplicate user name error if the Firstname and Surname are the same regardless of the login? As I thought that would be a better unique value to search on?

As the duplicated user error states 'Duplicated user login/email' it will be triggered whenever the login or email is duplicated. UNIQUE KEY `uk_User_01` (`login`, `ssoLogin`)

@misterunknown As stated on https://support.microsoft.com/en-us/help/305144/how-to-use-useraccountcontrol-to-manipulate-user-account-properties the flag PASSWD_NOTREQD is set by the number 32 in decimal, so the default filter is set to skip disabled accounts and those that don't have any password set (blank).

Regards

@nuxsmin nuxsmin closed this as completed Jun 25, 2020
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

5 participants