Host of NextCloud Errors

I’ve been running NextCloud on Scale for about a year now and have just discovered a host of errors. Anyone have any suggestions? I have done nothing to edit the installation of the app, which had none of these errors except for the Redis one that I will ignore. I have updated to

There are some warnings regarding your setup.

  • 7569 errors in the logs since April 17, 2024
  • Server has no maintenance window start time configured. This means resource intensive daily background jobs will also be executed during your main usage time. We recommend to set it to a time of low usage, so users are less impacted by the load caused from these heavy tasks. For more details see the documentation :arrow_upper_right:.
  • The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running “occ db:add-missing-indices” those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster. Missing optional index “fs_storage_path_prefix” in table “filecache”.
  • Could not check for JavaScript support. Please check manually if your webserver serves .mjs files using the JavaScript MIME type.
  • The database is used for transactional file locking. To enhance performance, please configure memcache, if available. For more details see the documentation :arrow_upper_right:.

These errors appear to include some from this thread: nextcloud app database errors on fresh install | TrueNAS Community

My logs show this error on repeat:

Exception
Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] connection to server at “nextcloud-postgres” (172.17.43.220), port 5432 failed: FATAL: remaining connection slots are reserved for non-replication superuser connections

My question is whether this is on the dashboard by TrueNAS to be fixed or if I should be poking around to fix these errors piecemeal.

Thanks,
Matt

I fixed this error:

  • The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running “occ db:add-missing-indices” those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster. Missing optional index “fs_storage_path_prefix” in table “filecache”.

I did so by following these instructions (How to run console OCC Nextcloud command in TrueNAS Scale | TrueNAS Community):

  • in the appliocations screen >
  • click on nextcloud >
  • under workloads: click on the “shell” button for the main nexcloud container (mine is Docker) >

window pops up

  • container = nextcloud
  • pods = nextcloud-#$#$#$#$#$#-$$$$ (#numbers’n’$characters) (not postgres- or nginx-)
  • commands = /bin/bash
  • “choose”

type

  • su
  • su -m www-data -c ‘php /var/www/html/occ db:add-missing-indices’

sudo is NOT installed so the su command must be used even after elevating to su (mentioned in this thread)​

the matters, do not use " (single quote vs double quote)​

Would be interested in getting feedback from anyone who has resolved these errors:

  • Server has no maintenance window start time configured. This means resource intensive daily background jobs will also be executed during your main usage time. We recommend to set it to a time of low usage, so users are less impacted by the load caused from these heavy tasks. For more details see the documentation :arrow_upper_right:.
  • Could not check for JavaScript support. Please check manually if your webserver serves .mjs files using the JavaScript MIME type.

New string of errors related to this new one:

  • Your data directory and files are probably accessible from the internet. The .htaccess file is not working. It is strongly recommended that you configure your web server so that the data directory is no longer accessible, or move the data directory outside the web server document root.

Listed here: Nextcloud - htaccess not working

Also, this is a new error with the upgrade to NextCloud 9 (TrueNAS NC 29):

  • The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running “occ db:add-missing-indices” those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster. Missing optional index “oc_npushhash_di” in table “notifications_pushhash”.