PHP error on snap nextcloud instance

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.3snap2
Operating system and version (eg, Ubuntu 20.04): Arch Linux
Apache or nginx version (eg, Apache 2.4.25): 2.4.52
PHP version (eg, 7.4): 8.0.13

The issue you are facing:
PHP spam error

PHP Fatal error:  Cannot use OCP\Constants as Constants because the name is already in use in /var/snap/nextcloud/28713/nextcloud/extra-apps/groupfolders/lib/Command/ACL.php on line 35

and PHP restart over and over again taking resources. Maybe extra-app since it is migrated

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

Steps to replicate it:
Not sure, apears at beginning.

The output of your Nextcloud log in Admin > Logging:

Cannot use OCP\Constants as Constants because the name is already in use at /var/snap/nextcloud/28713/nextcloud/extra-apps/groupfolders/lib/Command/ACL.php#35

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

<?php
$CONFIG = array (
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/snap/nextcloud/current/htdocs/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/snap/nextcloud/current/nextcloud/extra-apps',
      'url' => '/extra-apps',
      'writable' => true,
    ),
  ),
  'supportedDatabases' => 
  array (
    0 => 'mysql',
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/tmp/sockets/redis.sock',
    'port' => 0,
  ),
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'nextcloud.xxx.xxx',
  ),
  'datadirectory' => '/var/snap/nextcloud/common/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '22.2.3.0',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/tmp/sockets/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '',
  'installed' => true,
  'instanceid' => 'xx',
  'overwritehost' => 'nextcloud.xxx.xxx',
  'theme' => '',
  'loglevel' => 0,
  'maintenance' => false,
  'csrf.optout' => 
  array (
    0 => '/KeeWeb\\/\\d+\\.\\d+\\.\\d+/',
    1 => '/^WebDAVFS/',
    2 => '/^Microsoft-WebDAV-MiniRedir/',
    3 => '/^okhttp\\/\\d+\\.\\d+\\.\\d+/',
  ),
  'mail_from_address' => 'system',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'xxx',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'xxx',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'xxx',
  'mail_smtppassword' => 'xxx',
  'mail_smtpsecure' => 'ssl',
  'app_install_overwrite' => 
  array (
    0 => 'sharerenamer',
  ),
  'overwriteprotocol' => 'https',
  'mail_smtpauthtype' => 'LOGIN',
);
1 Like

I am experiencing the same error using Nextcloud 23.0.0. More specifically when I try a command as such:

php occ files:scan

My issue is related to the groupfolders app which is on version: 11.1.1

It’s a known issue with in the groupfolders app. Should be fixed with the next update of the app…

https://github.com/nextcloud/groupfolders/issues/1854

Stupid question: can users disable/update the goupfolder app via the web interface? With the occ command it was not and I had to edit the ACL.php file.