[stable9] Fix LDAP race conditions #24242

Merged
merged 1 commit into from Apr 26, 2016

Projects

None yet

4 participants

@MorrisJobke
Member
  • getFromCache is wrapped in isCached
  • inbetween the two calls the cache entry hits it's TTL
  • getFromCache returns null
  • this fix only checkes if the returned value is null and
    return only non-null values
  • backport of #24052
  • approval in #24052 (comment)
  • I tested this with openLDAP and the setup and login works just fine
@MorrisJobke MorrisJobke Fix LDAP race conditions
* getFromCache is wrapped in isCached
* inbetween the two calls the cache entry hits it's TTL
* getFromCache returns null
* this fix only checkes if the returned value is null and
  return only non-null values
5b126cd
@MorrisJobke MorrisJobke added this to the 9.0.2-current-maintenance milestone Apr 25, 2016
@MorrisJobke
Member
@MorrisJobke
Member

The login fails for an AD server:

{"reqId":"3Ib70gzEQ00QLlWXmfqQ","remoteAddr":"92.206.40.223","app":"PHP","message":"Call to a member function getFileInfo() on a non-object at \/opt\/owncloud\/lib\/private\/files\/filesystem.php#869","level":3,"time":"2016-04-25T13:57:25+00:00","method":"GET","url":"\/index.php\/apps\/files\/","user":"--"}

cc @davitol @blizzz

@MorrisJobke
Member

Stack trace:

{
    "reqId":"MBAlJGg/ZFD8TjYojPn7",
    "remoteAddr":"92.206.40.223",
    "app":"no app in context",
    "message":"Exception:
    {
    "Exception":"Exception",
    "Message":"",
    "Code":0,
    "Trace":"
        #0 /opt/owncloud/apps/files/controller/viewcontroller.php(110): OC\Files\Filesystem::getFileInfo('/', false)
        #1 /opt/owncloud/apps/files/controller/viewcontroller.php(174): OCA\Files\Controller\ViewController->getStorageInfo()
        #2 [internal function]: OCA\Files\Controller\ViewController->index('', '')
        #3 /opt/owncloud/lib/private/appframework/http/dispatcher.php(159): call_user_func_array(Array, Array)
        #4 /opt/owncloud/lib/private/appframework/http/dispatcher.php(89): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\Files\Controller\ViewController), 'index')
        #5 /opt/owncloud/lib/private/appframework/app.php(110): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Files\Controller\ViewController), 'index')
        #6 /opt/owncloud/lib/private/appframework/routing/routeactionhandler.php(45): OC\AppFramework\App::main('ViewController', 'index', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
        #7 [internal function]: OC\AppFramework\routing\RouteActionHandler->__invoke(Array)
        #8 /opt/owncloud/lib/private/route/router.php(276): call_user_func(Object(OC\AppFramework\routing\RouteActionHandler), Array)
        #9 /opt/owncloud/lib/base.php(882): OC\Route\Router->match('/apps/files/')
        #10 /opt/owncloud/index.php(39): OC::handleRequest()
        #11 {main}",
    "File":"/opt/owncloud/lib/private/files/filesystem.php",
    "Line":869}",
    "level":3,
    "time":"2016-04-25T13:59:39+00:00",
    "method":"GET",
    "url":"/index.php/apps/files/",
    "user":"--"
}
{
    "reqId":"MBAlJGg/ZFD8TjYojPn7",
    "remoteAddr":"92.206.40.223",
    "app":"PHP",
    "message":"Call to a member function getFileInfo() on a non-object at /opt/owncloud/lib/private/files/filesystem.php#870",
    "level":3,
    "time":"2016-04-25T13:59:39+00:00",
    "method":"GET",
    "url":"/index.php/apps/files/",
    "user":"--"
}
@MorrisJobke
Member

Maybe it's caused by a somehow wrongly setup AD? cc @davitol

@blizzz
Contributor
blizzz commented Apr 25, 2016

AD login works for me

@blizzz
Contributor
blizzz commented Apr 25, 2016

The backtrace is file/storage related. Maybe some remnants from another test case?

@blizzz
Contributor
blizzz commented Apr 25, 2016

Looks good and works for me 👍

@davitol
Contributor
davitol commented Apr 26, 2016

The backtrace is file/storage related. Maybe some remnants from another test case?

It was a fresh installation for this test.

Maybe it's caused by a somehow wrongly setup AD?

Same AD configuration in another server without the patch let me to log in with my AD user.

Let me test this patch again and i`ll tell you the results

@MorrisJobke
Member

Let me test this patch again and i`ll tell you the results

And hand over the credentials for this machine. Then I will try to bisect this.

@davitol
Contributor
davitol commented Apr 26, 2016

@MorrisJobke @blizzz I have reboot the machine of the AD server, and now it works perfect with the patch too. 👍

@davitol davitol added the tested label Apr 26, 2016
@DeepDiver1975 DeepDiver1975 merged commit 80a31b7 into stable9 Apr 26, 2016

22 checks passed

cla-bot-core Build #3483 succeeded in 31 sec
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
core-ci-linux-jsunit/database=sqlite,label=SLAVE Build #61239 succeeded in 1 min 53 sec
Details
core-ci-linux-swift-primary-storage/database=mysql,label=SLAVE Build #55373 succeeded in 19 min
Details
core-ci-linux/database=mysql,label=SLAVE Build #29840 succeeded in 20 min
Details
core-ci-linux/database=oci,label=SLAVE Build #29840 succeeded in 26 min
Details
core-ci-linux/database=pgsql,label=SLAVE Build #29840 succeeded in 17 min
Details
core-ci-linux/database=sqlite,label=SLAVE Build #29840 succeeded in 10 min
Details
ocs-api-integration-tests-ci Build #10052 succeeded in 16 min
Details
server-master-linux-externals-ci/database=sqlite,external=smb-silvershell,label=SLAVE Build #9684 succeeded in 3 min 43 sec
Details
server-master-linux-externals-ci/database=sqlite,external=swift-ceph,label=SLAVE Build #9684 succeeded in 4 min 7 sec
Details
server-master-linux-externals-ci/database=sqlite,external=webdav-ownCloud,label=SLAVE Build #9684 succeeded in 5 min 41 sec
Details
server-master-linux-externals-smb-windows-ext-ci/database=sqlite,external=smb-windows,label=master Build #12650 succeeded in 2 min 25 sec
Details
server-master-linux-php5.4-ci/database=sqlite,label=SLAVE Build #2781 succeeded in 5 min 27 sec
Details
server-master-linux-php7-ci/database=sqlite,label=SLAVE Build #38073 succeeded in 3 min 14 sec
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=litmus,mirallBranch=v2.0.2,slave=SMASH Build #14017 succeeded in 9 min 58 sec
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=test_basicSync@0,mirallBranch=v2.0.2,slave=SMASH Build #14017 succeeded in 18 min
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=test_basicSync@1,mirallBranch=v2.0.2,slave=SMASH Build #14017 succeeded in 34 min
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=test_shareLink,mirallBranch=v2.0.2,slave=SMASH Build #14017 succeeded in 42 min
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=test_sharePermissions,mirallBranch=v2.0.2,slave=SMASH Build #14017 succeeded in 32 min
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=test_sharePropagationGroups,mirallBranch=v2.0.2,slave=SMASH Build #14017 succeeded in 13 min
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=test_sharePropagationInsideGroups,mirallBranch=v2.0.2,slave=SMASH Build #14017 succeeded in 16 min
Details
@DeepDiver1975 DeepDiver1975 deleted the stable9-backport-24052 branch Apr 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment