Internal Server Error after editing config.php

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: 1.53.0

The issue you are facing:
At first i wanted to fix the following error: In the Web-Interface the nextcloud shows an error that the default_phone_region is not set. To do this I used putty and connected to the NextcloudPi via ssh. Then I just wanted to edit the config.php file (as recommended to fix the time-region-error). So I added in the last line at the bottom: ‘default_phone_region’ => ‘DE’. Then I pressed ^X and the terminal asks wheater it should “save modified buffer”. Then I pressed “Y” for Yes and again for saving the file.

After I did that the nextcloud was down. I really don’t know what kind of down - and here we come to my question or better my problem. When I tried to visit the Nextcloud-Interface via the browser, it shows the following message:


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 webserver log.


Then I thought that the change i made must cause something going wrong and as I stayed in putty I just edited the file a second time and removed what I had added before. I was hoping that the error might disappear, but it did not.

I already thaught that maybe the config.php got demaged, but in my eyes all is ok. So i can’t explain to myself what the reasin for the error-message could be.

When I navigate to the panel with the browser (IP:4443) the systeminfo is endless just loading but nothing appears.

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

The output of your Nextcloud log in Admin > Logging:

{"reqId":"HcdNQ8osmOJYZl2wS1fk","level":1,"time":"2023-11-16T06:27:18+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::updateEnd: Update successful","userAgent":"--","version":"27.0.1.2>
{"reqId":"HcdNQ8osmOJYZl2wS1fk","level":1,"time":"2023-11-16T06:27:18+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::maintenanceDisabled: Turned off maintenance mode","userAgent":"--">
{"reqId":"HcdNQ8osmOJYZl2wS1fk","level":1,"time":"2023-11-16T06:27:18+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::resetLogLevel: Reset log level to Warning(2)","userAgent":"--","ve>
{"reqId":"ZVZ1EDvQBGs0I-6d-LHYQgAAAMk","level":3,"time":"2023-11-16T20:01:20+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"PHP","method":"POST","url":"/remote.php/dav/bulk","message":"file_put_contents(/media/myCloudDrive/>
{"reqId":"ZVZ1EDvQBGs0I-6d-LHYQgAAAMk","level":3,"time":"2023-11-16T20:01:20+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"no app in context","method":"POST","url":"/remote.php/dav/bulk","message":"Could not create path \">
{"reqId":"ZVZ1EDvQBGs0I-6d-LHYQgAAAMk","level":3,"time":"2023-11-16T20:01:20+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"PHP","method":"POST","url":"/remote.php/dav/bulk","message":"file_put_contents(/media/myCloudDrive/>
{"reqId":"ZVZ1EDvQBGs0I-6d-LHYQgAAAMk","level":3,"time":"2023-11-16T20:01:20+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"no app in context","method":"POST","url":"/remote.php/dav/bulk","message":"Could not create path \">
{"reqId":"ZVZ1EDvQBGs0I-6d-LHYQgAAAMk","level":3,"time":"2023-11-16T20:01:20+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"PHP","method":"POST","url":"/remote.php/dav/bulk","message":"file_put_contents(/media/myCloudDrive/>
{"reqId":"ZVZ1EDvQBGs0I-6d-LHYQgAAAMk","level":3,"time":"2023-11-16T20:01:20+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"no app in context","method":"POST","url":"/remote.php/dav/bulk","message":"Could not create path \">
{"reqId":"ZVZ1EDvQBGs0I-6d-LHYQgAAAMk","level":3,"time":"2023-11-16T20:01:20+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"PHP","method":"POST","url":"/remote.php/dav/bulk","message":"file_put_contents(/media/myCloudDrive/>
{"reqId":"ZVZ1EDvQBGs0I-6d-LHYQgAAAMk","level":3,"time":"2023-11-16T20:01:20+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"no app in context","method":"POST","url":"/remote.php/dav/bulk","message":"Could not create path \">
{"reqId":"ZVZ1EDvQBGs0I-6d-LHYQgAAAMk","level":3,"time":"2023-11-16T20:01:20+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"PHP","method":"POST","url":"/remote.php/dav/bulk","message":"file_put_contents(/media/myCloudDrive/>
{"reqId":"ZVZ1EDvQBGs0I-6d-LHYQgAAAMk","level":3,"time":"2023-11-16T20:01:20+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"no app in context","method":"POST","url":"/remote.php/dav/bulk","message":"Could not create path \">
{"reqId":"ZVZ1EDvQBGs0I-6d-LHYQgAAAMk","level":3,"time":"2023-11-16T20:01:20+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"PHP","method":"POST","url":"/remote.php/dav/bulk","message":"file_put_contents(/media/myCloudDrive/>
{"reqId":"ZVZ1EDvQBGs0I-6d-LHYQgAAAMk","level":3,"time":"2023-11-16T20:01:20+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"no app in context","method":"POST","url":"/remote.php/dav/bulk","message":"Could not create path \">
{"reqId":"ZVZ1EDvQBGs0I-6d-LHYQgAAAMk","level":3,"time":"2023-11-16T20:01:20+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"PHP","method":"POST","url":"/remote.php/dav/bulk","message":"file_put_contents(/media/myCloudDrive/>
{"reqId":"ZVZ1EDvQBGs0I-6d-LHYQgAAAMk","level":3,"time":"2023-11-16T20:01:20+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"no app in context","method":"POST","url":"/remote.php/dav/bulk","message":"Could not create path \">
{"reqId":"ZVZ1EDvQBGs0I-6d-LHYQgAAAMk","level":3,"time":"2023-11-16T20:01:20+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"PHP","method":"POST","url":"/remote.php/dav/bulk","message":"file_put_contents(/media/myCloudDrive/>
{"reqId":"ZVZ1EDvQBGs0I-6d-LHYQgAAAMk","level":3,"time":"2023-11-16T20:01:20+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"no app in context","method":"POST","url":"/remote.php/dav/bulk","message":"Could not create path \">
{"reqId":"ZVniNDBA_LDUHw6L8dMA-AAAAEA","level":3,"time":"2023-11-19T10:23:48+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"PHP","method":"POST","url":"/remote.php/dav/bulk","message":"file_put_contents(/media/myCloudDrive/>
{"reqId":"ZVniNDBA_LDUHw6L8dMA-AAAAEA","level":3,"time":"2023-11-19T10:23:48+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"no app in context","method":"POST","url":"/remote.php/dav/bulk","message":"Could not create path \">
{"reqId":"ZVniNDBA_LDUHw6L8dMA-AAAAEA","level":3,"time":"2023-11-19T10:23:48+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"PHP","method":"POST","url":"/remote.php/dav/bulk","message":"file_put_contents(/media/myCloudDrive/>
{"reqId":"ZVniNDBA_LDUHw6L8dMA-AAAAEA","level":3,"time":"2023-11-19T10:23:48+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"no app in context","method":"POST","url":"/remote.php/dav/bulk","message":"Could not create path \">
{"reqId":"ZVniNDBA_LDUHw6L8dMA-AAAAEA","level":3,"time":"2023-11-19T10:23:48+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"PHP","method":"POST","url":"/remote.php/dav/bulk","message":"file_put_contents(/media/myCloudDrive/>
{"reqId":"ZVniNDBA_LDUHw6L8dMA-AAAAEA","level":3,"time":"2023-11-19T10:23:48+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"no app in context","method":"POST","url":"/remote.php/dav/bulk","message":"Could not create path \">
{"reqId":"ZVniNDBA_LDUHw6L8dMA-AAAAEA","level":3,"time":"2023-11-19T10:23:48+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"PHP","method":"POST","url":"/remote.php/dav/bulk","message":"file_put_contents(/media/myCloudDrive/>
{"reqId":"ZVniNDBA_LDUHw6L8dMA-AAAAEA","level":3,"time":"2023-11-19T10:23:48+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"no app in context","method":"POST","url":"/remote.php/dav/bulk","message":"Could not create path \">
{"reqId":"ZVniNDBA_LDUHw6L8dMA-AAAAEA","level":3,"time":"2023-11-19T10:23:48+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"PHP","method":"POST","url":"/remote.php/dav/bulk","message":"file_put_contents(/media/myCloudDrive/>
{"reqId":"ZVniNDBA_LDUHw6L8dMA-AAAAEA","level":3,"time":"2023-11-19T10:23:48+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"no app in context","method":"POST","url":"/remote.php/dav/bulk","message":"Could not create path \">
{"reqId":"ZVniNDBA_LDUHw6L8dMA-AAAAEA","level":3,"time":"2023-11-19T10:23:48+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"PHP","method":"POST","url":"/remote.php/dav/bulk","message":"file_put_contents(/media/myCloudDrive/>
{"reqId":"ZVniNDBA_LDUHw6L8dMA-AAAAEA","level":3,"time":"2023-11-19T10:23:48+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"no app in context","method":"POST","url":"/remote.php/dav/bulk","message":"Could not create path \">
{"reqId":"ZVniNDBA_LDUHw6L8dMA-AAAAEA","level":3,"time":"2023-11-19T10:23:48+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"PHP","method":"POST","url":"/remote.php/dav/bulk","message":"file_put_contents(/media/myCloudDrive/>
{"reqId":"ZVniNDBA_LDUHw6L8dMA-AAAAEA","level":3,"time":"2023-11-19T10:23:48+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"no app in context","method":"POST","url":"/remote.php/dav/bulk","message":"Could not create path \">
{"reqId":"ZVniNDBA_LDUHw6L8dMA-AAAAEA","level":3,"time":"2023-11-19T10:23:48+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"PHP","method":"POST","url":"/remote.php/dav/bulk","message":"file_put_contents(/media/myCloudDrive/>
{"reqId":"ZVniNDBA_LDUHw6L8dMA-AAAAEA","level":3,"time":"2023-11-19T10:23:48+00:00","remoteAddr":"176.199.54.116","user":"Markus","app":"no app in context","method":"POST","url":"/remote.php/dav/bulk","message":"Could not create path \">


The Output of my config.php file:

     <?php
$CONFIG = array (
  'passwordsalt' => 'censored (by ernolf)',
  'secret' => 'censored (by ernolf)',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    7 => 'nextcloudpi',
    5 => 'nextcloudpi.local',
    8 => 'nextcloudpi.lan',
    3 => '***Censored*** by myself',
    11 => '2a02:908:2542:fbc0:68fd:74b0:f39f:3227',
    1 => '192.168.178.35',
    14 => 'nextcloudpi',
    2 => '***Censored*** by myself',
  ),
  'datadirectory' => '/media/myCloudDrive/ncdata/data',
  'dbtype' => 'mysql',
  'version' => '27.0.1.2',
  'overwrite.cli.url' => '***Censored*** by myself',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ncadmin',
  'dbpassword' => '***Censored*** by myself',
  'installed' => true,
  'instanceid' => 'ocgejiz3g7nb',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => '***Censored*** by myself',
  ),
  'tempdirectory' => '/media/myCloudDrive/ncdata/data/tmp',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => '***Censored*** by myself',
  'mail_domain' => '***Censored*** by myself',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'overwriteprotocol' => 'https',
  'maintenance' => false,
  'logfile' => '/media/myCloudDrive/ncdata/data/nextcloud.log',
  'trusted_proxies' =>
  array (
    11 => '127.0.0.1',
    12 => '::1',
    13 => '***Censored*** by myself',
    14 => '192.168.178.35',
  ),
  'loglevel' => '2',
  'log_type' => 'file',
  'mail_sendmailmode' => 'smtp',
  'mail_smtphost' => '***Censored*** by myself',
  'mail_smtpport' => '587',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '***Censored*** by myself',
  'mail_smtppassword' => '***Censored*** by myself',
  'theme' => '',
);
<?php
$CONFIG = array (
  'passwordsalt' => '***Censored*** by myself',
  'secret' => '/***Censored*** by myself',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    7 => 'nextcloudpi',
    5 => 'nextcloudpi.local',
    8 => 'nextcloudpi.lan',
    3 => '***Censored*** by myself',
    11 => '2a02:908:2542:fbc0:68fd:74b0:f39f:3227',
    1 => '192.168.178.35',
    14 => 'nextcloudpi',
    2 => '***Censored*** by myself',
  ),
  'datadirectory' => '/media/myCloudDrive/ncdata/data',
  'dbtype' => 'mysql',
  'version' => '27.0.1.2',
  'overwrite.cli.url' => '***Censored*** by myself',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ncadmin',
  'dbpassword' => 'censored (by ernolf)',
  'installed' => true,
  'instanceid' => 'ocgejiz3g7nb',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => 'censored (by ernolf)',
  ),
  'tempdirectory' => '/media/myCloudDrive/ncdata/data/tmp',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => '***Censored*** by myself',
  'mail_domain' => '***Censored*** by myself',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'overwriteprotocol' => 'https',
  'maintenance' => false,
  'logfile' => '/media/myCloudDrive/ncdata/data/nextcloud.log',
  'trusted_proxies' =>
  array (
    11 => '127.0.0.1',
    12 => '::1',
    13 => '***Censored*** by myself',
    14 => '192.168.178.35',
  ),
  'loglevel' => '2',
  'log_type' => 'file',
  'mail_sendmailmode' => 'smtp',
  'mail_smtphost' => '***Censored*** by myself',
  'mail_smtpport' => '587',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '***Censored*** by myself',
  'mail_smtppassword' => '***Censored*** by myself',
  'theme' => '',
*********HERE I ADDED BEFORE ('default_phone_region' => 'DE')**********
);



There is a comma missing at the end of the line.

Thats true. But as I sad, I have removed the change a few moments later, so at the time my “modification” is not there and the config.php file should be the same as before I changed anything. Do you understand what I mean?

please edit your post and remove all those highly sensitive secrets.
With those data, everybody gets the means to decrypt all your passwords!

How, with what editor did you edit your config.php?

Could you please post here the echoes of these two commands:

ls -l /path/to/nextcloud/config/config.php
file /path/to/nextcloud/config/config.php

That output could give me an answer to my suspicion.

Much luck,
ernolf

My echo: -rw-r----- 1 www-data www-data 3937 Nov 19 21:52 /var/www/nextcloud/config/config.php

The time is maybe this late, because i just turned the raspberry on a few moments ago, because i had turned off after I postet my problem here.

My echo: /var/www/nextcloud/config/config.php: ASCII text

I edited the config.php-file in putty. I used the nano command, made my change and saved it.

OK. My suspicion was not confirmed

(You still have your secrets world readable!)

Much luck,
ernolf

Ohhh i see. Thank you. But what was your suspicion?

either wrong owner / file rights or wrong (dos) file format :wink:

ernolf