Error message "The database is missing some indexes..." won't go away

Nextcloud version: 29.0.4.1, freshly updated
Operating system and version : webhosting
Apache or nginx version: Apache, not sure about the version
PHP version: 8.3.8

The issue you are facing:
After the update I usually run the occ db:add-missing-indices comand in the plesk panel as cron job. This has always worked. This time the job executes withour errors as well, but the error message on the admin page in my nextcloud instance still stays there.

the code I tried to fix the database:

cloud.domain.de/cron.php -- 'php' '-d' 'memory_limit=512M' 'occ db:add-missing-indices'
cloud.domain.de/cron.php -- 'php' '-d' 'memory_limit=512M' 'db:add-missing-indices'

Is this the first time you’ve seen this error?
YES

The output of your Nextcloud log in Admin > Logging:

no error message in the log.

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

<?php
$CONFIG = array (
  'instanceid' => '##########',
  'passwordsalt' => '#######',
  'secret' => '#######',
  'trusted_domains' => 
  array (
    0 => 'cloud.domain.de',
  ),
  'datadirectory' => '/var/www/vhosts/hosting000000.######.netcup.net/cloud.domain.de/data',
  'dbtype' => 'mysql',
  'version' => '29.0.4.1',
  'overwrite.cli.url' => 'https://cloud.domain.de',
  'dbname' => '#####',
  'dbhost' => '##.##.###.###:####',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '#######',
  'dbpassword' => '###########',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => '######',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpport' => '465',
  'mail_smtpsecure' => 'ssl',
  'mail_from_address' => '#####',
  'mail_domain' => 'domain.de',
  'defaultapp' => '',
  'default_locale' => 'de_DE',
  'default_phone_region' => 'DE',
  'maintenance' => false,
  'trashbin_retention_obligation' => 'auto, 40',
  'maintenance_window_start' => 1,
  'theme' => '',
  'loglevel' => 2,
);

I don’t know the Plesk panel, but I think the general issue is, that the command are incorrectly used.

The first command doesn’t contain any pathes to the PHP command, nor to the occ command. You should try to use absolute pathes here.

The second command couldn’t work at all because you’re not executing the occ command.

1 Like

thanks j-ed for this idea.
let me show you the interface in the plesk panel:

as far as I understand it, the path to the cron.php is defined by the “script path” field. and the path for php by the “use php version” dropdown box.

agree about the second path, as I am super lost here i just tried it anyway.

Meanwhile I found a workaround:

using ssh to connect to my webhosting service I navigated to the directory of my installation and ran:

bash-5.0$ php occ db:add-missing-indices
The current PHP memory limit is below the recommended value of 512MB.
Adding additional dav_shares_resourceid_type index to the oc_dav_shares table, this can take some time...
oc_dav_shares table updated successfully.
Adding additional dav_shares_resourceid_access index to the oc_dav_shares table, this can take some time...
oc_dav_shares table updated successfully.

noting:
I have edited my config.php like some other described in the forum to solve an issue about invalid data directory:

Your data directory is invalid.
Ensure there is a file called ".ocdata" in the root of the data directory.

Cannot create "data" directory.
This can usually be fixed by giving the web server write access to the root directory. See https://docs.nextcloud.com/server/29/go.php?to=admin-dir_permissions

I changed the config like this:
'datadirectory' => ((php_sapi_name() != 'cli') ? '/var/www/vhosts/hosting000000.xxxxx.domain.net' : '').'/cloud.domain.de/data',

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.