SSL_ERROR_RX_RECORD_TOO_LONG after update to 22

Version Information
Nextcloud version : 22.2.2.0
Operating system and version: RaspberryPi OS 64 bit (Linux 5.10.52-v8+ #1441 SMP PREEMPT Tue Aug 3 18:14:03 BST 2021 aarch64 GNU/Linux)
Apache version: Server version: Apache/2.4.38 (Debian);Server built: 2021-06-10T10:13:06
PHP version: PHP 7.3.29-1~deb10u1 (cli) (built: Jul 2 2021 04:04:33) ( NTS )

Problem Description
I recently updated nextcloudpi from Version 20 to 22. (I don’t know exactly, which version of 20 I was on. I updated to 21.0.0 first, because it said, I can’t jump a major version. So the update path was: 20.?->21.0.0->22.2.2.0).

After that i can no longer access my files on nextcloud. I get the following error in the browser: SSL_ERROR_RX_RECORD_TOO_LONG

The admin panel is still working though.

I use the non-container version on RaspberryPi OS. I have PiHole running on the same machine, so I changed the ports for nexcloud to 9992 (HTTPS for nextcloud) and 4443 (for the admin panel).

I only use it in my local network and don’t have it accessible over the internet. I do not use letsencrupt/my own domain and certificates.

When googeling for SSL_ERROR_RX_RECORD_TOO_LONG, so many results come up. I went through quite a few of them, but I don’t see, how they apply to me or my setup. I am lost, where to go from here.

Maybe something pertaining to the port changes got overwritten during the update. Though I checked the changes I made in apache, and they still look ok to me.

Maybe I have to renew the self signed certificates?

I would be very grateful, if someone could point me in some directions I could explore to fix this issue.

The output of your Nextcloud log in Admin > Logging:

nc-limits ] (Mon 03 Jan 2022 02:27:13 PM CET)
Using 6143612928B for PHP
Using 6 PHP threads
Using 1997539328 memory for the database

System config value trusted_domains => 3 set to string localhost
System config value overwrite.cli.url set to string https://localhost/
System config value trusted_proxies => 11 set to string 127.0.0.1
System config value trusted_proxies => 12 set to string ::1
System config value trusted_proxies => 13 set to string localhost
System config value trusted_proxies => 14 set to empty string
✓ redis is configured
🗴 push server url is set to localhost, the push server will not be reachable from other machines
🗴 can't connect to push server: cURL error 7: Failed to connect to localhost port 443: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://localhost/push/test/cookie

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

        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
            "0": "localhost",
            "11": "217.22.140.53",
            "1": "192.168.188.2",
            "5": "nextcloudpi.local",
            "7": "nextcloudpi",
            "8": "nextcloudpi.lan",
            "3": "localhost",
            "14": "NextcloudSpotipiHole"
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "22.2.2.0",
        "overwrite.cli.url": "https:\/\/localhost\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "tempdirectory": "\/var\/www\/nextcloud\/data\/tmp",
        "mail_smtpmode": "sendmail",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "preview_max_x": "2048",
        "preview_max_y": "2048",
        "jpeg_quality": "60",
        "overwriteprotocol": "https",
        "maintenance": false,
        "theme": "",
        "loglevel": 0,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***"

The output of your Apache/nginx/system log in /var/log/____:
apache2/nc-error.log

[Mon Jan 03 14:27:07.743223 2022] [ssl:warn] [pid 603:tid 547868448112] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Mon Jan 03 14:27:07.753241 2022] [ssl:error] [pid 603:tid 547868448112] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=NextcloudSpotipiHole / issuer: CN=NextcloudSpotipiHole / serial: 740C2F117C7F1560FAB723FCFB8B36671C5A6BA1 / notbefore: Nov 28 11:21:31 2020 GMT / notafter: Nov 26 11:21:31 2030 GMT]
[Mon Jan 03 14:27:07.753324 2022] [ssl:error] [pid 603:tid 547868448112] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Mon Jan 03 14:27:07.836372 2022] [ssl:warn] [pid 723:tid 547868448112] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Mon Jan 03 14:27:07.838440 2022] [ssl:error] [pid 723:tid 547868448112] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=NextcloudSpotipiHole / issuer: CN=NextcloudSpotipiHole / serial: 740C2F117C7F1560FAB723FCFB8B36671C5A6BA1 / notbefore: Nov 28 11:21:31 2020 GMT / notafter: Nov 26 11:21:31 2030 GMT]
[Mon Jan 03 14:27:07.840049 2022] [ssl:error] [pid 723:tid 547868448112] AH02604: Unable to configure certificate localhost:4443:0 for stapling

apache2/error.log

[Mon Jan 03 14:29:21.468488 2022] [authz_host:error] [pid 729:tid 547561431440] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to / failed, reason: unable to get the remote host name
[Mon Jan 03 14:29:21.545110 2022] [authz_host:error] [pid 729:tid 547561431440] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to / failed, reason: unable to get the remote host name
[Mon Jan 03 14:29:21.545503 2022] [authz_host:error] [pid 729:tid 547561431440] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /index.php failed, reason: unable to get the remote host name
[Mon Jan 03 14:29:21.572840 2022] [authz_host:error] [pid 729:tid 547561431440] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /index.php failed, reason: unable to get the remote host name
[Mon Jan 03 14:29:23.350303 2022] [authz_host:error] [pid 729:tid 547553030544] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /js/ncp.js failed, reason: unable to get the remote host name
[Mon Jan 03 14:29:23.350718 2022] [authz_host:error] [pid 729:tid 547561431440] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /js/minified.js failed, reason: unable to get the remote host name
[Mon Jan 03 14:29:23.350815 2022] [authz_host:error] [pid 729:tid 547569832336] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /css/ncp.css failed, reason: unable to get the remote host name
[Mon Jan 03 14:29:23.352037 2022] [authz_host:error] [pid 729:tid 547586634128] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /img/loading-small.gif failed, reason: unable to get the remote host name
[Mon Jan 03 14:29:23.353835 2022] [authz_host:error] [pid 729:tid 547578233232] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /img/ncp-logo.svg failed, reason: unable to get the remote host name
[Mon Jan 03 14:29:23.383273 2022] [authz_host:error] [pid 729:tid 547578233232] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /img/toggle.svg failed, reason: unable to get the remote host name
[Mon Jan 03 14:29:23.384364 2022] [authz_host:error] [pid 729:tid 547578233232] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /img/defaults.svg failed, reason: unable to get the remote host name
[Mon Jan 03 14:29:23.388672 2022] [authz_host:error] [pid 729:tid 547578233232] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /img/poweroff.svg failed, reason: unable to get the remote host name
[Mon Jan 03 14:29:23.388672 2022] [authz_host:error] [pid 729:tid 547569832336] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /img/reboot.svg failed, reason: unable to get the remote host name
[Mon Jan 03 14:29:23.410628 2022] [authz_host:error] [pid 729:tid 547569832336] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /img/search.svg failed, reason: unable to get the remote host name, referer: https://192.168.188.2:4443/css/ncp.css
[Mon Jan 03 14:29:23.410628 2022] [authz_host:error] [pid 729:tid 547578233232] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /img/nc-button.svg failed, reason: unable to get the remote host name, referer: https://192.168.188.2:4443/css/ncp.css
[Mon Jan 03 14:29:23.414109 2022] [authz_host:error] [pid 729:tid 547578233232] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /img/defaults-white.svg failed, reason: unable to get the remote host name, referer: https://192.168.188.2:4443/css/ncp.css
[Mon Jan 03 14:29:23.414109 2022] [authz_host:error] [pid 729:tid 547561431440] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /img/settings-white.svg failed, reason: unable to get the remote host name, referer: https://192.168.188.2:4443/css/ncp.css
[Mon Jan 03 14:29:23.414109 2022] [authz_host:error] [pid 729:tid 547569832336] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /img/dashboard.svg failed, reason: unable to get the remote host name, referer: https://192.168.188.2:4443/css/ncp.css
[Mon Jan 03 14:29:23.414385 2022] [authz_host:error] [pid 729:tid 547578233232] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /img/logs.svg failed, reason: unable to get the remote host name, referer: https://192.168.188.2:4443/css/ncp.css
[Mon Jan 03 14:29:23.414385 2022] [authz_host:error] [pid 729:tid 547553030544] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /img/info-white.svg failed, reason: unable to get the remote host name, referer: https://192.168.188.2:4443/css/ncp.css
[Mon Jan 03 14:29:23.414812 2022] [authz_host:error] [pid 729:tid 547561431440] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /img/wizard.svg failed, reason: unable to get the remote host name, referer: https://192.168.188.2:4443/css/ncp.css
[Mon Jan 03 14:29:23.418309 2022] [authz_host:error] [pid 729:tid 547586634128] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /img/files.svg failed, reason: unable to get the remote host name, referer: https://192.168.188.2:4443/css/ncp.css
[Mon Jan 03 14:29:23.442459 2022] [authz_host:error] [pid 729:tid 547586634128] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /ncp-output.php failed, reason: unable to get the remote host name
[Mon Jan 03 14:29:23.449544 2022] [authz_host:error] [pid 729:tid 547561431440] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name
[Mon Jan 03 14:29:30.950233 2022] [authz_host:error] [pid 729:tid 547561431440] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name
[Mon Jan 03 14:29:30.980778 2022] [authz_host:error] [pid 729:tid 547561431440] [client 192.168.188.53:55470] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name

I managed to fix it after all.

I first deactivated pihole to ensure, that there is no port conflict. Then I did a clean install of nextcloud on a seperate RaspberryPi and compared the port configuration for apache 2 (/etc/apache2/ports.conf and /etc/apache2/sites-enabled/*).

First I rolled back all the changes I made to match the configuration of the clean install. After that I could reach Nextcloud again.

Then I changed to ports back to how I want them (80->9991 and 443->9992). After that, I could still reach Nextcloud.

So I guess something in the port configuration got changed/overwritten during the update.