# Internal Server Error - I think database related

**URL:** <https://help.nextcloud.com/t/internal-server-error-i-think-database-related/218265>\
**Category:** ℹ️ Support\
**Tags:** update\_problems, nc30, wopi, setup\_warning, php81\
**Created:** [February 24, 2025, 3:21pm UTC](https://help.nextcloud.com/t/internal-server-error-i-think-database-related/218265 "2025-02-24T15:21:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevenrushing](https://help.nextcloud.com/letter_avatar/stevenrushing/32/6_22734026db12803ebb3e059622ac3534.png) [@stevenrushing](https://help.nextcloud.com/u/stevenrushing)\
**Post date:** [February 24, 2025, 3:21pm UTC](https://help.nextcloud.com/t/internal-server-error-i-think-database-related/218265/1 "2025-02-24T15:21:50Z")

</div>

## The Basics

- Nextcloud Server version _(e.g., 29.x.x)_:
  - **30.0.6.2**

- Operating system and version _(e.g., Ubuntu 24.04)_:
  - **24.04.2 LTS**

- Web server and version _(e.g, Apache 2.4.25)_:
  - **Apache/2.4.58 (Ubuntu)**

- Reverse proxy and version \_(e.g. nginx 1.27.2)
  - `replace me` - I wasn’t sure what this was. I google around and don’t believe I use one, but I could be wrong.

- PHP version _(e.g, 8.3)_:
  - **PHP 8.1.31 (cli)**

- Is this the first time you’ve seen this error? (Yes / No):
  - **Yes**

- When did this problem seem to first start?
  - **After doing some updates and working to clear some errors**

- Installation method _(e.g. AlO, NCP, Bare Metal/Archive, etc.)_
  - **bare metal, I believe**

- Are you using CloudfIare, mod\_security, or similar? _(Yes / No)_
  - **No**

### Summary of the issue you are facing:

Nextcloud installation is nonresponsive. I get an internal server error. You can see it at [https://stevenrushing.com/cloud](https://stevenrushing.com/cloud).

Here are some of the things I did leading up to the error:

Did a PHP update from 7.4 to 8.1. Did a Nextcloud update via GUI from 25 to 30. Did an OS upgrade from 20.04 to 24.04. Tested everything and everything appeared to be working at this point.

I noticed after all this work that I was unable to update my account profile location, email, date of birth, etc. I looked at the database on that account and compared it to a brand new account and it was very different. I ended up manually altering the database and it allowed me to change things in the gui going forward. This was the command I ran:

```UPDATE
SET data = '{
    "displayname": {"value":"Steven Rushing","scope":"v2-federated","verified":"0"},
    "address": {"value":"Your-New-Address","scope":"v2-local","verified":"0"},
    "website": {"value":"https://stevenrushing.com","scope":"v2-local","verified":"0"},
    "email": {"value":"steven@stevenrushing.com","scope":"v2-federated","verified":"0"},
    "avatar": {"value":"","scope":"v2-federated","verified":"0"},
    "phone": {"value":"+14323121432","scope":"v2-local","verified":"0"},
    "twitter": {"value":"","scope":"v2-local","verified":"0"},
    "fediverse": {"value":"","scope":"v2-local","verified":"0"},
    "organisation": {"value":"","scope":"v2-local","verified":"0"},
    "role": {"value":"","scope":"v2-local","verified":"0"},
    "headline": {"value":"","scope":"v2-local","verified":"0"},
    "biography": {"value":"","scope":"v2-local","verified":"0"},
    "birthdate": {"value":"1981-11-05T00:00:00.000Z","scope":"v2-local","verified":"0"},
    "profile_enabled": {"value":"1","scope":"v2-local","verified":"0"}
}' 
WHERE uid = 'stevenrushing';

```

This appeared to me to work, but I’m thinking it might be related to what is going on. I don’t know.

I then started working through some of the errors on the main page.

For the ocm provider error I did this:

```sudo
and changed
      AllowOverride All
    Require all granted

```

In the directory brackets. Then:

```auto
sudo nano /etc/apache2/sites-available/nextcloud.conf

```

and in mod rewrite

```auto
 RewriteEngine on
RewriteRule ^/ocm-provider /index.php [QSA,L]

```

And that cleared that error. The next error was no maintenance window so I set a maintenance window and that worked, made that error go away.

I then got mimetype errors and to clear that I ran:

```auto
sudo -u www-data php /var/stevenrushing.com/cloud/occ maintenance:repair --include-expensive

```

Then this error:

> Some app directories are owned by a different user than the web server one. This may be the case if apps have been installed manually. Check the permissions of the following app directories: /var/www/stevenrushing.com/cloud/apps/epubreader /var/www/stevenrushing.com/cloud/apps/wopi

And to fix that I did:

```auto
ls -l /var/www/stevenrushing.com/cloud/apps/ | grep 'epubreader\|wopi'
sudo chown -R www-data:www-data /var/www/stevenrushing.com/cloud/apps/epubreader
sudo chown -R www-data:www-data /var/www/stevenrushing.com/cloud/apps/wopi
sudo find /var/www/stevenrushing.com/cloud/apps/epubreader -type d -exec chmod 755 {} \;
sudo find /var/www/stevenrushing.com/cloud/apps/epubreader -type f -exec chmod 644 {} \;
sudo find /var/www/stevenrushing.com/cloud/apps/wopi -type d -exec chmod 755 {} \;
sudo find /var/www/stevenrushing.com/cloud/apps/wopi -type f -exec chmod 644 {} \;

```

Up to this point everything looked like it was working appropriately. I can’t swear I tested everything, but I was regularly refreshing the page with the errors and it kept coming up without the errors, so I figured they were fixed.

This is the next error, the last one before everything broke:

> The PHP OPcache module is not properly configured. The OPcache interned strings buffer is nearly full. To assure that repeating strings can be effectively cached, it is recommended to apply “opcache.interned\_strings\_buffer” to your PHP configuration with a value higher than “8”.. For more details see the documentation ↗.

Documentation said that this was fixed in Apache’s php.ini file. I updated the appropriate line and verified it was updated.

```auto
steven@stevenrushing:~$ php -i | grep opcache.interned_strings_buffer
opcache.interned_strings_buffer => 32 => 32

```

But it wasn’t updating on the page showing all the errors. The error wouldn’t go away. So I ran:

```auto
sudo systemctl restart apache2
sudo systemctl restart php8.1-fpm
php -r 'opcache_reset();' **# this might be my problem right here**
sudo -u www-data php /var/www/stevenrushing.com/cloud/occ maintenance:repair
sudo -u www-data php /var/www/stevenrushing.com/cloud/occ maintenance:mode --off
sudo -u www-data php /var/www/stevenrushing.com/cloud/occ config:system:set opcache.interned_strings_buffer --value="32"

```

I never recovered from here. I did all kinds of stuff, enough that I don’t remember it all and didn’t document as well as normal because I was panicking. So much.

### Steps to replicate it (hint: details matter!):

I can’t really replicate it, it just is at this point. Go to [stevenrushing.com/cloud](http://stevenrushing.com/cloud) and you will see it.

### Log entries

[nextcloud.log - Pastebin.com](https://pastebin.com/vn17zJt7) - nextcloud.log

#### Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the _Copy raw_ option from _Administration settings-\>Logging_ screen or from your `nextcloud.log` located in your data directory). Feel free to use a pastebin/gist service if necessary.

```auto
https://pastebin.com/hzYsd7kA - apache log

```

#### Web Browser

If the problem is related to the Web interface, open your browser inspector _Console_ and _Network_ tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

```auto
PASTE

```

#### Web server / Reverse Proxy

The output of your Apache/nginx/system log in `/var/log/ ____ `:

```auto
PASTE HERE

```

### Configuration

#### Nextcloud

The output of `occ config:list system` or similar is best, but, if not possible, the contents of your `config.php` file from `/path/to/nextcloud` is fine (make sure to remove any identifiable information!):

```auto
<?php
$CONFIG = array (
  'instanceid' => 'ocjgpb3yndyb',
  'passwordsalt' => '/yFnh4kcoo2HB8Qgu77NLXhcu3pZXX',
  'secret' => 'LKuO1b9NUi75YFdzSafrxQIw/I/u28LoA0VcbyeX24dSXpv3',
  'trusted_domains' => 
  array (
    0 => 'stevenrushing.com',
    2 => 'www.stevenrushing.com',
  ),
  'datadirectory' => '/media/nextcloud',
  'dbtype' => 'mysql',
  'version' => '30.0.6.2',
  'overwrite.cli.url' => 'https://stevenrushing.com/cloud',
  'dbname' => 'nextcloud',
  'dbhost' => '127.0.0.1',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => [redacted],
  'installed' => true,
  'maintenance' => false,
  'updater.release.channel' => 'stable',
  'theme' => '',
  'loglevel' => 2,
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'admin',
  'mail_domain' => 'worshipinaviano.com',
  'mail_smtpauth' => 1,
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpport' => '587',
  'mail_smtphost' => 'smtp.dreamhost.com',
  'mail_smtpname' => 'admin@worshipinaviano.com',
  'mail_smtppassword' => [redacted],
  'maintenance_window_start' => '3',

```

---

<div class="post-metadata">

**Author:** ![stevenrushing](https://help.nextcloud.com/letter_avatar/stevenrushing/32/6_22734026db12803ebb3e059622ac3534.png) [@stevenrushing](https://help.nextcloud.com/u/stevenrushing)\
**Post date:** [February 26, 2025, 7:44am UTC](https://help.nextcloud.com/t/internal-server-error-i-think-database-related/218265/2 "2025-02-26T07:44:27Z")

</div>

At this point I don’t know if this will get a response, but wanted to leave a comment so that folk know that I am still watching the topic.

Alternatively to trying to fix this issue, I am open to a fresh install. I’m thinking it might be required at this point.

---

<div class="post-metadata">

**Author:** ![jtr](https://help.nextcloud.com/letter_avatar/jtr/32/6_22734026db12803ebb3e059622ac3534.png) [@jtr](https://help.nextcloud.com/u/jtr)\
**Post date:** [February 26, 2025, 2:00pm UTC](https://help.nextcloud.com/t/internal-server-error-i-think-database-related/218265/3 "2025-02-26T14:00:13Z")

</div>

The “No such file or directory” from DBAL suggests a problem connecting via the PHP database driver.

Check:

- MySQL / MariaDB service status
- Whether you have the appropriate PHP modules installed (when you upgrade PHP versions you have to typically re-install modules) [docs](https://docs.nextcloud.com/server/stable/admin_manual/installation/php_configuration.html)

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [May 27, 2025, 2:00pm UTC](https://help.nextcloud.com/t/internal-server-error-i-think-database-related/218265/4 "2025-05-27T14:00:53Z")

</div>

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