SSL initialization failed

Hi, I have a nextcloudpi running on my raspberrypi and it works fine, except for one thing: On my mobile phone with the latest Android I have set my camera image folder such that it should automatically upload all the pictures I’ve taken. However he always complains: SSL initialization failed.

I use:

NextcloudPi version: 1.24.0
PHP version: 7.3
(for the other versions I have currently no idea where to find them)

The output of my Nextcloud log in Admin > Logging:

{"reqId":"Xns0pjDZOrFXfyNAvJrXxgAAAEs","level":4,"time":"2020-03-25T10:40:10+00:00","remoteAddr":"77.181.45.232","user":"TaZi","app":"webdav","method":"PUT","url":"/remote.php/dav/uploads/TaZi/8c9b59bd2e6227717fb3b9af41e8f1b1/0000000000000000-0000000001969999","message":{"Exception":"Sabre\\DAV\\Exception\\BadRequest","Message":"Expected filesize of 1969999 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 40960 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":156,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->","args":[null]},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/UploadFolder.php","line":47,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["0000000000000000-0000000001969999",null]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1096,"function":"createFile","class":"OCA\\DAV\\Upload\\UploadFolder","type":"->","args":["0000000000000000-0000000001969999",null]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":525,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["uploads/TaZi/8c9b59bd2e6227717fb3b9af41e8f1b1/0000000000000000-0000000001969999",null,null]},{"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"absoluteUrl":"https://ziesche.ddns.net/remote.php/dav/uploads/TaZi/8c9b59bd2e6227717fb3b9af41e8f1b1/0000000000000000-0000000001969999","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php","line":105,"function":"call_user_func_array","args":[[{"__class__":"Sabre\\DAV\\CorePlugin"},"httpPut"],[{"absoluteUrl":"https://ziesche.ddns.net/remote.php/dav/uploads/TaZi/8c9b59bd2e6227717fb3b9af41e8f1b1/0000000000000000-0000000001969999","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":479,"function":"emit","class":"Sabre\\Event\\EventEmitter","type":"->","args":["method:PUT",[{"absoluteUrl":"https://ziesche.ddns.net/remote.php/dav/uploads/TaZi/8c9b59bd2e6227717fb3b9af41e8f1b1/0000000000000000-0000000001969999","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":254,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"absoluteUrl":"https://ziesche.ddns.net/remote.php/dav/uploads/TaZi/8c9b59bd2e6227717fb3b9af41e8f1b1/0000000000000000-0000000001969999","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":319,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/nextcloud/remote.php","line":165,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","Line":229,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.10.1","version":"18.0.2.2","id":"5e7b350b4edfc"}
{"reqId":"Xns0pjDZOrFXfyNAvJrXxgAAAEs","level":3,"time":"2020-03-25T10:40:10+00:00","remoteAddr":"77.181.45.232","user":"TaZi","app":"no app in context","method":"PUT","url":"/remote.php/dav/uploads/TaZi/8c9b59bd2e6227717fb3b9af41e8f1b1/0000000000000000-0000000001969999","message":{"Exception":"Sabre\\DAV\\Exception\\BadRequest","Message":"Expected filesize of 1969999 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 40960 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":156,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->","args":[null]},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/UploadFolder.php","line":47,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["0000000000000000-0000000001969999",null]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1096,"function":"createFile","class":"OCA\\DAV\\Upload\\UploadFolder","type":"->","args":["0000000000000000-0000000001969999",null]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":525,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["uploads/TaZi/8c9b59bd2e6227717fb3b9af41e8f1b1/0000000000000000-0000000001969999",null,null]},{"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"absoluteUrl":"https://ziesche.ddns.net/remote.php/dav/uploads/TaZi/8c9b59bd2e6227717fb3b9af41e8f1b1/0000000000000000-0000000001969999","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php","line":105,"function":"call_user_func_array","args":[[{"__class__":"Sabre\\DAV\\CorePlugin"},"httpPut"],[{"absoluteUrl":"https://ziesche.ddns.net/remote.php/dav/uploads/TaZi/8c9b59bd2e6227717fb3b9af41e8f1b1/0000000000000000-0000000001969999","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":479,"function":"emit","class":"Sabre\\Event\\EventEmitter","type":"->","args":["method:PUT",[{"absoluteUrl":"https://ziesche.ddns.net/remote.php/dav/uploads/TaZi/8c9b59bd2e6227717fb3b9af41e8f1b1/0000000000000000-0000000001969999","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":254,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"absoluteUrl":"https://ziesche.ddns.net/remote.php/dav/uploads/TaZi/8c9b59bd2e6227717fb3b9af41e8f1b1/0000000000000000-0000000001969999","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":319,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/nextcloud/remote.php","line":165,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","Line":229,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.10.1","version":"18.0.2.2","id":"5e7b350b4f27e"}

For the config.php I found it, but I have no clue what information to post and what not.

The output of my Apache log

[Wed Mar 25 00:00:07.767610 2020] [ssl:warn] [pid 877:tid 3069239824] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Wed Mar 25 00:00:07.768880 2020] [mpm_event:notice] [pid 877:tid 3069239824] AH00489: Apache/2.4.38 (Raspbian) OpenSSL/1.1.1d configured -- resuming normal operations
[Wed Mar 25 00:00:07.768904 2020] [core:notice] [pid 877:tid 3069239824] AH00094: Command line: '/usr/sbin/apache2'
[Wed Mar 25 10:20:22.873270 2020] [authz_host:error] [pid 13056:tid 2805535776] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to / failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:23.008957 2020] [authz_host:error] [pid 13056:tid 2805535776] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to / failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:23.013551 2020] [authz_host:error] [pid 13056:tid 2805535776] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /index.php failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:23.106300 2020] [authz_host:error] [pid 13056:tid 2805535776] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /index.php failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:23.735661 2020] [authz_host:error] [pid 13056:tid 2805535776] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /js/minified.js failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:23.735798 2020] [authz_host:error] [pid 13056:tid 2813936672] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /js/ncp.js failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:23.735980 2020] [authz_host:error] [pid 13056:tid 2780333088] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/loading-small.gif failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:23.736551 2020] [authz_host:error] [pid 13056:tid 2797134880] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /css/ncp.css failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:23.738563 2020] [authz_host:error] [pid 13056:tid 2771932192] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/ncp-logo.svg failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:23.850222 2020] [authz_host:error] [pid 13056:tid 2805535776] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/poweroff.svg failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:23.850222 2020] [authz_host:error] [pid 13056:tid 2771932192] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/reboot.svg failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:23.850241 2020] [authz_host:error] [pid 13056:tid 2813936672] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/defaults.svg failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:23.850647 2020] [authz_host:error] [pid 13056:tid 2797134880] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/toggle.svg failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:23.894730 2020] [authz_host:error] [pid 13056:tid 2805535776] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/dashboard.svg failed, reason: unable to get the remote host name, referer: https://nextcloudpi:4443/css/ncp.css
[Wed Mar 25 10:20:23.894733 2020] [authz_host:error] [pid 13056:tid 2771932192] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/defaults-white.svg failed, reason: unable to get the remote host name, referer: https://nextcloudpi:4443/css/ncp.css
[Wed Mar 25 10:20:23.894780 2020] [authz_host:error] [pid 13056:tid 2813936672] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/search.svg failed, reason: unable to get the remote host name, referer: https://nextcloudpi:4443/css/ncp.css
[Wed Mar 25 10:20:23.895127 2020] [authz_host:error] [pid 13056:tid 2780333088] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/settings-white.svg failed, reason: unable to get the remote host name, referer: https://nextcloudpi:4443/css/ncp.css
[Wed Mar 25 10:20:23.895622 2020] [authz_host:error] [pid 13056:tid 2805535776] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/close.svg failed, reason: unable to get the remote host name, referer: https://nextcloudpi:4443/css/ncp.css
[Wed Mar 25 10:20:23.896404 2020] [authz_host:error] [pid 13056:tid 2797134880] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/nc-button.svg failed, reason: unable to get the remote host name, referer: https://nextcloudpi:4443/css/ncp.css
[Wed Mar 25 10:20:23.908651 2020] [authz_host:error] [pid 13056:tid 2805535776] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/info-white.svg failed, reason: unable to get the remote host name, referer: https://nextcloudpi:4443/css/ncp.css
[Wed Mar 25 10:20:23.908760 2020] [authz_host:error] [pid 13056:tid 2797134880] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/wizard.svg failed, reason: unable to get the remote host name, referer: https://nextcloudpi:4443/css/ncp.css
[Wed Mar 25 10:20:23.911045 2020] [authz_host:error] [pid 13056:tid 2797134880] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/files.svg failed, reason: unable to get the remote host name, referer: https://nextcloudpi:4443/css/ncp.css
[Wed Mar 25 10:20:23.937420 2020] [authz_host:error] [pid 13056:tid 2805535776] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/info.svg failed, reason: unable to get the remote host name, referer: https://nextcloudpi:4443/css/ncp.css
[Wed Mar 25 10:20:23.937950 2020] [authz_host:error] [pid 13056:tid 2797134880] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/menu.svg failed, reason: unable to get the remote host name, referer: https://nextcloudpi:4443/css/ncp.css
[Wed Mar 25 10:20:23.937594 2020] [authz_host:error] [pid 13056:tid 2813936672] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/red-circle.svg failed, reason: unable to get the remote host name, referer: https://nextcloudpi:4443/css/ncp.css
[Wed Mar 25 10:20:23.948860 2020] [authz_host:error] [pid 13056:tid 2813936672] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:24.033181 2020] [authz_host:error] [pid 13056:tid 2797134880] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /ncp-output.php failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:24.076331 2020] [authz_host:error] [pid 13056:tid 2805535776] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/favicon.png failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:29.606651 2020] [authz_host:error] [pid 13056:tid 2813936672] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:29.632503 2020] [authz_host:error] [pid 13056:tid 2813936672] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:30.698880 2020] [authz_host:error] [pid 13056:tid 2805535776] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:48.706091 2020] [authz_host:error] [pid 13056:tid 2813936672] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:48.706091 2020] [authz_host:error] [pid 13056:tid 2771932192] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /img/green-circle.svg failed, reason: unable to get the remote host name, referer: https://nextcloudpi:4443/css/ncp.css
[Wed Mar 25 10:20:48.706091 2020] [authz_host:error] [pid 13056:tid 2805535776] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to / failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:48.813287 2020] [authz_host:error] [pid 13056:tid 2805535776] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to / failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:48.813595 2020] [authz_host:error] [pid 13056:tid 2805535776] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /index.php failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:48.910880 2020] [authz_host:error] [pid 13056:tid 2805535776] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /index.php failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:54.305574 2020] [authz_host:error] [pid 13056:tid 2805535776] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /css/ncp.css failed, reason: unable to get the remote host name, referer: https://nextcloudpi:4443/?app=nc-maintenance
[Wed Mar 25 10:20:54.395397 2020] [authz_host:error] [pid 13056:tid 2771932192] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:54.423228 2020] [authz_host:error] [pid 13056:tid 2797134880] [client fe80::e565:d125:acc2:540d:53735] AH01753: access check of 'localhost' to /ncp-output.php failed, reason: unable to get the remote host name
[Wed Mar 25 10:20:58.217263 2020] [mpm_event:notice] [pid 877:tid 3069239824] AH00493: SIGUSR1 received.  Doing graceful restart
[Wed Mar 25 10:20:58.244309 2020] [ssl:warn] [pid 877:tid 3069239824] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Wed Mar 25 10:20:58.245569 2020] [mpm_event:notice] [pid 877:tid 3069239824] AH00489: Apache/2.4.38 (Raspbian) OpenSSL/1.1.1d configured -- resuming normal operations
[Wed Mar 25 10:20:58.245591 2020] [core:notice] [pid 877:tid 3069239824] AH00094: Command line: '/usr/sbin/apache2'
[Wed Mar 25 10:21:00.254577 2020] [authz_host:error] [pid 22385:tid 2813936672] [client fe80::e565:d125:acc2:540d:53745] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name
[Wed Mar 25 10:21:00.272481 2020] [authz_host:error] [pid 22385:tid 2813936672] [client fe80::e565:d125:acc2:540d:53745] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name

do you have an external URL correctly setup?
do you have a letsencrypt-certificate for that URL installed?

yes, I applied for a sublevel domain at “NoIP” and also installed a letsencrypt-certificate

did you type the valid and certifficatled URL correctly to your nc-android-app?
https://my.valid.URL.here ?

yes. everything else except the automated upload works on my phone. I can access the data that is already in the cloud and can download it.

umm… the log you provided claims that there is a problem with an unknown host… but wells… it could be not connected to your actual problem.

i think you should try and find out about the logs on your android phone… and maybe nextcloud.log itself, right after your tried to connect.

maybe you’re using a wrong TLS-version… but this is just guessing. i’m sorry that i can’t be of any more help for you

alright, I think it is due to the fact that I have not yet managed to setup my wifi router in such a way that I can use the web-adress also from withing my wifi. I.e. if I connect from my local pc to the nextcloud I use “https://nextcloudpi” instead of the internet adress.

If I use a different wifi with my mobile phone he uploads everything without problems.

Maybe it’s a problem inside the apache config?
Can you post you apache ssl config?

where would I usually find it?

I’ve never used a NextcloudPi, but i think for a Debian the apache configs should be in
/etc/apache2/sites-enabled/

there are these config files: 000-default.conf ncp.conf nextcloud.conf

Can you post the content of file nextcloud.conf?
cat /etc/apache2/sites-enabled/nextcloud.conf | grep -v "#"

<IfModule mod_ssl.c>
  <VirtualHost _default_:443>
    DocumentRoot /var/www/nextcloud
ServerName <myservername>.ddns.net
    CustomLog /var/log/apache2/nc-access.log combined
    ErrorLog  /var/log/apache2/nc-error.log
    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/<myservername>.ddns.net/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/<myservername>.ddns.net/privkey.pem
  </VirtualHost>
  <Directory /var/www/nextcloud/>
    Options +FollowSymlinks
    AllowOverride All
    <IfModule mod_dav.c>
      Dav off
    </IfModule>
    LimitRequestBody 0
    SSLRenegBufferSize 10486000
  </Directory>
</IfModule>