Ubuntu docker Nextcloud AIO - Error: Undefined constant GuzzleHttp\ClientInterface::MAJOR_VERSION in /var/www/html/3rdparty/guzzlehttp/guzzle/src/Utils.php:113

I installed a few apps through the GUI and also tried to get pdlib installed so I could use the facial recognition app. Then nextcloud crashed and would not load.

Nextcloud container error.
Error: Undefined constant GuzzleHttp\ClientInterface::MAJOR_VERSION in /var/www/html/3rdparty/guzzlehttp/guzzle/src/Utils.php:113

I tried to comment out app_install_overwrite in the config.php so it would load, but no change. I then tried to use occ to list the apps and remove them. But I get a permission error as shown below. I tried a few things to fix the permission, but I am not having much luck.

root@ubuntu:/media/Data/docker/volumes/nextcloud_aio_nextcloud/_data# sudo -u www-data php occ app:list
PHP Warning: require_once(/media/Data/docker/volumes/nextcloud_aio_nextcloud/_data/console.php): Failed to open stream: Permission denied in /media/Data/docker/volumes/nextcloud_aio_nextcloud/_data/occ on line 11
PHP Fatal error: Uncaught Error: Failed opening required ‘/media/Data/docker/volumes/nextcloud_aio_nextcloud/_data/console.php’ (include_path=‘.:/usr/share/php’) in /media/Data/docker/volumes/nextcloud_aio_nextcloud/_data/occ:11
Stack trace:
#0 {main}
thrown in /media/Data/docker/volumes/nextcloud_aio_nextcloud/_data/occ on line 11

Here is my config.php

<?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' => 'nextcloud-aio-redis',
    'password' => '',
    'port' => 6379,
  ),
  'overwritehost' => '',
  'overwriteprotocol' => 'https',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '',
  ),
  'datadirectory' => '/mnt/ncdata',
  'dbtype' => 'pgsql',
  'version' => '24.0.7.1',
  'overwrite.cli.url' => '',
  'dbname' => 'nextcloud_database',
  'dbhost' => 'nextcloud-aio-database',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_nextcloud',
  'dbpassword' => '',
  'installed' => true,
  'instanceid' => '',
  'loglevel' => '2',
  'log_type' => 'file',
  'logfile' => '/var/www/html/data/nextcloud.log',
  'log_rotate_size' => '10485760',
  'log.condition' => 
  array (
    'apps' => 
    array (
      0 => 'admin_audit',
    ),
  ),
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'enabledPreviewProviders' => 
  array (
    1 => 'OC\\Preview\\Image',
    2 => 'OC\\Preview\\MarkDown',
    3 => 'OC\\Preview\\MP3',
    4 => 'OC\\Preview\\TXT',
    5 => 'OC\\Preview\\OpenDocument',
    6 => 'OC\\Preview\\Movie',
    0 => 'OC\\Preview\\Imaginary',
  ),
  'enable_previews' => true,
  'upgrade.disable-web' => true,
  'mail_smtpmode' => 'smtp',
  'trashbin_retention_obligation' => 'auto, 30',
  'versions_retention_obligation' => 'auto, 30',
  'activity_expire_days' => '30',
  'simpleSignUpLink.shown' => false,
  'share_folder' => '/Shared',
  'tempdirectory' => '/mnt/ncdata/tmp/',
  'one-click-instance' => true,
  'one-click-instance.user-limit' => 100,
  'htaccess.RewriteBase' => '/',
  'files_external_allow_create_new_local' => false,
  'trusted_proxies' => 
  array (
    0 => '127.0.0.1',
    1 => '::1',
  ),
  'allow_local_remote_servers' => true,
  'preview_imaginary_url' => 'http://nextcloud-aio-imaginary:9000',
#  'app_install_overwrite' => 
#  array (
#    0 => 'files_ebookreader',
#    1 => 'files_external_dropbox',
#    2 => 'files_external_gdrive',
#  ),
  'maintenance' => false,
  'one-click-instance.link' => 'https://nextcloud.com/all-in-one/',
);

Can you try to restore your instance from backup and check if that makes it work again?

I was afraid you would ask that. I started this install as a testing instance and had not made a backup. Yes, I know…

Here is the error I get when I try and change the permissions.

root@ubuntu:/media/Data/docker/volumes/nextcloud_aio_nextcloud/_data# sudo -u www-data find /media/Data/docker/volumes/nextcloud_aio_nextcloud/_data -type d -print0 | xargs -0 chmod 0755
find: ‘/media/Data/docker/volumes/nextcloud_aio_nextcloud/_data’: Permission denied
chmod: missing operand after ‘0755’
Try 'chmod --help' for more information.

root@ubuntu:/media/Data/docker/volumes/nextcloud_aio_nextcloud/_data# chmod -R 755 /media/Data/docker/volumes/nextcloud_aio_nextcloud/_data
root@ubuntu:/media/Data/docker/volumes/nextcloud_aio_nextcloud/_data# sudo chown -R www-data:www-data /media/Data/docker/volumes/nextcloud_aio_nextcloud/_data
root@ubuntu:/media/Data/docker/volumes/nextcloud_aio_nextcloud/_data# sudo chmod -R +w /media/Data/docker/volumes/nextcloud_aio_nextcloud/_data
root@ubuntu:/media/Data/docker/volumes/nextcloud_aio_nextcloud/_data# sudo -u www-data php occ app:list
PHP Warning:  require_once(/media/Data/docker/volumes/nextcloud_aio_nextcloud/_data/console.php): Failed to open stream: Permission denied in /media/Data/docker/volumes/nextcloud_aio_nextcloud/_data/occ on line 11
PHP Fatal error:  Uncaught Error: Failed opening required '/media/Data/docker/volumes/nextcloud_aio_nextcloud/_data/console.php' (include_path='.:/usr/share/php') in /media/Data/docker/volumes/nextcloud_aio_nextcloud/_data/occ:11
Stack trace:
#0 {main}
  thrown in /media/Data/docker/volumes/nextcloud_aio_nextcloud/_data/occ on line 11

If this is for testing then you can also simply start new. See GitHub - nextcloud/all-in-one: Nextcloud AIO stands for Nextcloud All In One and provides easy deployment and maintenance with most features included in this one Nextcloud instance.

That is true, but I feel like I should learn how to fix a permission issue like this. Just trying to learn how, because I think I am just doing it incorrectly.

I am not sure if it is really a permission issue and don’t want to bother with this.

Hopefully someone else can step in and help you with this. I whish you good luck!