Internal Server Error and mariadb error

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 : 18.0.6.0
Operating system and version : fedora 31
nginx version : 1.18.0
PHP version : 7.4.9

The issue you are facing:
I run into a “Internal Server Error” after changing a dying disk (I don’t know if related, I also made an upgrade of php and nginx in the meantime):

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

I found interesting messages in journal (the message is very long, so stripped here), basically saying no such table: oc_filecache_extended :

{"reqId":"kILOZSNgAsiHdmUNDoOe","level":3,"time":"2020-09-08T20:45:18+00:00","remoteAddr":"192.168.1.1","user":"--","app":"core","method":"GET","url":"/nextcloud/","message":"{\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\TableNotFoundException\",\"Message\":\"An exception occurred while executing 'SELECT \\\"filecache\\\".\\\"fileid\\\", \\\"storage\\\", \\\"path\\\", \\\"path_hash\\\", \\\"filecache\\\".\\\"parent\\\", \\\"name\\\", \\\"mimetype\\\", \\\"mimepart\\\", \\\"size\\\", \\\"mtime\\\", \\\"storage_mtime\\\", \\\"encrypted\\\", \\\"etag\\\", \\\"permissions\\\", \\\"checksum\\\", \\\"metadata_etag\\\", \\\"creation_time\\\", \\\"upload_time\\\" FROM \\\"oc_filecache\\\" \\\"filecache\\\" LEFT JOIN \\\"oc_filecache_extended\\\" \\\"fe\\\" ON \\\"filecache\\\".\\\"fileid\\\" = \\\"fe\\\".\\\"fileid\\\" WHERE (\\\"storage\\\" = ?) AND (\\\"path_hash\\\" = ?)' with params [2, \\\"97bd098728fd4dfb839d43a743b64ea6\\\"]:\\n\\nSQLSTATE[HY000]: General error: 1 no such table: oc_filecache_extended\",\"Code\":0,\"Trace\":[{\"file\":\"/usr/share/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php\",\"line\":169,\"function\":\"convertException\",\"class\":\"Doctrine\\\\DBAL\\\\Driver\\\\AbstractSQLiteDriver\",\"type\":\"->\",\"args\":[\"An exception occurred while executing 'SELECT \\\"filecache\\\".\\\"fileid\\\", \\\"storage\\\", \\\"path\\\", \\\"path_hash\\\", \\\"filecache\\\".\\\"parent\\\", \\\"name\\\", \\\"mimetype\\\", \\\"mimepart\\\", \\\"size\\\", \\\"mtime\\\", \\\"storage_mtime\\\", \\\"encrypted\\\", \\\"etag\\\", \\\"permissions\\\", \\\"checksum\\\", \\\"metadata_etag\\\", \\\"creation_time\\\", \\\"upload_time\\\" FROM \\\"oc_filecache\\\" \\\"filecache\\\" LEFT JOIN \\\"oc_filecache_extended\\\" \\\"fe\\\" ON \\\"filecache\\\".\\\"fileid\\\" = \\\"fe\\\".\\\"fileid\\\" WHERE (\\\"storage\\\" = ?) AND (\\\"path_hash\\\" = ?)' with params [2, \\\"97bd098728fd4dfb839d43a743b64ea6\\\"]:\\n\\nSQLSTATE[HY000]: General error: 1 no such table: oc_filecache_extended\",{\"errorInfo\":[\"HY000\",1,\"no such table: oc_filecache_extended\"],\

However I can connect to mariadb and I see that the table exists:

SELECT * from oc_filecache_extended;
+--------+---------------+---------------+-------------+
| fileid | metadata_etag | creation_time | upload_time |
+--------+---------------+---------------+-------------+
|  38392 | NULL          |             0 |  1587548427 |
|  38393 | NULL          |             0 |  1587548431 |
...

I am stuck at this point.

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

The output of your config.php file :

<?php
$CONFIG = array (
  'passwordsalt' => 'xxxx',
  'secret' => 'xxxx',
  'trusted_domains' => 
  array (
    0 => 'btrfly',
    1 => 'btrfly.home',
    2 => 'xxxx',
    3 => 'xxxx',
  ),
  'datadirectory' => '/mnt/DATA/owncloud/data/',
  'overwrite.cli.url' => 'http://localhost',
  'dbtype' => 'mysql',
  'version' => '18.0.6.0',
  'dbname' => 'nextclouddb',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'xxxx',
  'installed' => true,
  'instanceid' => 'oc87vymmg7yp',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'mail_domain' => 'xxxx',
  'mail_from_address' => 'hugo',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtphost' => 'xxxx',
  'mail_smtpport' => '465',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'xxxx',
  'mail_smtppassword' => 'xxxx',
  'app_install_overwrite' => 
  array (
    0 => 'contacts',
  ),
);

After checking more logs, I found selinux denials for php-fpm.

type=AVC msg=audit(1599681704.416:378): avc:  denied  { lock } for  pid=1271 comm="php-fpm" path="/mnt/DATA/owncloud/data/owncloud.db" dev="sda1" ino=33948180 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:unlabeled_t:s0 tclass=file permissive=1

Actually my issue is still valid. I disabled selinux, and even though I do not see any AVC denial, I still get the nextcloud errors no such table: oc_filecache_extended

I am stuck at this point, do not see any other relevant logs (nextcloud.log is empty)

I finally found an error in the nginx not pointing to the right root directory. So the whole topic is irrelevant.

1 Like