user_ldap: Call to a member function setEMailAddress() on a non-object #23759

Closed
aTanCS opened this Issue Apr 3, 2016 · 9 comments

Projects

None yet

4 participants

@aTanCS
aTanCS commented Apr 3, 2016

PHP Fatal error: Call to a member function setEMailAddress() on a non-object in /var/www/owncloud/apps/user_ldap/lib/user/user.php on line 435

After upgrade from 8.2:
Cron job fails to finish.
Is not possible upgrade to current 9.0.1RC2 (github).

Steps to reproduce

A.

  1. Upgrade 8.2 to 9.0.
  2. Run CRON job from command line.
    B.
  3. Upgrade 9.0 to 9.0.1RC2
  4. Run sudo -u www-data ./occ upgrade --skip-migration-test

PHP 5.4.45-0+deb7u2 (cli) (built: Oct 17 2015 08:26:31)
mysql Ver 14.14 Distrib 5.5.47, for debian-linux-gnu (x86_64) using readline 6.2
nginx version: nginx/1.2.1

Enabled:

  • activity: 2.2.1
  • comments: 0.2
  • dav: 0.1.5
  • federatedfilesharing: 0.1.0
  • federation: 0.0.4
  • files: 1.4.4
  • files_external: 0.5.2
  • files_pdfviewer: 0.8
  • files_sharing: 0.9.1
  • files_texteditor: 2.1
  • files_trashbin: 0.8.0
  • files_versions: 1.2.0
  • files_videoplayer: 0.9.8
  • firstrunwizard: 1.1
  • gallery: 14.5.0
  • notifications: 0.2.3
  • provisioning_api: 0.4.1
  • systemtags: 0.2
  • templateeditor: 0.1
  • updatenotification: 0.1.0
  • user_ldap: 0.8.0
{
    "system": {
        "overwrite.cli.url": "https:\/\/10.0.1.16:8443",
        "dbtype": "mysql",
        "version": "9.0.0.19",
        "installed": true,
        "memcache.local": "\\OC\\Memcache\\APC",
        "appstore.experimental.enabled": true,
        "ldapIgnoreNamingRules": false,
        "loglevel": 0,
        "updatechecker": false,
        "theme": "",
        "maintenance": true
    }
}

**Are you using external storage, if yes which one: local

**Are you using encryption: no

**Are you using an external user-backend, if yes which one: LDAP

{"reqId":"GkuXG\/h121t5Nv52uETL","remoteAddr":"","app":"core","message":"starting upgrade from 9.0.0.19 to 9.0.1.2","level":0,"time":"2016-04-03T21:55:26+02:00","method":"--","url":"--","user":"--"}
{"reqId":"GkuXG\/h121t5Nv52uETL","remoteAddr":"","app":"user_ldap","message":"getUsers: Options: search  limit 500 offset 0 Filter: (&(&(memberOf=cn=owncloud,ou=group,dc=testdomain,dc=com)(memberOf=cn=active,ou=group,dc=testdomain,dc=com))(displayname=*)(displayname=*))","level":0,"time":"2016-04-03T21:55:30+02:00","method":"--","url":"--","user":"--"}
{"reqId":"GkuXG\/h121t5Nv52uETL","remoteAddr":"","app":"user_ldap","message":"initializing paged search for  Filter (&(&(memberOf=cn=owncloud,ou=group,dc=testdomain,dc=com)(memberOf=cn=active,ou=group,dc=testdomain,dc=com))(displayname=*)(displayname=*)) base Array\n(\n    [0] => dc=testdomain,dc=com\n)\n attr Array\n(\n    [0] => dn\n    [1] => uid\n    [2] => samaccountname\n    [3] => memberof\n    [4] => \n    [5] => mail\n    [6] => displayname\n    [7] => \n)\n limit 500 offset 0","level":0,"time":"2016-04-03T21:55:30+02:00","method":"--","url":"--","user":"--"}
{"reqId":"GkuXG\/h121t5Nv52uETL","remoteAddr":"","app":"user_ldap","message":"Ready for a paged search","level":0,"time":"2016-04-03T21:55:30+02:00","method":"--","url":"--","user":"--"}
{"reqId":"GkuXG\/h121t5Nv52uETL","remoteAddr":"","app":"user_ldap","message":"initializing paged search for  Filter &(memberOf=cn=owncloud,ou=group,dc=testdomain,dc=com)(memberOf=cn=active,ou=group,dc=testdomain,dc=com) base Array\n(\n    [0] => uid=frosch.m,ou=people,dc=testdomain,dc=com\n)\n attr Array\n(\n    [0] => \n)\n limit 500 offset 0","level":0,"time":"2016-04-03T21:55:30+02:00","method":"--","url":"--","user":"--"}
{"reqId":"GkuXG\/h121t5Nv52uETL","remoteAddr":"","app":"user_ldap","message":"Ready for a paged search","level":0,"time":"2016-04-03T21:55:30+02:00","method":"--","url":"--","user":"--"}
{"reqId":"GkuXG\/h121t5Nv52uETL","remoteAddr":"","app":"user_ldap","message":"LDAP error Bad search filter (-7) after calling ldap_read","level":0,"time":"2016-04-03T21:55:30+02:00","method":"--","url":"--","user":"--"}
{"reqId":"GkuXG\/h121t5Nv52uETL","remoteAddr":"","app":"user_ldap","message":"initializing paged search for  Filter &(memberOf=cn=owncloud,ou=group,dc=testdomain,dc=com)(memberOf=cn=active,ou=group,dc=testdomain,dc=com) base Array\n(\n    [0] => dc=testdomain,dc=com\n)\n attr Array\n(\n    [0] => dn\n)\n limit 1 offset 0","level":0,"time":"2016-04-03T21:55:30+02:00","method":"--","url":"--","user":"--"}
{"reqId":"GkuXG\/h121t5Nv52uETL","remoteAddr":"","app":"user_ldap","message":"Ready for a paged search","level":0,"time":"2016-04-03T21:55:30+02:00","method":"--","url":"--","user":"--"}
{"reqId":"GkuXG\/h121t5Nv52uETL","remoteAddr":"","app":"user_ldap","message":"Error when searching: Bad search filter code -7","level":3,"time":"2016-04-03T21:55:30+02:00","method":"--","url":"--","user":"--"}
{"reqId":"GkuXG\/h121t5Nv52uETL","remoteAddr":"","app":"user_ldap","message":"Attempt for Paging?  1","level":3,"time":"2016-04-03T21:55:30+02:00","method":"--","url":"--","user":"--"}
{"reqId":"GkuXG\/h121t5Nv52uETL","remoteAddr":"","app":"PHP","message":"Call to a member function setEMailAddress() on a non-object at \/var\/www\/owncloud\/apps\/user_ldap\/lib\/user\/user.php#435","level":3,"time":"2016-04-03T21:55:30+02:00","method":"--","url":"--","user":"--"}
@ghost
ghost commented Apr 3, 2016

Normally this should be fixed with the upcoming oC 9.0.1: #22825 or is this another issue then #23028 ?

@aTanCS
aTanCS commented Apr 4, 2016

It is not the same issue. As I wrote, I downloaded 9.0.1RC2, that has already patch from #22825 (I checked apps/user_ldap/lib/proxy.php). occ upgrade failed with the same error.

@aTanCS
aTanCS commented Apr 4, 2016

All LDAP settings tests are OK. May be there is some escaping problem in user_ldap.

User filter finds all users:

(&(memberOf=cn=owncloud,ou=group,dc=testdomain,dc=com)(memberOf=cn=active,ou=group,dc=testdomain,dc=com))

Login attributes filter finds any user:

(&(uid=%uid)(memberOf=cn=owncloud,ou=group,dc=testdomain,dc=com)(memberOf=cn=active,ou=group,dc=testdomain,dc=com))
@DeepDiver1975 DeepDiver1975 self-assigned this Apr 4, 2016
@DeepDiver1975 DeepDiver1975 added this to the 9.1-current milestone Apr 4, 2016
@DeepDiver1975 DeepDiver1975 added the bug label Apr 4, 2016
@aTanCS
aTanCS commented Apr 4, 2016

I guess there is the same problem in apps/dav/appinfo/application.php at 222 ($migration->syncUser($user->getUID());). It fails with the similar error, only different method.

@DeepDiver1975
Member

I guess there is the same problem in apps/dav/appinfo/application.php at 222

should not really be possible because we iterate over all users which do exists

@aTanCS
aTanCS commented Apr 5, 2016

I tried to check $user by myself that day when I submitted the bug as you do in #23777 , this was the result:

{"reqId":"kK3\/U0MIiuAmo7ZopwTu","remoteAddr":"","app":"user_ldap","message":"initializing paged search for  Filter &(memberOf=cn=owncloud,ou=group,dc=testdomain,dc=com)(memberOf=cn=active,ou=group,dc=testdomain,dc=com) base Array\n(\n    [0] => uid=frosch.m,ou=people,dc=testdomain,dc=com\n)\n attr Array\n(\n    [0] => \n)\n limit 500 offset 0","level":0,"time":"2016-04-03T22:00:20+02:00","method":"--","url":"--","user":"--"}
{"reqId":"kK3\/U0MIiuAmo7ZopwTu","remoteAddr":"","app":"user_ldap","message":"Ready for a paged search","level":0,"time":"2016-04-03T22:00:20+02:00","method":"--","url":"--","user":"--"}
{"reqId":"kK3\/U0MIiuAmo7ZopwTu","remoteAddr":"","app":"user_ldap","message":"LDAP error Bad search filter (-7) after calling ldap_read","level":0,"time":"2016-04-03T22:00:20+02:00","method":"--","url":"--","user":"--"}
{"reqId":"kK3\/U0MIiuAmo7ZopwTu","remoteAddr":"","app":"user_ldap","message":"initializing paged search for  Filter &(memberOf=cn=owncloud,ou=group,dc=testdomain,dc=com)(memberOf=cn=active,ou=group,dc=testdomain,dc=com) base Array\n(\n    [0] => dc=testdomain,dc=com\n)\n attr Array\n(\n    [0] => dn\n)\n limit 1 offset 0","level":0,"time":"2016-04-03T22:00:20+02:00","method":"--","url":"--","user":"--"}
{"reqId":"kK3\/U0MIiuAmo7ZopwTu","remoteAddr":"","app":"user_ldap","message":"Ready for a paged search","level":0,"time":"2016-04-03T22:00:20+02:00","method":"--","url":"--","user":"--"}
{"reqId":"kK3\/U0MIiuAmo7ZopwTu","remoteAddr":"","app":"user_ldap","message":"Error when searching: Bad search filter code -7","level":3,"time":"2016-04-03T22:00:20+02:00","method":"--","url":"--","user":"--"}
{"reqId":"kK3\/U0MIiuAmo7ZopwTu","remoteAddr":"","app":"user_ldap","message":"Attempt for Paging?  1","level":3,"time":"2016-04-03T22:00:20+02:00","method":"--","url":"--","user":"--"}
{"reqId":"kK3\/U0MIiuAmo7ZopwTu","remoteAddr":"","app":"PHP","message":"Call to a member function getUID() on a non-object at \/var\/www\/owncloud\/apps\/dav\/appinfo\/application.php#222","level":3,"time":"2016-04-03T22:00:20+02:00","method":"--","url":"--","user":"--"}

After adding the similar check for empty $user to application.php there was no error, but any of ldap users could log in. I think user_ldap in OC9 needs more investigation, but it is more than I can do.

@DeepDiver1975
Member

Wow ... that's really strange ...

@blizzz
Contributor
blizzz commented Apr 6, 2016
{"reqId":"kK3\/U0MIiuAmo7ZopwTu","remoteAddr":"","app":"user_ldap","message":"LDAP error Bad search filter (-7) after calling ldap_read","level":0,"time":"2016-04-03T22:00:20+02:00","method":"--","url":"--","user":"--"}

indicates an LDAP config issue. Please revise your filters.

@aTanCS
aTanCS commented Apr 6, 2016

blizz: In LDAP part of the settings page all tests work. It founds all users and founds users by login. I was able to check it by using administrator account. All filters are here: #23759 (comment)

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