Memcache doesn't let plugin initialize new user filesystem


We have an app for our SSO solution (we are using gluu). It is working great, but we have found a problem recently.

When we enabled memcache with redis on our nextcloud instance (following guidelines here we suddendly get an issue where new users registered through the SSO doesn’t get their filesystem initialised.

Basically, when the user login through the SSO for the first time, our nextcloud plugin creates a user and initialize their filesystem. It looks like this:

$this->log->debug('Creating new user: '.$uid, ['app' => $this->appName]);
            $user = $this->usermanager->createUser($uid, $random_password);
            Filesystem::init($user->getUID(), '');

When the user then is logged in, they get the default nextcloud error page. When we look at the issue, the error log explain that is couldn’t find any files/folders for the user. Under /data folder in nextcloud install we cannot find their file folder.

This problem only occurs with the SSO login. With regular nextcloud user registration and login, files are created and login works fine. There are no other problems we’ve noticed after enabling memcache, only this.

Does anyone know what could cause this issue? Thank you for your advice.