An unhandled exception has been thrown, internal server 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 (eg, 20.0.5): 21.0.1.1 / 21.0.3.1
Operating system and version (eg, Ubuntu 20.04): docker compose / debian
Apache or nginx version (eg, Apache 2.4.25): 2.4.38
PHP version (eg, 7.4): 7.4.21

The issue you are facing:

An unhandled exception has been thrown:,
ParseError: syntax error, unexpected ''' (T_ENCAPSED_AND_WHITESPACE), expecting ')' in /var/www/html/config/config.php:21

Tried to recreate the docker container, thats when it showed this error in the log.
Before that it only show the error in my browser when I try to log in.
I can’t see to find anything wrong with my config.php file, how can I troubleshoot this issue?

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

Steps to replicate it:

Not quite sure.

The output of your Nextcloud log in Admin > Logging:


An unhandled exception has been thrown:,
ParseError: syntax error, unexpected ''' (T_ENCAPSED_AND_WHITESPACE), expecting ')' in /var/www/html/config/config.php:21,Initializing nextcloud 21.0.3.1 ...,
Upgrading nextcloud from 21.0.1.1 ...,
Initializing finished,
Stack trace:,
#0 /var/www/html/lib/private/Config.php(68): OC\Config->readData(),
#1 /var/www/html/lib/base.php(149): OC\Config->__construct('/var/www/html/c...'),
#2 /var/www/html/lib/base.php(569): OC::initPaths(),
#3 /var/www/html/lib/base.php(1076): OC::init(),
#4 /var/www/html/console.php(49): require_once('/var/www/html/l...'),
#5 /var/www/html/occ(11): require_once('/var/www/html/c...'),
#6 {main}�AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.3. Set the 'ServerName' directive globally to suppress this message

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'instanceid' => '***',
  'passwordsalt' => '***',
  'secret' => '***',
  'trusted_domains' =>
  array (
          0 => '192.168.1.11:8080',
          1 => '***',
          2 => '***',

  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '21.0.1.1',
  'overwrite.cli.url' => '***',
  'overwriteprotocol' => 'https',
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '***',
  'installed' => true,
  'theme' => '',
  'loglevel' => 2,
  'maintenance' => false,
);

docker-compose.yaml

version: '2'

volumes:
  nextcloud:
  db:

services:
  db:
    image: mariadb
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=***
      - MYSQL_PASSWORD=***
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    image: nextcloud
    restart: always
    ports:
      - 8080:80
    links:
      - db
    volumes:
      - /mnt/storage/nextcloudData:/var/www/html
    environment:
      - MYSQL_PASSWORD=***
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db

The error you are getting is very specific. It says that there is an extra single-quote on line 21 of config.php.

What you are showing on line 21 is 'passwordsalt' => '***',
*** You have hand edited this line, therefore we can’t see the extra single-quote that you have in it.

Thank you for your reply!
Yeah I also thought there were something wrong with the password, but this setup has been running for over 2 months and now it suddenly stopped. Only thing happened was a reboot.

The password contains only alphanumerical signs and a + sign.