Nextcloud Internal Server Error after adding overwrite parameters

First off thank you for your time whoever is able to help me.

To give a little background I installed Nextcloud using the TrueNAS plugin. It is all running on a static IP. I was able to access the login using the domain and port (ex. cloud.example.com:443). I went into the config.php file and added overwrite parameters. While tinkering with those all of the sudden I am getting the Internal Server Error page. I removed all of the overwrite parameters and cleared cache and cookies on my browser. I am still getting the internal server error. I have also looked at the log that is listed in my config.php file and from what I can tell all of the information is about a few failed login attempts by me.

I have also searched and searched for a solution and so for can’t find one.

Any help is greatly appreciated!
Thanks,

config.php

<?php
+$CONFIG = array (
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/usr/local/www/nextcloud/apps',
      'url' => '/apps',
      'writable' => true,
    ),
    1 =>
    array (
      'path' => '/usr/local/www/nextcloud/apps-pkg',
      'url' => '/apps-pkg',
      'writable' => true,
    ),
  ),
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'passwordsalt' => 'REDACTED',
  'secret' => 'REDACTED',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'static IP:80',
    2 => 'cloud.website.com:80',
    3 => 'static IP:443',
    4 => 'cloud.website.com:443',
    5 => 'cloud.website.com',
  ),
  'datadirectory' => '/usr/local/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '21.0.0.18',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'REDACTED',
  'dbpassword' => 'REDACTED',
  'installed' => true,
  'instanceid' => 'REDACTED',
  'overwriteprotocol' => "https",
  'overwrite.cli.url' => 'https://cloud.website.com:8443',
  'overwritehost' => 'cloud.website.com',
  'trusted_proxies' =>
  array (
     0 => '10.x.x.x:81', #LAN IP to Virtual Mechine
  ),
);

nextcloud.log
only logs of me login into nextcloud before the internal error

Edited config.php based on information from j-ed.

Hi @mkcompserve,
please post your config.php file here and your nextcloud log (don’t forget to remove sensitive values) . Otherwise no one will be able to help you!

I am having troubles copying the nextcloud.log file but I have shared the config.php with you let me know if there is anything else I can do.

Please make sure that the command syntax is correct:

  • The first line starts with an opening single quote but the closing quote can be found behind the parameter value instead of the parameter name.
  • The second line contains an url pointing to ‘localhost’, which in most cases wouldn’t allow to access the server over the lan.
  • The third line doesn’t end with a comma :wink:

Further information can be found in the adminstrator guide.

1 Like

Oh my how did I miss those commas and quotes! Thanks for noticing that unfortuantely I have made edits and the only change is now and I still get the internal error. Also, updated my config.php here so that you can see what has changed.

I think the undefined database port might cause a problem. I would recommend to use a socket path if your database server runs on the same server, like this:

'dbtype' => 'mysql',
'dbname' => 'nextcloud',
'dbhost' => 'localhost:/<full-path-to-mysql-socket>/mysql.sock',
'dbtableprefix' => 'nc_',

so in my nextcloud.conf file I have a block that has a line in it for the “upstream php-handler” that looks like this: unix:/var/run/php/php7.4-fpm.sock;

Is this what your are talking about?

Also, please forgive me I am very new to all of this.

No, I’m not speaking about the Nginx web server configuration file but the config.php file of Nextcloud. To get a better understanding of Nextcloud I would recommend to study the adminsitrator guide which explains all configuration options in detail :wink:

Thank you, I have been reviewing the guide, the problem I am running into with that is it doesn’t specify where I would locate the file of the mysql.sock. (I edited this because the comment was actually incorrect and is no longer need)

Figured out why I was getting the internal error… it was because of a typo in the config.php file at the top. I added on accident at one point or another a + next to $CONFIG.

1 Like