Great idea @skois, let me populate your template.
What problem you experience:
Access to Nextcloud using reverse-prox stopped working. I am getting the error message attached.
What error messages you get:
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.
When I do this I get this message.
Why trying to access Nextcloud using the internal or external address.
What steps did you make and what was the outcome:
1. I got the internal access working with the copy of /mnt/user/appdata/nextcloud/wwwn/extcloud/config/config.php that I took before configuring reverse proxy.
2. A ping to the external address of nextcloud is working.
My setup is as follows:
(Names included in repository names)
Docker Repositories:
linuxserver/nextcloud
linuxserver/swag
linuxserver/mariadb
Network:
NETWORK ID NAME DRIVER SCOPE
2399deb73d7d br0 macvlan local
a84faa728ce0 bridge bridge local
e77748455f75 host host local
196eb99381ce none null local
75f705533666 proxynet bridge local
That should be fine. All three dockers use the proxynet bridge network.
Docker Logs:
Nextcloud Log
-------------------------------------
GID/UID
-------------------------------------
User uid: 99
User gid: 100
-------------------------------------
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 40-config: executing...
[cont-init.d] 40-config: exited 0.
[cont-init.d] 50-install: executing...
[cont-init.d] 50-install: exited 0.
[cont-init.d] 60-memcache: executing...
[cont-init.d] 60-memcache: exited 0.
[cont-init.d] 70-aliases: executing...
[cont-init.d] 70-aliases: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Mariadb Log
-------------------------------------
GID/UID
-------------------------------------
User uid: 99
User gid: 100
-------------------------------------
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing...
[cont-init.d] 30-config: exited 0.
[cont-init.d] 40-initialise-db: executing...
[cont-init.d] 40-initialise-db: exited 0.
[cont-init.d] 90-warning: executing...
******************************************************
******************************************************
* *
* *
* This image will soon be rebased *
* from ubuntu to alpine. *
* Please be aware, this may cause issues *
* It is strongly recommended to make backups *
* of your config and databases before *
* updating your image to the alpine base. *
* *
* *
******************************************************
******************************************************
[cont-init.d] 90-warning: exited 0.
[cont-init.d] 99-custom-scripts: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
210323 16:26:04 mysqld_safe Logging to syslog.
210323 16:26:04 mysqld_safe Starting mysqld daemon with databases from /config/databases
Swag Log
-------------------------------------
GID/UID
-------------------------------------
User uid: 99
User gid: 100
-------------------------------------
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-config: executing...
Variables set:
PUID=99
PGID=100
TZ=Europe/Berlin
URL=mydomain.de
SUBDOMAINS=nextcloud
EXTRA_DOMAINS=
ONLY_SUBDOMAINS=true
VALIDATION=http
CERTPROVIDER=
DNSPLUGIN=
EMAIL=(removed)
STAGING=false
Using Let's Encrypt as the cert provider
SUBDOMAINS entered, processing
SUBDOMAINS entered, processing
Only subdomains, no URL in cert
Sub-domains processed are: -d nextcloud.mydomain.de
E-mail address entered: (removed)
http validation is selected
Certificate exists; parameters unchanged; starting nginx
Starting 2019/12/30, GeoIP2 databases require personal license key to download. Please retrieve a free license key from MaxMind,
and add a new env variable "MAXMINDDB_LICENSE_KEY", set to your license key.
[cont-init.d] 50-config: exited 0.
[cont-init.d] 60-renew: executing...
The cert does not expire within the next day. Letting the cron script handle the renewal attempts overnight (2:08am).
[cont-init.d] 60-renew: exited 0.
[cont-init.d] 70-templates: executing...
[cont-init.d] 70-templates: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Server ready
App Logs
Nextcloud
Only one entry, when accessing using the local address and the old config.php (see above). No other log entries since problem started.
{"reqId":"qCxQnN2R0QsphV1xEzAw","level":3,"time":"2021-03-23T15:45:00+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":{"Exception":"TypeError","Message":"Argument 1 passed to OC\\DB\\SchemaWrapper::__construct() must be an instance of OC\\DB\\Connection, instance of OC\\DB\\ConnectionAdapter given, called in /config/www/nextcloud/apps/spreed/lib/BackgroundJob/CheckReferenceIdColumn.php on line 59","Code":0,"Trace":[{"file":"/config/www/nextcloud/apps/spreed/lib/BackgroundJob/CheckReferenceIdColumn.php","line":59,"function":"__construct","class":"OC\\DB\\SchemaWrapper","type":"->"},{"file":"/config/www/nextcloud/lib/public/BackgroundJob/Job.php","line":80,"function":"run","class":"OCA\\Talk\\BackgroundJob\\CheckReferenceIdColumn","type":"->"},{"file":"/config/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":61,"function":"execute","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/config/www/nextcloud/cron.php","line":128,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/config/www/nextcloud/lib/private/DB/SchemaWrapper.php","Line":41,"CustomMessage":"--"},"userAgent":"--","version":"21.0.0.18"}
occ status
An unhandled exception has been thrown:
ParseError: syntax error, unexpected 'nextcloud' (T_STRING), expecting ')' in /config/www/nextcloud/config/config.php:20
Stack trace:
#0 /config/www/nextcloud/lib/private/Config.php(68): OC\Config->readData()
#1 /config/www/nextcloud/lib/base.php(149): OC\Config->__construct()
#2 /config/www/nextcloud/lib/base.php(569): OC::initPaths()
#3 /config/www/nextcloud/lib/base.php(1076): OC::init()
#4 /config/www/nextcloud/console.php(49): require_once('/config/www/nex...')
#5 /config/www/nextcloud/occ(11): require_once('/config/www/nex...')
occ maintenance:mode
An unhandled exception has been thrown:
ParseError: syntax error, unexpected 'nextcloud' (T_STRING), expecting ')' in /config/www/nextcloud/config/config.php:20
Stack trace:
#0 /config/www/nextcloud/lib/private/Config.php(68): OC\Config->readData()
#1 /config/www/nextcloud/lib/base.php(149): OC\Config->__construct()
#2 /config/www/nextcloud/lib/base.php(569): OC::initPaths()
#3 /config/www/nextcloud/lib/base.php(1076): OC::init()
#4 /config/www/nextcloud/console.php(49): require_once('/config/www/nex...')
#5 /config/www/nextcloud/occ(11): require_once('/config/www/nex...')
config.php
<?php
$CONFIG = array (
'memcache.local' => '\\OC\\Memcache\\APCu',
'datadirectory' => '/data',
'instanceid' => '(removed)',
'passwordsalt' => '(removed)',
'secret' => '(removed)',
'trusted_domains' =>
array (
0 => '192.168.178.18:444',
1 => 'nextcloud.mydomain.de',
),
'dbtype' => 'mysql',
'version' => '21.0.0.18',
'overwrite.cli.url' => 'https://nextcloud.mydomain.de',
'trusted_proxies' =>
array (
0 => 'swag',
),
'overwritehost’ => 'nextcloud.mydomain.de’,
'overwriteprotocol’ => 'https’,
'dbname' => 'nextcloud',
'dbhost' => '192.168.178.18:3306',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'nextcloud',
'dbpassword' => '(removed)',
'installed' => true,
'maintenance' => false,
'default_language' => 'de',
'default_locale' => 'de_DE',
'default_phone_region' => 'DE',
'auth.bruteforce.protection.enabled' => true,
'app_install_overwrite' =>
array (
0 => 'bruteforcesettings',
),
);
Based on my findings, the MariaDB connection is working and I suspect the config.php to be the culprit. But happy to hear your expert opinions and finfings. Thanks a million in advance for your support!!!
Addition:
After removing the lines
'overwritehost’ => 'nextcloud.mydomain.de’,
'overwriteprotocol’ => 'https’,
from config.php nextcloud was working again using the external address 🙂 not sure I uderstand why and the implecations when keeping those lines out...