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

cannot sync LDAP users the first time #30369

Closed
individual-it opened this issue Feb 5, 2018 · 5 comments
Closed

cannot sync LDAP users the first time #30369

individual-it opened this issue Feb 5, 2018 · 5 comments

Comments

@individual-it
Copy link
Member

Steps to reproduce

  1. setup LDAP
  2. run occ user:sync "OCA\User_LDAP\User_Proxy" -m remove

Expected behaviour

LDAP users sync

Actual behaviour

Exception thrown

TypeError: Argument 1 passed to OC\User\SyncService::syncAccount() must be an instance of OC\User\Account, null given, called in /var/www/owncloud/lib/private/User/SyncService.php on line 121 and defined in /var/www/owncloud/lib/private/User/SyncService.php:279
Stack trace:
#0 /var/www/owncloud/lib/private/User/SyncService.php(121): OC\User\SyncService->syncAccount(NULL, Object(OCA\User_LDAP\User_Proxy))
#1 /var/www/owncloud/core/Command/User/SyncBackend.php(148): OC\User\SyncService->run(Object(OCA\User_LDAP\User_Proxy), Object(Closure))
#2 /var/www/owncloud/lib/composer/symfony/console/Command/Command.php(252): OC\Core\Command\User\SyncBackend->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /var/www/owncloud/lib/composer/symfony/console/Application.php(938): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /var/www/owncloud/lib/composer/symfony/console/Application.php(240): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\User\SyncBackend), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /var/www/owncloud/lib/composer/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /var/www/owncloud/lib/private/Console/Application.php(161): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /var/www/owncloud/console.php(106): OC\Console\Application->run()
#8 /var/www/owncloud/occ(11): require_once('/var/www/ownclo...')
    1 [->--------------------------] 0/6 [>---------------------------]   0%
#9 {main}

Problem started with #29669
reverting commit 05a82b5 fixes it
@tomneedham
see more details in CI https://drone.owncloud.com/owncloud/user_ldap/51/10

Server configuration

Operating system:
Ubuntu 16.04
Web server:
Apache
Database:
MySQL
PHP version:
7.1
ownCloud version: (see ownCloud admin page)
10.0.6 master nightly
Updated from an older ownCloud or fresh install:
fresh
Where did you install ownCloud from:
nightly build

List of activated apps:

Enabled:
  - comments: 0.3.0
  - configreport: 0.1.1
  - dav: 0.3.2
  - federatedfilesharing: 0.3.1
  - federation: 0.1.0
  - files: 1.5.1
  - files_external: 0.7.1
  - files_sharing: 0.10.1
  - files_trashbin: 0.9.1
  - files_versions: 1.3.0
  - files_videoplayer: 0.9.8
  - firstrunwizard: 1.1
  - market: 0.2.3
  - notifications: 0.3.3
  - provisioning_api: 0.5.0
  - systemtags: 0.3.0
  - templateeditor: 0.2
  - testing: 0.1.0
  - updatenotification: 0.2.1
  - user_ldap: 0.10.0
Disabled:
  - encryption
  - external
  - theme-example
- user_external

Are you using external storage, if yes which one: local/smb/sftp/...
local
Are you using encryption: yes/no
no
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
LDAP

LDAP configuration (delete this part if not used)

+-------------------------------+---------------------------------------------------------------------------------------+
| Configuration                 | LDAPTestId                                                                            |
+-------------------------------+---------------------------------------------------------------------------------------+
| hasMemberOfFilterSupport      | 0                                                                                     |
| hasPagedResultSupport         |                                                                                       |
| homeFolderNamingRule          |                                                                                       |
| lastJpegPhotoLookup           | 0                                                                                     |
| ldapAgentName                 | cn=admin,dc=owncloud,dc=com                                                           |
| ldapAgentPassword             | ***                                                                                   |
| ldapAttributesForGroupSearch  |                                                                                       |
| ldapAttributesForUserSearch   |                                                                                       |
| ldapBackupHost                |                                                                                       |
| ldapBackupPort                |                                                                                       |
| ldapBase                      | dc=owncloud,dc=com                                                                    |
| ldapBaseGroups                | dc=owncloud,dc=com                                                                    |
| ldapBaseUsers                 | dc=owncloud,dc=com                                                                    |
| ldapCacheTTL                  | 600                                                                                   |
| ldapConfigurationActive       | 1                                                                                     |
| ldapDynamicGroupMemberURL     |                                                                                       |
| ldapEmailAttribute            | mail                                                                                  |
| ldapExperiencedAdmin          | 0                                                                                     |
| ldapExpertUUIDGroupAttr       |                                                                                       |
| ldapExpertUUIDUserAttr        | uid                                                                                   |
| ldapExpertUsernameAttr        |                                                                                       |
| ldapGroupDisplayName          | cn                                                                                    |
| ldapGroupFilter               | (&(|(objectclass=posixGroup)))                                                        |
| ldapGroupFilterGroups         |                                                                                       |
| ldapGroupFilterMode           | 0                                                                                     |
| ldapGroupFilterObjectclass    | posixGroup                                                                            |
| ldapGroupMemberAssocAttr      | memberUid                                                                             |
| ldapHost                      | ldap                                                                                  |
| ldapIgnoreNamingRules         |                                                                                       |
| ldapLoginFilter               | (&(|(objectclass=inetOrgPerson))(|(uid=%uid)(|(mailPrimaryAddress=%uid)(mail=%uid)))) |
| ldapLoginFilterAttributes     |                                                                                       |
| ldapLoginFilterEmail          | 1                                                                                     |
| ldapLoginFilterMode           | 0                                                                                     |
| ldapLoginFilterUsername       | 1                                                                                     |
| ldapNestedGroups              | 0                                                                                     |
| ldapOverrideMainServer        |                                                                                       |
| ldapPagingSize                | 500                                                                                   |
| ldapPort                      | 389                                                                                   |
| ldapQuotaAttribute            |                                                                                       |
| ldapQuotaDefault              |                                                                                       |
| ldapTLS                       | 0                                                                                     |
| ldapUserDisplayName           | displayName                                                                           |
| ldapUserDisplayName2          |                                                                                       |
| ldapUserFilter                | (|(objectclass=inetOrgPerson))                                                        |
| ldapUserFilterGroups          |                                                                                       |
| ldapUserFilterMode            | 0                                                                                     |
| ldapUserFilterObjectclass     | inetOrgPerson                                                                         |
| ldapUuidGroupAttribute        | auto                                                                                  |
| ldapUuidUserAttribute         | auto                                                                                  |
| turnOffCertCheck              | 0                                                                                     |
| useMemberOfToDetectMembership | 1                                                                                     |
+-------------------------------+---------------------------------------------------------------------------------------+

Logs

ownCloud log (data/owncloud.log)

{"reqId":"RmWk4ZnlhhDOnlOvvEoE","level":3,"time":"2018-02-05T13:02:29+00:00","remoteAddr":"","user":"--","app":"PHP","method":"--","url":"--","message":"Undefined variable: a at \/var\/www\/owncloud\/lib\/private\/User\/SyncService.php#121"}
@phil-davis
Copy link
Contributor

The problem looks like it was introduced in https://github.com/owncloud/core/pull/29669/files#diff-37958be4e01e8baeb127a59409e1a593L114
And should be fixed by PR #30367

@tomneedham
Copy link
Contributor

Merged - retest @phil-davis ?

@phil-davis
Copy link
Contributor

@individual-it you have an LDAP environment running - can you retest please?

@individual-it
Copy link
Member Author

fixed by #30367

@lock
Copy link

lock bot commented Jul 31, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants