OwnCloud client connection error (503 Service Unavailable - PROPFIND, Error: Using $this when not in object context)

Hi there,

unfortunaltey I’m unable to use the OwnCloud client anymore since a few days.
There was no update or any change on the system.

When I try to connect with the client I’ll get this error message

Below you will find the log of the server.

Btw. the weblogin works as usual.

Hopefully anyone of you already got this error and knows how to fix it.

Expected behaviour

Proper work of the OwnCloud client

Actual behaviour

Steps to reproduce

I don’t know.

Server configuration

Operating system: Univention distribution with an OwnCloud docker

ownCloud version: 10.2.1.4

Storage backend (external storage): local and CIFS to a windows file share

Client configuration

Client version: 2.6.0

Operating system: Windows 10

OS language: English

Logs

Server logfile: ownCloud log (data/owncloud.log):

{“reqId”:“a328fff6-705c-47bf-a4f8-a903c3bdae8e”,“level”:3,“time”:“2019-12-09T10:26:56+00:00”,“remoteAddr”:“172.17.42.1”,“user”:"–",“app”:“PHP”,“method”:“PROPFIND”,“url”:"/owncloud/remote.php/webdav/",“message”:“Non-static method OCA\User_LDAP\Helper::loginName2UserName() should not be called statically at /var/www/owncloud/lib/private/legacy/hook.php#105”}
{“reqId”:“a328fff6-705c-47bf-a4f8-a903c3bdae8e”,“level”:4,“time”:“2019-12-09T10:26:56+00:00”,“remoteAddr”:“172.17.42.1”,“user”:"–",“app”:“webdav”,“method”:“PROPFIND”,“url”:"/owncloud/remote.php/webdav/",“message”:“Exception: HTTP/1.1 503 Error: Using $this when not in object context: {“Exception”:“Sabre\\DAV\\Exception\\ServiceUnavailable”,“Message”:“Error: Using $this when not in object context”,“Code”:0,“Trace”:”#0 [internal function]: {closure}(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#1 \/var\/www\/owncloud\/lib\/composer\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Object(Closure), Array)\n#2 \/var\/www\/owncloud\/lib\/composer\/sabre\/dav\/lib\/DAV\/Server.php(466): Sabre\\Event\\EventEmitter->emit(‘beforeMethod’, Array)\n#3 \/var\/www\/owncloud\/lib\/composer\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#4 \/var\/www\/owncloud\/remote.php(70): Sabre\\DAV\\Server->exec()\n#5 \/var\/www\/owncloud\/remote.php(169): handleException(Object(Error))\n#6 {main}",“File”:"\/var\/www\/owncloud\/remote.php",“Line”:68}"}

This looks like a bug in the user_ldap app.
I filed a bug at https://github.com/owncloud/user_ldap/issues/486 with my insights.

1 Like

First of all, thank you for that fast response.

Unfortunately I’m not that used to configuring PHP files. So may you can tell me what I need to do to fix this?

Thanks and best regards,
Lukas

Lukas,

I did not debug the code, I only found an issue at a first glance. In general you would have to wait until the bug had been resolved.

However, I can provide you a code snippet, which you may change (without warranty and at your own risk) and which might solve your issue. Keep in mind, that with patching your installation the integrity check will complain about this file.

From the diff I saw in the code, you have to replace the function loginName2UserName in the file <owncloud_installation_directory/<apps_directory>/user_ldap/lib/Helper.php with the lines below

public static function loginName2UserName($param) {
	if (!isset($param['uid'])) {
		throw new \Exception('key uid is expected to be set in $param');
	}

	//ain't it ironic?
	$helper = new Helper();

	$configPrefixes = $helper->getServerConfigurationPrefixes(true);
	$ldapWrapper = new LDAP();
	$ocConfig = \OC::$server->getConfig();

	$userBackend  = new User_Proxy(
		$configPrefixes, $ldapWrapper, $ocConfig
	);
	$uid = $userBackend->loginName2UserName($param['uid']);
	if ($uid !== false) {
		$param['uid'] = $uid;
	}
    }
1 Like

Ok, so that just didn’t work for me.

Since I realized its not the owncloud container which stopped working properly it needs to depend on the Univention below the docker.

I just migrated the container to a fresh installed Univention environment and ran a script which sets all my ucr variables.
May I should have done that first to save quite much time :smiley:

Now everthing works just fine. Btw. what I’ve may not mentioned, I’m running 2 instances and both have had the same issue. And I remember there have been changes to the apache config on both machines.
So I think the issue dpends on the apache server.

Thanks a lot for your support and your time

Why didn’t have Unknown Device on Google Account?