NextcloudPi (21.0.9.1) - --> Access through untrusted domain

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.9.1
Operating system and version (eg, Ubuntu 20.04): Debian 10 (buster) / Raspbian (32bit)
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.38-3
PHP version (eg, 7.4): PHP 8.0.15-1

The issue you are facing:

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

Steps to replicate it:

  1. Internal access (https: //192.168.200.4) works without an issue
  2. External access (https: //foo .ddns.net) shows up the message:

Access through untrusted domain

Please contact your administrator. If you are an administrator, edit the “trusted_domains” setting in config/config.php like the example in config.sample.php.

  1. I manually added the host “foo .ddns.net” to /var/www/nextcloud/config/config.php"

  2. I also added the host over CLI:
    sudo -u www-data php occ config:system:set trusted_domains 2 --value=foo .ddns.net

  3. I re-triggered the config sync afterwards (there is a cron job running every 5 minutes):
    sudo -u www-data php -f /var/www/nextcloud/cron.php

  4. My letsencrypt certificate is definitely valid and it’s working with our services running on the same server:
    f.e.: https: //foo .ddns.net/otherservice

Certificate is accepted and definitely valid

The output of your Nextcloud log in Admin > Logging:

There is so much output, I only copied the titles from webinterface
Of course I can deliver you details later - if needed:

Error	index	OCP\Files\NotFoundException: File does not exist

Error	PHP	Error: file_get_contents(/opt/nextcloud/DATA/appdata_xxx/css/icons/icons-list.template): Failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#277

Error	PHP	Error: unlink(/opt/nextcloud/DATA/appdata_xxx/css/spreed/b2be-2199-merged-files.css.deps): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#291

Error	PHP	Error: unlink(/opt/nextcloud/DATA/appdata_xxx/css/notes/c9e4-2199-global.css.deps): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#291

Error	PHP	Error: unlink(/opt/nextcloud/DATA/appdata_xxx/css/notes/c9e4-2199-global.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#291	

Warning	core	Renewing session token failed

Error	cron	Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
--> this one has been fixed, by editing the apache2 systemd service to start AFTER the mysql.service has been started (AFTER= condition)

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

<--! Paste this in GitHub report -->

<details>
<summary>NextCloudPi diagnostics</summary>

NextCloudPi version  v1.46.7
NextCloudPi image    NextCloudPi_07-21-19
OS                   Raspbian GNU/Linux 10. 5.10.63-v7l+ (armv7l)
automount            yes
USB devices          sda 
datadir              /opt/nextcloud/DATA
data in SD           no
data filesystem      ext2/ext3
data disk usage      150G/1,8T
rootfs usage         5,8G/59G
swapfile             none
dbdir                /opt/nextcloud/BASE
Nextcloud check      ok
Nextcloud version    21.0.9.1
HTTPD service        up
PHP service          up
MariaDB service      up
Redis service        up
HPB service          down
Postfix service      up
internet check       ok
port check 80        closed
port check 443       closed
IP                   ***REMOVED SENSITIVE VALUE***
gateway              ***REMOVED SENSITIVE VALUE***
interface            eth0
certificates         ***REMOVED SENSITIVE VALUE***
NAT loopback         yes
uptime               12:55

</details>


<details>
<summary>Nextcloud configuration</summary>

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
            "0": "foo.ddns.net",
            "11": "some html coded - triggered from my pihole dns server"
            "1": "192.168.200.4",
            "14": "germanicus",
            "3": "foo.ddns.net",
            "2": "foo.ddns.net"
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "21.0.9.1",
        "overwrite.cli.url": "https:\/\/foo.ddns.net\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "updater.secret": "***REMOVED SENSITIVE VALUE***",
        "theme": "",
        "loglevel": "3",
        "default_phone_region": "DE",
        "overwriteprotocol": "https",
        "logfile": "\/opt\/nextcloud\/DATA\/nextcloud.log"
    }
}


</details>

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

root@germanicus:/var/www/nextcloud# sudo apache2ctl -S
VirtualHost configuration:
*:80                   localhost (/etc/apache2/sites-enabled/000-default.conf:1)
*:4443                 localhost (/etc/apache2/sites-enabled/ncp.conf:2)
*:443                  foo.ddns.net (/etc/apache2/sites-enabled/nextcloud.conf:2)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex fcgid-proctbl: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default 
Mutex fcgid-pipe: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33
root@germanicus:/var/www/nextcloud# 


root@germanicus:/var/www/nextcloud# cat /var/log/apache2/error.log
[Tue Feb 22 00:00:04.955098 2022] [ssl:warn] [pid 1156:tid 3069321792] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Tue Feb 22 00:00:04.958161 2022] [mpm_event:notice] [pid 1156:tid 3069321792] AH00489: Apache/2.4.38 (Raspbian) mod_fcgid/2.3.9 OpenSSL/1.1.1d configured -- resuming normal operations
[Tue Feb 22 00:00:04.958226 2022] [core:notice] [pid 1156:tid 3069321792] AH00094: Command line: '/usr/sbin/apache2'
[Tue Feb 22 09:33:05.719058 2022] [proxy_fcgi:error] [pid 3515:tid 2761569280] [client 192.168.200.5:58456] AH01071: Got error 'PHP message: PHP Warning:  Undefined variable $cache_new in /var/www/ncp-web/backups.php on line 105'
root@germanicus:/var/www/nextcloud# 

--> AH01909: localhost:4443:0  message is OK - I am not using my letsencrypt certificate for the NextcloudPi web-gui running on 4443 and it's also not connected to the web




Part of nc-error.log:

[Mon Feb 21 17:03:31.363237 2022] [ssl:warn] [pid 17698:tid 3069698624] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 17:03:31.399336 2022] [ssl:warn] [pid 17699:tid 3069698624] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 17:11:59.221846 2022] [ssl:warn] [pid 803:tid 3069624896] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 17:11:59.282506 2022] [ssl:warn] [pid 966:tid 3069624896] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 19:17:52.118650 2022] [ssl:warn] [pid 771:tid 3069895232] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 19:17:52.210423 2022] [ssl:warn] [pid 960:tid 3069895232] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 19:47:34.688315 2022] [ssl:warn] [pid 6964:tid 3069682240] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 19:47:34.724533 2022] [ssl:warn] [pid 6965:tid 3069682240] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 20:24:00.522884 2022] [proxy_fcgi:error] [pid 6968:tid 2837529600] [client 192.168.200.5:60288] AH01067: Failed to read FastCGI header
[Mon Feb 21 20:24:00.522941 2022] [proxy_fcgi:error] [pid 6968:tid 2837529600] (104)Connection reset by peer: [client 192.168.200.5:60288] AH01075: Error dispatching request to : 
[Mon Feb 21 20:24:00.550231 2022] [proxy_fcgi:error] [pid 6968:tid 2795525120] [client 192.168.200.5:60288] AH01067: Failed to read FastCGI header
[Mon Feb 21 20:24:00.550306 2022] [proxy_fcgi:error] [pid 6968:tid 2795525120] (104)Connection reset by peer: [client 192.168.200.5:60288] AH01075: Error dispatching request to : 
[Mon Feb 21 20:24:00.603923 2022] [proxy_fcgi:error] [pid 6968:tid 2753520640] [client 192.168.200.5:60288] AH01067: Failed to read FastCGI header
[Mon Feb 21 20:24:00.603972 2022] [proxy_fcgi:error] [pid 6968:tid 2753520640] (104)Connection reset by peer: [client 192.168.200.5:60288] AH01075: Error dispatching request to : 
[Mon Feb 21 20:24:00.618579 2022] [proxy_fcgi:error] [pid 6968:tid 2862707712] [client 192.168.200.5:60288] AH01067: Failed to read FastCGI header
[Mon Feb 21 20:24:00.618628 2022] [proxy_fcgi:error] [pid 6968:tid 2862707712] (104)Connection reset by peer: [client 192.168.200.5:60288] AH01075: Error dispatching request to : 
[Mon Feb 21 20:24:00.632406 2022] [proxy_fcgi:error] [pid 6968:tid 2803926016] [client 192.168.200.5:60288] AH01067: Failed to read FastCGI header
[Mon Feb 21 20:24:00.632468 2022] [proxy_fcgi:error] [pid 6968:tid 2803926016] (104)Connection reset by peer: [client 192.168.200.5:60288] AH01075: Error dispatching request to : 
[Mon Feb 21 20:24:00.640043 2022] [proxy_fcgi:error] [pid 6968:tid 2778723328] [client 192.168.200.5:60288] AH01067: Failed to read FastCGI header
[Mon Feb 21 20:24:00.640087 2022] [proxy_fcgi:error] [pid 6968:tid 2778723328] (104)Connection reset by peer: [client 192.168.200.5:60288] AH01075: Error dispatching request to : 
[Mon Feb 21 20:24:00.640167 2022] [proxy_fcgi:error] [pid 6968:tid 2770322432] [client 192.168.200.5:60288] AH01067: Failed to read FastCGI header
[Mon Feb 21 20:24:00.640200 2022] [proxy_fcgi:error] [pid 6968:tid 2770322432] (104)Connection reset by peer: [client 192.168.200.5:60288] AH01075: Error dispatching request to : 
[Mon Feb 21 20:24:00.645335 2022] [proxy_fcgi:error] [pid 6968:tid 2845922304] [client 192.168.200.5:60288] AH01067: Failed to read FastCGI header
[Mon Feb 21 20:24:00.645389 2022] [proxy_fcgi:error] [pid 6968:tid 2845922304] (104)Connection reset by peer: [client 192.168.200.5:60288] AH01075: Error dispatching request to : 
[Mon Feb 21 20:24:00.646658 2022] [proxy_fcgi:error] [pid 6968:tid 2854315008] [client 192.168.200.5:60288] AH01067: Failed to read FastCGI header
[Mon Feb 21 20:24:00.646704 2022] [proxy_fcgi:error] [pid 6968:tid 2854315008] (104)Connection reset by peer: [client 192.168.200.5:60288] AH01075: Error dispatching request to : 
[Mon Feb 21 20:24:00.646897 2022] [proxy_fcgi:error] [pid 6968:tid 2904671232] [client 192.168.200.5:60288] AH01067: Failed to read FastCGI header
[Mon Feb 21 20:24:00.646941 2022] [proxy_fcgi:error] [pid 6968:tid 2904671232] (104)Connection reset by peer: [client 192.168.200.5:60288] AH01075: Error dispatching request to : 
[Mon Feb 21 20:24:00.650261 2022] [proxy_fcgi:error] [pid 6968:tid 2820727808] [client 192.168.200.5:60288] AH01067: Failed to read FastCGI header
[Mon Feb 21 20:24:00.650315 2022] [proxy_fcgi:error] [pid 6968:tid 2820727808] (104)Connection reset by peer: [client 192.168.200.5:60288] AH01075: Error dispatching request to : 
[Mon Feb 21 20:24:00.650557 2022] [proxy_fcgi:error] [pid 6968:tid 2879493120] [client 192.168.200.5:60288] AH01067: Failed to read FastCGI header
[Mon Feb 21 20:24:00.650595 2022] [proxy_fcgi:error] [pid 6968:tid 2879493120] (104)Connection reset by peer: [client 192.168.200.5:60288] AH01075: Error dispatching request to : 
[Mon Feb 21 20:24:00.650829 2022] [proxy_fcgi:error] [pid 6967:tid 2640282624] [client 192.168.200.4:36684] AH01067: Failed to read FastCGI header
[Mon Feb 21 20:24:00.650868 2022] [proxy_fcgi:error] [pid 6967:tid 2640282624] (104)Connection reset by peer: [client 192.168.200.4:36684] AH01075: Error dispatching request to : 
[Mon Feb 21 20:24:01.368040 2022] [proxy:error] [pid 6968:tid 2703225856] (9)Bad file descriptor: [client 192.168.200.216:55226] AH03307: ap_proxy_transfer_between_connections: error on sock - ap_pass_brigade
[Mon Feb 21 20:24:32.549688 2022] [ssl:warn] [pid 788:tid 3069203008] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 20:24:32.626535 2022] [ssl:warn] [pid 967:tid 3069203008] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 20:24:50.890681 2022] [proxy_fcgi:error] [pid 972:tid 2734683136] [client 192.168.200.4:46174] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/nextcloud/lib/private/DB/Connection.php:85\nStack trace:\n#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1519): OC\\DB\\Connection->connect()\n#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1041): Doctrine\\DBAL\\Connection->getWrappedConnection()\n#2 /var/www/nextcloud/lib/private/DB/Connection.php(231): Doctrine\\DBAL\\Connection->executeQuery()\n#3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\\DB\\Connection->executeQuery()\n#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\\DBAL\\Query\\QueryBuilder->execute()\n#5 /var/www/nextcloud/lib/private/AppConfig.php(345): OC\\DB\\QueryBuilder\\QueryBuilder->execute()\n#6 /var/www/nextcloud/lib/private/AppConfig.php(110): OC\\AppConfig->loadConfigValues()\n#7 /var/www/nextcloud/lib/pr...'
[Mon Feb 21 20:54:18.080837 2022] [proxy_fcgi:error] [pid 971:tid 2753041408] [client 192.168.200.5:60762] AH01067: Failed to read FastCGI header
[Mon Feb 21 20:54:18.080901 2022] [proxy_fcgi:error] [pid 971:tid 2753041408] (104)Connection reset by peer: [client 192.168.200.5:60762] AH01075: Error dispatching request to : 
[Mon Feb 21 20:54:18.104525 2022] [proxy:error] [pid 971:tid 2753041408] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php8.0-fpm.sock (*) failed
[Mon Feb 21 20:54:18.104589 2022] [proxy_fcgi:error] [pid 971:tid 2753041408] [client 192.168.200.5:60762] AH01079: failed to make connection to backend: httpd-UDS
[Mon Feb 21 20:54:53.788430 2022] [ssl:warn] [pid 850:tid 3069723200] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 20:54:53.855361 2022] [ssl:warn] [pid 964:tid 3069723200] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 20:55:13.773573 2022] [proxy_fcgi:error] [pid 968:tid 2717897728] [client 192.168.200.4:39922] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/nextcloud/lib/private/DB/Connection.php:85\nStack trace:\n#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1519): OC\\DB\\Connection->connect()\n#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1041): Doctrine\\DBAL\\Connection->getWrappedConnection()\n#2 /var/www/nextcloud/lib/private/DB/Connection.php(231): Doctrine\\DBAL\\Connection->executeQuery()\n#3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\\DB\\Connection->executeQuery()\n#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\\DBAL\\Query\\QueryBuilder->execute()\n#5 /var/www/nextcloud/lib/private/AppConfig.php(345): OC\\DB\\QueryBuilder\\QueryBuilder->execute()\n#6 /var/www/nextcloud/lib/private/AppConfig.php(110): OC\\AppConfig->loadConfigValues()\n#7 /var/www/nextcloud/lib/pr...'
[Mon Feb 21 21:21:54.243894 2022] [ssl:warn] [pid 877:tid 3069334080] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 21:21:54.320697 2022] [ssl:warn] [pid 969:tid 3069334080] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 21:22:13.980268 2022] [proxy_fcgi:error] [pid 973:tid 2675934208] [client 192.168.200.4:42480] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/nextcloud/lib/private/DB/Connection.php:85\nStack trace:\n#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1519): OC\\DB\\Connection->connect()\n#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1041): Doctrine\\DBAL\\Connection->getWrappedConnection()\n#2 /var/www/nextcloud/lib/private/DB/Connection.php(231): Doctrine\\DBAL\\Connection->executeQuery()\n#3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\\DB\\Connection->executeQuery()\n#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\\DBAL\\Query\\QueryBuilder->execute()\n#5 /var/www/nextcloud/lib/private/AppConfig.php(345): OC\\DB\\QueryBuilder\\QueryBuilder->execute()\n#6 /var/www/nextcloud/lib/private/AppConfig.php(110): OC\\AppConfig->loadConfigValues()\n#7 /var/www/nextcloud/lib/pr...'
[Mon Feb 21 21:36:45.544365 2022] [ssl:warn] [pid 1205:tid 3069334080] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 21:36:45.625165 2022] [ssl:warn] [pid 1234:tid 3069334080] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 21:40:30.232285 2022] [ssl:warn] [pid 2078:tid 3069530688] AH01909: germanicus.prod.foonetz.local:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 21:40:30.266619 2022] [ssl:warn] [pid 2079:tid 3069530688] AH01909: germanicus.prod.foonetz.local:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 21:43:22.000548 2022] [ssl:warn] [pid 2256:tid 3069215296] AH01909: germanicus.prod.foonetz.local:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 21:43:22.040213 2022] [ssl:warn] [pid 2257:tid 3069215296] AH01909: germanicus.prod.foonetz.local:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 21:45:21.410492 2022] [ssl:warn] [pid 2493:tid 3069559360] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 21:45:21.444479 2022] [ssl:warn] [pid 2494:tid 3069559360] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 21:53:07.483687 2022] [ssl:warn] [pid 2889:tid 3069657664] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 21 21:53:07.519660 2022] [ssl:warn] [pid 2890:tid 3069657664] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
root@germanicus:/var/www/nextcloud# 

Additional background information:

root@germanicus:/var/www/nextcloud# sudo -u www-data php occ status

  • installed: true
  • version: 21.0.9.1
  • versionstring: 21.0.9
  • edition:
    root@germanicus:/var/www/nextcloud#

NextCloudPi officially supports currently NC 22.2.2

I was not able to upgrade yet:

Every time, it results in a blank page in Firefox / Chrome - no error message like “Internal Server error”
Only IE 11 shows me Error Code 500 - which is (to my understanding) Internal server error

So I have to rewind every time. With a valid backup of the SD card and database backups, that was not an issue until today.
But I definitely plan to go to NC 22.2.2 as NC 21 is outdated and out of support very soon…

Maybe you can help me.

Please let me know if you need any further logs / details / information.

I even have documented my NC 22 upgrade fail and what I did - step by step.

Since weeks I am searching the internet to make it possible, but every time I tried, I failed with the same blank page error :frowning:

Thanks in advance for your help. I have no further ideas and I appreciate every feedback!

Error	index	OCP\Files\NotFoundException: File does not exist
Error	PHP	Error: file_get_contents(/opt/nextcloud/DATA/appdata_xxx/css/icons/icons-list.template): Failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#277
Error	PHP	Error: unlink(/opt/nextcloud/DATA/appdata_xxx/css/spreed/b2be-2199-merged-files.css.deps): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#291
Error	PHP	Error: unlink(/opt/nextcloud/DATA/appdata_xxx/css/notes/c9e4-2199-global.css.deps): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#291
Error	PHP	Error: unlink(/opt/nextcloud/DATA/appdata_xxx/css/notes/c9e4-2199-global.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#291	

Why are the files missing? Was there perhaps a problem with disk space while installation?

https: //foo .ddns.net
Please post your config/config.php

Hello @devnull ,

many thanks for your fast answer.

/opt/nextcloud is a an external SSD drive, mounted over /etc/fstab and it has sufficient space left:

root@germanicus:/var/www/nextcloud# df -h | grep “opt”
/dev/sda1 1,8T 150G 1,7T 9% /opt/nextcloud
root@germanicus:/var/www/nextcloud#

root@germanicus:/var/www/nextcloud# cat /etc/fstab | grep sda
/dev/sda1 /opt/nextcloud ext4 defaults 0 0
#/dev/sda1 /opt/nextcloud_data ext4 defaults 0 0
root@germanicus:/var/www/nextcloud#

(FYI /opt/nextcloud_data was an USB HDD which has been replaced by the SSD - I ran into issues after the replacement, because the entry still existed in the nextcloud database. When I deleted it manually from the database, it always showed up again, so it now exists as an symbolic link to /opt/nextcloud/DATA which is the data folder. You can call it a “legacy workaround”)

root@germanicus:/var/www/nextcloud# ls -lah /opt/
insgesamt 16K
drwxr-xr-x 4 root root 4,0K Jan 25 15:41 .
drwxr-xr-x 22 root root 4,0K Feb 11 21:25 …
drwxr-xr-x 9 www-data www-data 4,0K Feb 21 18:38 nextcloud
lrwxrwxrwx 1 root root 14 Jan 25 15:41 nextcloud_data → nextcloud/DATA
drwxr-xr-x 6 root root 4,0K Mai 21 2021 vc
root@germanicus:/var/www/nextcloud#

To increase the life time of Raspberry Pi 4’s SD card, the database has been also successfully migrated to the USB SSD drive:
/opt/nextcloud/BASE

And now my config/config.php:

<?php
$CONFIG = array (
  'instanceid' => 'xxx',
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' => 
  array (
    0 => 'foo.ddns.net',
    11 => '<html>
 <head>
  <title>title</title>
 </head>
 <body>
  <p style="text-align: center;">
   <img style="display: block; margin-left: auto; margin-right: auto;" alt="PiHoleLogo" width="307" height="207" />
    <span style="font-size: xx-large;">Website durch Pi-Hole Werbeblocker blockiert!</span>
  </p>
 </body>
</html>',
    1 => '192.168.200.4',
    14 => 'germanicus',
    3 => 'foo.ddns.net',
    2 => 'foo.ddns.net',
  ),
  'datadirectory' => '/opt/nextcloud/DATA',
  'dbtype' => 'mysql',
  'version' => '21.0.9.1',
  'overwrite.cli.url' => 'https://foo.ddns.net/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxx',
  'dbpassword' => 'xxx',
  'installed' => true,
  'maintenance' => false,
  'updater.secret' => 'xxx',
  'theme' => '',
  'loglevel' => '3',
  'default_phone_region' => 'DE',
  'overwriteprotocol' => 'https',
  'logfile' => '/opt/nextcloud/DATA/nextcloud.log',
);

Please post the correct form of your config/config.php.

Why is there “1”, “14” and then “3”? Perhaps this is the error.
Change “14” to “2” or delete the second entry and change “3” to “2”.

Hello @devnull ,

I edited my post, so its better readable.

Well, these entries are related to the NextCloudPi default configuration (defined in their scripts), I also don’t understand these many entries. I removed many of them, but I did not think that the duplicates could be an issue (?)

root@germanicus:/var/www/nextcloud# cat /usr/local/etc/library.sh

#!/bin/bash

# NextCloudPi function library
#
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
# GPL licensed (see end of file) * Use at your own risk!
#
# More at ownyourbits.com
#

export NCPCFG=${NCPCFG:-/usr/local/etc/ncp.cfg}
export CFGDIR=/usr/local/etc/ncp-config.d
export BINDIR=/usr/local/bin/ncp
export NCDIR=/var/www/nextcloud
export ncc=/usr/local/bin/ncc

#unset TRUSTED_DOMAINS
#declare -A TRUSTED_DOMAINS
#export TRUSTED_DOMAINS=(
  #[ip]=1 [dnsmasq]=2 [nc_domain]=3 [nextcloudpi-local]=5 [docker_overwrite]=6
  #[nextcloudpi]=7 [nextcloudpi-lan]=8 [public_ip]=11 [letsencrypt_1]=12
  #[letsencrypt_2]=13 [hostname]=14 [trusted_domain_1]=20 [trusted_domain_2]=21 [trusted_domain_3]=22
#)

As you can see, they commented it out in a later version of their script.

Nevertheless, I can re-configure the config.php as you proposed - just a moment, I will post the new config.php soon

As proposed I tidied up the trusted domain links, so that only these two are remaining:

‘trusted_domains’ =>
array (
0 => ‘foo.ddns.net’,
1 => ‘192.168.200.4’,
),

I manually edited the config.php and did a run of the cron.php afterwards to see if nothing has been overwriten:

root@germanicus:/var/www/nextcloud# sudo -u www-data php -f /var/www/nextcloud/cron.php

Afterwards I rebooted the server to see if the page is now reachable over foo.ddns.net:

RESULT: After a reboot the config.php has ALL entries again!

In /var/log/syslog I can see these entries:
Feb 22 12:52:40 germanicus bash[1103]: Updating NextCloud config with Redis password
Feb 22 12:52:40 germanicus bash[1103]: Updating NextCloud config with MariaDB password
Feb 22 12:52:42 germanicus bash[1103]: Running nc-limits
Feb 22 12:52:42 germanicus bash[1104]: System config value trusted_domains => 11 set to string
…
Feb 22 12:52:43 germanicus bash[1104]: System config value trusted_domains => 1 set to string 192.168.200.4
Feb 22 12:52:43 germanicus bash[1103]: Using 6 PHP threads
Feb 22 12:52:43 germanicus bash[1103]: Using 968955904 memory for the database
…
Feb 22 12:52:44 germanicus bash[1104]: System config value trusted_domains => 14 set to string germanicus
Feb 22 12:52:44 germanicus systemd[1]: nc-provisioning.service: Succeeded.
Feb 22 12:52:50 germanicus systemd[1]: nextcloud-domain.service: Succeeded.

So I think that NextCloudPi is re-configuring the config/config.php in regular time frames -.-

Can you please tell me if these systemd services are default Nextcloud services? Otherwise they have to be from NextCloudPi and I will disable them:

oot@germanicus:/var/www/nextcloud# systemctl status nc-
nc-automount-links.service nc-automount.service nc-provisioning.service nextcloud-domain.service

UPDATE:
I disabled the following services, they overwrote my config.php after a reboot:

  • nc-automount.service

  • nc-automount-links.service

  • nc-provisioning.service

  • nextcloud-domain.service

Now my config.php survives the reboot.

I edited my config.php - this is the current state:

(Problem with untrusted domain remains :frowning: )

<?php
$CONFIG = array (
  'instanceid' => 'xxx',
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '192.168.200.4',
    2 => 'foo.no-ip.info',     = canonical name for foo.ddns.net
    3 => 'foo.ddns.net',
    4 => 'germanicus',
  ),
  'overwrite.cli.url' => 'https://germanicus/',
  'overwriteprotocol' => 'https',
  'datadirectory' => '/opt/nextcloud/DATA',
  'tempdirectory' => '/opt/nextcloud/DATA/TEMP_UPLOAD',
  'dbtype' => 'mysql',
  'version' => '21.0.9.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => 'true',
  'dbuser' => 'xxx',
  'dbpassword' => 'xxx',
  'installed' => 'true',
  'maintenance' => 'false',
  'ldapIgnoreNamingRules' => 'false',
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'updater.secret' => 'xxx',
  'theme' => '',
  'loglevel' => '3',
  'log_type' => 'file',
  'logfile' => '/opt/nextcloud/DATA/nextcloud.log',
  'default_phone_region' => 'DE',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => '0',
    'timeout' => '0.0',
    'password' => 'xxx',
  ),
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
);

Hello @devnull

UPDATE:

OK, I discovered, that my instanceid has been changed and I had two appdata folders in /opt/nextcloud/DATA

I manually copied the data from old appdata folder to new appdata folder - this should fix the "
OCP\Files\NotFoundException: File does not exit" errors

I did a appdata scan & a file scan afterwards.

UPDATE 2:

I discovered that these systemd services were “NextcloudPi” specific and they were responsible for overwritting my config/config.php file. So I deactivated them and I also deactivated the “NextCloudPi app 0.01” in Admin web ui.

→ I see no more advantages of NextcloudPi and I will continue without it in the future. This means that I will keep the current installation, but I will manage everything by myself and will not let it be done by some scripts running in the background.

UPDATE 3:

Although occ status comand provides me the information that I am running on NC 21.0.9.1 (see above) the webinterface shows me that I am running an outdated version of NC 21.0.7.1.

I will attach a screenshot (sorry in german) which shows the old version and also some error messages regarding missing “php-memory cache” and missing “default_phone_region”.

As you can see in my current config.php all missing information are already provided there, so I don’t understand that the web ui does provide these false information.

Can you please tell me WHERE the nextcloud web ui reaches these information? From my understanding it should check the config/config.php. Or does it use another source like checking out theses parameters from the mysql database.

I am a bit confused now.

UPDATE 4:

Beside the mentioned issues, the “not trusted domain” issue persists…

Question:

  • I have now backuped my database to my NAS
  • I have now backuped my data folder to my NAS
  • I have also created a fullbackup of the SD card to my NAS

Does it make sense to upgrade now the nextcloud to NC 22.2.5 (of course from CLI as described in the manual upgrade documentation) to solve the “trusted domains” problem and also maybe the others?
Or do you think that there could be an issue with my mysql database, which leads to the wrong version “21.0.7.1” in the webinterface and will also prevent me from upgrading successfully to NC 22.2.5.

Or better: What would you do in my situation? :grinning:

image

My problem is that i do not use a NextcloudPi.
For upgrade of NextcloudPi read this.
Perhaps someone with NextcloudPi can help you.

Yes you can upgrade your system the the latest NextcloudPi version.
Sooner or later you must do it.
But it i think this does not solve your problem with untrusted domain.

1 Like

Hello @devnull

Many thanks for all your effort and time, which you have put in my problem! I really really appreciate it.

I want to and will get rid of NextCloudPi and their scripts. So I deactivated everything which is related to NextcloudPi. So lets deal my request ticket like a “general” Nextcloud ticket :smile:

Regarding my quesions above, do you have an idea?

  • Can you please tell me WHERE the nextcloud web ui reaches these information? From my understanding it should check the config/config.php. Or does it use another source like checking out theses parameters directly from the mysql database?

UPDATE:

I found out that my cron.php cronjob (running every 5 minutes) did NOT run successfully since a very long time.

WebUI showed me that everything was OK
CLI showed no error output when I triggered it manually:
sudo -u www-data php -f /var/www/nextcloud/cron.php

BUT, when I checked /var/mail/www-data , I saw that it ran in this error every 5 minutes:

“failed to connect to the database”

By duckduckgoing the internet, I found out that can occur after an upgrade of PHP packages and that one should reinstall all PHP packages and reactivate all php modules for apache etc.
I thought “Oh my god! NO, please NO!”

Then I did an “apt update && apt upgrade” and I was luckily offered an upgrade to php 8.0.16 for all my installed php 8.0.15 packages.

I thought: I can’t make it worse as it is currently, so I installed them.

Afterwards my cron.php job worked again - so I was lucky that it has been solved so easy :slight_smile:

One of my problems is now gone: WebUI finally shows me the correct NC version 21.0.9.1 and offers me NC 22.2.5.

What I learned here was, that I will be more careful with updating packages in the future :sweat_smile:

Now I can continue with all the other problems that I discovered - especially the “trusted domains” issue.

@SoCloudy The trusted domain configuration is commented out in the script because those configuration values aren’t used :slight_smile:

This is the correct location the trusted domain values are set

https://github.com/nextcloud/nextcloudpi/blob/dd8fc3dd7d663faf5d916039ee042ef049aaf728/bin/ncp/CONFIG/nc-init.sh#L108

  ncc config:system:set trusted_domains 7 --value="nextcloudpi"
  ncc config:system:set trusted_domains 5 --value="nextcloudpi.local"
  ncc config:system:set trusted_domains 8 --value="nextcloudpi.lan"
  ncc config:system:set trusted_domains 3 --value="nextcloudpi.lan"

  # email
  ncc config:system:set mail_smtpmode     --value="sendmail"
  ncc config:system:set mail_smtpauthtype --value="LOGIN"
  ncc config:system:set mail_from_address --value="admin"
  ncc config:system:set mail_domain       --value="ownyourbits.com"

You need to give an ID higher than 20 for your own domains in the config.php, else you’ll get all sorts of troubles.

Here is my config.php as a reference from the VM I’m using to experiment with when I have some time over besides work and my studies


<?php
$CONFIG = array (
  'passwordsalt' => 'TRALALALA',
  'secret' => 'TRALALALA',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    22 => 'MY.DOMAIN.COM',
    '' => 'nextcloudpi',
    11 => 'THIS.VMs.IPv6.ADDRESS',
    1 => 'THIS.VMs.IPv4.ADDRESS',
    14 => 'nextcloudpi',
    20 => 'nextcloudpi.local',
    21 => 'MY.DOMAIN.local',
    23 => 'MY.DOMAIN.COM',
    24 => 'LOCAL.IP.ADDRESS',
    25 => 'MY.DOMAIN.COM',
    3 => 'nextcloudpi',
  ),
  'datadirectory' => '/media/USBdrive/ncdata/data',
  'dbtype' => 'mysql',
  'version' => '23.0.0.10',
  'overwrite.cli.url' => 'https://nextcloudpi/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'TRALALALA',
  'dbpassword' => 'TRALALALA',
  'installed' => true,
  'instanceid' => 'TRALALALA',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => 'TRALALALA',
  ),
  'tempdirectory' => '/media/USBdrive/ncdata/data/tmp',
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'admin',
  'mail_domain' => 'ownyourbits.com',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'overwriteprotocol' => 'https',
  'trusted_proxies' => 
  array (
    11 => '127.0.0.1',
    12 => '::1',
    13 => 'nextcloudpi',
    14 => '',
  ),
  'maintenance' => false,
  'logfile' => '/media/USBdrive/ncdata/data/nextcloud.log',
  'loglevel' => '2',
  'log_type' => 'file',
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
    0 => 'Users',
    1 => 'admin',
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
);

You must go into your config, and add your FQDN to trust domains.

@qubit2022 He already has ↓

2 => ‘foo.no-ip.info’, = canonical name for foo.ddns.net
3 => ‘foo.ddns.net’

I believe the issue is the ID assigned to the FQDN

Unless of course he is literally using foo.ddns.org cuz then you’re right, it needs to be the FQDN

[quote=“SoCloudy, post:7, topic:134366”]
'overwriteprotocol' => 'https'
[/quote

He should try to add the public IP to trusted domains, and not the local.
‘overwriteprotocol’ => ‘https’ usually does the trick here though.
Seems to me his DNS records are incorrect or his DDNS is not pointing to the correct IP.

Well yes obviously, unless you want to access it in the local network as well by IP address, which I do. If you do not add your local IP there you cannot do this

If you use proxies in the local network, which I do, these need to be added as well, except under trusted proxies instead

The overwrite cli only overwrites from http to https, it does not affect which trusted domain is allowed or not

A DDNS should point to the public IP of the router, which then forwards the request to the server via port forwarding.

Now which addresses you’re allowed to use when connecting is what trusted domains are for, both with a domain name (local and external) and IP address

1 Like

Yes I copied the wrong part of that post.

2 => ‘foo.no-ip.info’, = canonical name for foo.ddns.net
3 => 'foo.ddns.net

usually does the trick here.

His DNS records are 100 percent messing with him im certain of it. Something from the registar, all the way to the DNS provider, is wrong. It could even be a wrong ssl certification. After reinistalling nextcloud most usually reissue or (try to) reissue a letsencrypt ssl cert. If youve used up your 5 for the week it would mean the cert youre using is no longer valid.

1 Like

Aha I see :partying_face:

It should not be the DNS, as he is able to reach the server … that would not have worked at all if it was the DNS

Well it looks like you’ve changed quite a bit from the set defaults :sweat_smile: and it looks like you’re using PHP 8 as well? And Debian 11? Which means you’re on a configuration not yet supported really (by ncp i mean)

1 Like