Desktop Client - Connection Closed

I keep getting this error when I try and use the desktop client to connect to my server and can’t get to the bottom of why.

All I get from the client’s log is this:
12-22 12:42:24:906 13384 OCC::SocketApi::slotNewConnection: SocketApi: New connection QLocalSocket(0x653cce8)
12-22 12:42:24:925 13384 OCC::SocketListener::sendMessage: SocketApi: Sending message: "SHARE_MENU_TITLE:Share with Nextcloud"
12-22 12:42:24:960 13384 OCC::SocketApi::onLostConnection: SocketApi: Lost connection QLocalSocket(0x653cce8)

The web client log provides a little more insight I think:
Warning files Can’t write upload limit to /tmp/oc_tmp_cHgB6s-folder/.user.ini. Please check the file permissions 2017-12-22T12:38:26+0000
Error PHP copy(/home4/MyCloudAcctOnServer/public_html/.user.ini): failed to open stream: No such file or directory at /home4/MyCloudAcctOnServer/public_html/lib/private/IntegrityCheck/Checker.php#192 2017-12-22T12:38:26+0000
Warning core Trusted domain error. “[My.IP.Address]” tried to access using “cloud.MyCloudDomainOnServer.co.uk” as host. 2017-12-21T16:59:28+0000
Warning files Can’t write upload limit to /tmp/oc_tmp_F8VaKP-folder/.user.ini. Please check the file permissions 2017-12-21T16:57:25+0000
Error PHP copy(/home4/MyCloudAcctOnServer/public_html/.user.ini): failed to open stream: No such file or directory at /home4/MyCloudAcctOnServer/public_html/lib/private/IntegrityCheck/Checker.php#192 2017-12-21T16:57:25+0000

My IP Address is in the config as a trusted domain, that doesn’t seem to be the issue.

Any thoughts…?

Trusted domain refers to domain names or IP addresses that you are allowed to use to access the website. For example, if you add cloud.mydomain.co.uk as a trusted domain, then you are allowed to access your site using that domain name. However, as soon as you point somethingelse.mydomain.co.uk to your cloud server, it sees that you accessed it using a non-trusted domain name, so it is not allowed. Or maybe you only have IP addresses defined as trusted domains, then you’ll want to also add the hostname in order to access the server using the hostname.

Therefore, in your error message, cloud.MyCloudDomainOnServer.co.uk must not be defined as a trusted domain, and you should probably add it (if you’ll be accessing your server from that domain).

Another couple of interesting things here:

Make sure your permissions are correct on the /tmp folder and on the /home4/MyCloudAcctOnServer/public_html folder.

WOW, thanks very much for the informative reply, very interesting.

Curiously I did some digging and I discovered why the .user and .htaccess files were not there. I had “show hidden files” turned off in cPanel so therefore it was not copying them.

I have since completely wiped the account on the server and re-installed (with the hidden files) and still get the same message from the desktop client.

So, if I understand your response correctly I need to add my remote IP to the trusted domains list like so…?

‘trusted_domains’ =>
array (
0 => ‘cloud.MyCloudDomain.co.uk’,
1 => ‘www.cloud.MyCloudDomain.co.uk’,
2 => ‘xx.xx.xx.xx’,
),

Mmmm, still getting “Connection Closed”.

Desktop client log: empty
Website log: Also empty

This is frustrating…

Any further thoughts…?

You can try a tempfolder inside your Nextcloud folder:
scroll down to tempdirectory in https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html?highlight=tmp%20folder#all-other-configuration-options

I’m not sure what cpanel sets up by default, perhaps open_basedir()? Then the trick with moving the temp-folder should help.

Thanks but that doesn’t seem to be the issue either. I’ve also tried from my laptop, windows 10 and the same issue.