PHP-Error flooding the log when displaying collectives

Hi guys,

I have a docker-compose based nextcloud setup and am facing some annoying flooding of my error log.

I did not find any similar problem when inspecting this issue, so I opened a thread in here.

Thanks in advance for your time

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 22.2.0
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): nginx
PHP version (eg, 7.4): 8.0

The issue you are facing:

Each time one of my users uses a collective the log is flooded with the error below. Collectives is running without any problems, the log is unreadable.

Is this the first time you’ve seen this error? (Y/N): N

Steps to replicate it:

  1. Open a collective
  2. Open Log → the same error message showing up to 30 times

The output of your Nextcloud log in Admin > Logging:

[PHP] Error: usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero at /var/www/html/apps/text/lib/Service/DocumentService.php#416

POST /apps/text/session/sync
from xx.xx.xxx.55 by i-replaced-the-user-uuid at 2021-10-18T15:40:11+00:00

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'redis',
    'password' => 'xxx',
    'port' => 6379,
  ),
  'instanceid' => 'xxx',
  'passwordsalt' => 'xxxx',
  'secret' => 'xxxx',
  'trusted_domains' =>
  array (
    0 => 'xxx.de',
    1 => 'nginx-server',
  ),
  'default_language' => 'de',
  'default_locale' => 'de',
  'default_phone_region' => 'de',
  'knowledgebaseenabled' => true,
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'pgsql',
  'version' => '22.2.0.2',
  'overwrite.cli.url' => 'https://xxx.de',
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'xxx',
  'dbpassword' => 'xxx',
  'installed' => true,
  'onlyoffice' =>
  array (
    'DocumentServerUrl' => '/ds-vpath/',
    'DocumentServerInternalUrl' => 'http://onlyoffice-document-server/',
    'StorageUrl' => 'http://nginx-server/',
    'verify_peer_off' => true,
  ),
  'allow_local_remote_servers' => 'true',
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'mail_from_address' => 'cloudmail',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'xxx',
  'mail_smtphost' => 'xxx',
  'mail_smtpport' => '25',
  'maintenance' => false,
  'mail_smtpauthtype' => 'PLAIN',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'xxx',
  'mail_smtppassword' => 'xxxx',
  'mail_smtpsecure' => 'tls',
  'lost_password_link' => 'disabled',
  'loglevel' => 2,
  'app_install_overwrite' =>
  array (
    0 => 'spreed',
    1 => 'files_texteditor',
    2 => 'tasks',
    3 => 'quota_warning',
    4 => 'forms',
    5 => 'files_mindmap',
  ),
);

The output of your Apache/nginx/system log in /var/log/____:

{
	"reqId": "348sDQLp34cOZWo2bi9J",
	"level": 3,
	"time": "2021-10-18T15:48:24+00:00",
	"remoteAddr": "xxx",
	"user": "xxx",
	"app": "PHP",
	"method": "POST",
	"url": "/apps/text/session/sync",
	"message": "usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero at /var/www/html/apps/text/lib/Service/DocumentService.php#416",
	"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0",
	"version": "22.2.0.2",
	"exception": {
		"Exception": "Error",
		"Message": "usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero at /var/www/html/apps/text/lib/Service/DocumentService.php#416",
		"Code": 0,
		"Trace": [
			{
				"function": "onError",
				"class": "OC\\Log\\ErrorHandler",
				"type": "::",
				"args": [
					8192,
					"usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero",
					"/var/www/html/apps/text/lib/Service/DocumentService.php",
					416
				]
			},
			{
				"file": "/var/www/html/apps/text/lib/Service/DocumentService.php",
				"line": 416,
				"function": "usort",
				"args": [
					[
						{
							"__class__": "OC\\Files\\Node\\File"
						},
						{
							"__class__": "OC\\Files\\Node\\File"
						}
					],
					{
						"__class__": "Closure"
					}
				]
			},
			{
				"file": "/var/www/html/apps/text/lib/Service/DocumentService.php",
				"line": 378,
				"function": "getFileById",
				"class": "OCA\\Text\\Service\\DocumentService",
				"type": "->",
				"args": [
					43691,
					"fa4841c4-c567-1039-8006-2308ba6e633a"
				]
			},
			{
				"file": "/var/www/html/apps/text/lib/Service/ApiService.php",
				"line": 167,
				"function": "getFileForSession",
				"class": "OCA\\Text\\Service\\DocumentService",
				"type": "->",
				"args": [
					{
						"id": 4375,
						"__class__": "OCA\\Text\\Db\\Session"
					},
					null
				]
			},
			{
				"file": "/var/www/html/apps/text/lib/Controller/SessionController.php",
				"line": 82,
				"function": "sync",
				"class": "OCA\\Text\\Service\\ApiService",
				"type": "->",
				"args": [
					43691,
					4375,
					"SJROdTGTHOz3rESq8/xcGScdZ1l1rT0VSpt4T7JJCrYEGjTSjrWQ2vRQSUi+xvsH",
					0,
					null,
					false,
					false
				]
			},
			{
				"file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
				"line": 217,
				"function": "sync",
				"class": "OCA\\Text\\Controller\\SessionController",
				"type": "->",
				"args": [
					43691,
					4375,
					"SJROdTGTHOz3rESq8/xcGScdZ1l1rT0VSpt4T7JJCrYEGjTSjrWQ2vRQSUi+xvsH",
					0,
					null,
					false,
					false
				]
			},
			{
				"file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
				"line": 126,
				"function": "executeController",
				"class": "OC\\AppFramework\\Http\\Dispatcher",
				"type": "->",
				"args": [
					{
						"__class__": "OCA\\Text\\Controller\\SessionController"
					},
					"sync"
				]
			},
			{
				"file": "/var/www/html/lib/private/AppFramework/App.php",
				"line": 156,
				"function": "dispatch",
				"class": "OC\\AppFramework\\Http\\Dispatcher",
				"type": "->",
				"args": [
					{
						"__class__": "OCA\\Text\\Controller\\SessionController"
					},
					"sync"
				]
			},
			{
				"file": "/var/www/html/lib/private/Route/Router.php",
				"line": 301,
				"function": "main",
				"class": "OC\\AppFramework\\App",
				"type": "::",
				"args": [
					"OCA\\Text\\Controller\\SessionController",
					"sync",
					{
						"__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
					},
					{
						"_route": "text.Session.sync"
					}
				]
			},
			{
				"file": "/var/www/html/lib/base.php",
				"line": 1000,
				"function": "match",
				"class": "OC\\Route\\Router",
				"type": "->",
				"args": [
					"/apps/text/session/sync"
				]
			},
			{
				"file": "/var/www/html/index.php",
				"line": 36,
				"function": "handleRequest",
				"class": "OC",
				"type": "::",
				"args": []
			}
		],
		"File": "/var/www/html/lib/private/Log/ErrorHandler.php",
		"Line": 92,
		"CustomMessage": "--"
	},
	"id": "616d97495ad0d"
}