Can't connect with clients to servers (after IP change)

My first post here.

I’m using the nextcloud about a year now. Everything was OK until my hosting changed my IP address (I’m on shared hosting). I use desktop clients, nextcloud app for android, CalDAV and CardDAV for android and notes app for android.

I can connect to nextcloud via web browser, but I’m unable to do it with clients mentioned higher.

I was writing on my hosting support, provided test account for them, they tried to help me, but in the end they wrote me:

I referred through several Nextcloud forums but I could not find any solution for this issue from there. The server side parameters seems to be fine as well. No error message related to this issue are found in the logs as well. Further our support towards third-party applications like Nextcloud are limited. Please contact the Nextcloud support if you still face the same issue.

I use:

  • Nextcloud 12.0.3 on http://angrezphoto.com/mracek
  • Nextcloud desktop client 2.3.2 (build 1) - here I get “connection closed” error
  • PHP 7

If you access your Nextcloud through a domain, a change of the IP address is no problem. It would be more complicated if you access directly via IP address.

Did you try to turn off the client system completely to make sure the DNS cache is cleared? For some operators it can take 24-48h to update DNS entries. On a client, you can use the commands nslookup (Win) or host (Linux) to verify if your system already resolves the new IP address.

Thank you for the help.

I forwarded your reply to my hosting support and they wrote me:

As per the update from the Nextcloud team they have asked us to ensure if your domain is resolving well to the new IP. I have checked and confirmed the DNS has been propagated well around the globe and the domain is already resolving to the new IP address.

…
Here should be some links I can’t sent to this forum as a new user
…

Also from their update it is clear that the IP switch has not caused the issue. Therefore, please contact Nextcloud to know more on the issue you are facing.

I’m not sure what to do next. Would help if I provide someone more experienced then me with testing account?

Have you access to the server and the logfiles? You could at least check the logfiles of the client (F12 opens the logging window). Does it already connect to the new IP?

Can you connect to one of the demo setups? Demo instances of 9, 10, 11 and 12 now live

Without server access it is hard to guess. Perhaps not only the IP address changed but also something in the configuration? You run NC 12.0.3 before and after the migration?

Can you directly connect via webdav with cyberduck or winscp?

You can indeed ping me with a test account if you wish.

Thank you for your help.

Probably yes, but I’m not sure where to find log file. There is error_log in my Nextcloud installation.

Here is log from my client:

10-18 21:11:25:124 6904 OCC::PostfixLineEdit::setFullText: "http://angrezphoto.com/mracek"
10-18 21:11:25:190 6904 OCC::OwncloudSetupWizard::slotDetermineAuthType: Trying to look up system proxy
10-18 21:11:25:195 6904 OCC::OwncloudSetupWizard::slotSystemProxyLookupDone: No system proxy set by OS
10-18 21:11:25:196 6904 OCC::AbstractNetworkJob::start: !!! OCC::CheckServerJob created for "http://angrezphoto.com/mracek" + "status.php" "OCC::OwncloudSetupWizard"
10-18 21:11:25:672 6904 OCC::CheckServerJob::finished: status.php returns:  QMap(("edition", QVariant(QString, ""))("installed", QVariant(bool, true))("maintenance", QVariant(bool, false))("needsDbUpgrade", QVariant(bool, false))("productname", QVariant(QString, "Nextcloud"))("version", QVariant(QString, "12.0.3.3"))("versionstring", QVariant(QString, "12.0.3")))   QNetworkReply::NetworkError(NoError)  Reply:  QNetworkReplyHttpImpl(0x62942e0)
10-18 21:11:25:672 6904 OCC::OwncloudWizard::appendToConfigurationLog: Setup-Log:  "<font color=\"green\">Úspěšně připojeno k http://angrezphoto.com/mracek/status.php: Nextcloud verze 12.0.3 (12.0.3.3)</font><br/><br/>"
10-18 21:11:25:672 6904 OCC::OwncloudSetupWizard::slotOwnCloudFoundAuth: void OCC::OwncloudSetupWizard::slotOwnCloudFoundAuth(const QUrl&, const QVariantMap&)  was redirected to "http://angrezphoto.com/mracek"
10-18 21:11:25:672 6904 OCC::AbstractNetworkJob::start: !!! OCC::DetermineAuthTypeJob created for "http://angrezphoto.com/mracek" + "" "OCC::OwncloudSetupWizard"
10-18 21:11:26:112 6904 OCC::AbstractNetworkJob::slotFinished: void OCC::AbstractNetworkJob::slotFinished() QNetworkReply::NetworkError(AuthenticationRequiredError) "HostitelskĂ˝ poÄŤĂ­taÄŤ poĹľaduje autentizaci" QVariant(int, 401)
10-18 21:11:26:127 6904 OCC::DetermineAuthTypeJob::finished: virtual bool OCC::DetermineAuthTypeJob::finished() ""
10-18 21:11:26:143 6904 OCC::OwncloudWizard::slotCurrentPageChanged: Current Wizard page changed to  1
10-18 21:11:36:061 6904 OCC::OwncloudSetupWizard::slotConnectToOCUrl: Connect to url:  "http://angrezphoto.com/mracek"
10-18 21:11:36:061 6904 OCC::OwncloudWizard::appendToConfigurationLog: Setup-Log:  "Pokouším se připojit k Nextcloud na http://angrezphoto.com/mracek..."
10-18 21:11:36:062 6904 OCC::AbstractNetworkJob::start: !!! OCC::PropfindJob created for "http://angrezphoto.com/mracek" + "/" "OCC::OwncloudSetupWizard"
10-18 21:11:41:619 6904 OCC::AbstractNetworkJob::slotFinished: void OCC::AbstractNetworkJob::slotFinished() QNetworkReply::NetworkError(RemoteHostClosedError) "SpojenĂ­ ukonÄŤeno" QVariant(Invalid)
10-18 21:11:41:619 6904 OCC::PropfindJob::finished: PROPFIND request *not* successful, http result code is 0 ""

I didn’t sync the files, but I could connect to all of them.

I think so too, but my hosting support don’t know what can cause it or what changed. After IP change I have similar problem with FTP client, but they fix it by allowing some ports.

I just updated to NC 12.0.3 after migration.

I tried webdav with winscp, but I wasn’t able to see files. I get error:
“405 Method Not Allowed”

I couldn’t find option to send you PM (maybe because I’m new in this community?).

This looks like a configuration problem on your server, there is quite an exhaustive list of possible problems:

(is a bit dated but most should be still valid).

Could be that not all required http verbs are allowed. The NC client also fails on the PROPFIND request.

I’m getting a connection closed error with the supplied credentials also, so I side with @tflidd here in that your setup will be the reason. Do you see logs from my attempt 5 mins ago?

Check your NC logs, and apache logs.

Thank you for your help,

I was all day at work, so I will try to find logs and read the recommended topic tomorrow.

Is it apache webserver? As all webdav connections seem to fail, might it be through activated apache dav module? This should be deactivated by webserver config, like given in example config on admin manual. I don’t know if .htaccess also does this, I am currently not on computer to check. In case update your .htaccess to the default one, shipped by nextcloud zip.

€: Just checked here: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#apache-web-server-configuration
There you see that dav module is turned off. It should be possible to add this to .htaccess (of course AllowOverride All need to be set server side)? Wonder why it is not inside by default. Just found the default one here on github and can’t find some directive to disable dav: https://github.com/nextcloud/server/blob/master/.htaccess

I gave address to this topic to my hosting support (as they have better knowledges about servers than me) and they wrote me (I changed the IP address in log):

I was able to replicate the error & found the below error in the apache log:

[Fri Oct 20 23:52:23.965970 2017] [core:error] [pid 892:tid 139953178633984] (104)Connection reset by peer: [client xxx.yy.zz.111:1472] AH0057
4: ap_content_length_filter: apr_bucket_read() failed

I tried to tweak some settings, but it did not work. I’ve contacted cPanel support to investigate the issue further as it seems out of our support scope.

I went through the forum provided by you & made sure that the apache dav module is enabled in the server, tried whitelisting the IP from which I tried to connect to make sure that this isn’t related to the firewall.

Now they investigate it and try to figure out what is wrong.

Unfortunately my hosting support wasn’t able to fix the issue I have. They wrote me:

We checked this issue with the cPanel support but unfortunately they were not able to solve the issue with next cloud that you are facing. It could also be due the difference in OS of the servers. The old server was using CentOS 6.9 and the current server is running in CentOS 7. We are not able to find any other solutions to fix this issue. Please check with the Nextcloud support team with the error message that we have provided earlier and based on their solution if anything need to be done in the server, we shall make the necessary changes. Thank you for understanding.

This was just an IP change right? Because they’re talking about an OS upgrade there too.

Is it a fresh server and install then? CentOS firewall is on by default isn’t it? Worth checking if that’s not blocking it?

Thank you for your ideas. I send your questions to my hosting support and here are the answers:

Please note that we migrated your site to the new server which is running CentOS 7. But the old server was running with CentOS 6.9. Technically, yes its an OS upgrade. Also we switched the IP address of the site to point to the new server. We always keep all our systems to up-to-date with the latest software.

Yes it was a fresh server installation. The server is being protected by the firewall “CSF”. I could see that things seems to be fine with the firewall. I disabled the firewall in the server for a minute and tried to connect using the nextcloud app and I am still getting the same error message. It does not seems to be an issue with the firewall in the server. In case if any custom changes has to be made in the firewall for this to work, please let us know so that we shall review it and let you know if its possible since this is a shared server.

For a few months I tried to use Nextcloud via web interface and was hoping the problem with connection of apps will solve somehow itself. Unfortunately it didn’t and I want to use clients on PC and android again, so I contacted with this issue support on my hosting and they wrote me:

I have checked your issue. I have installed an instance of Nextcloud in the directory “cirrustest”. We are able to access the nextcloud from Web Browser, but we are getting the same error mentioned in the previous updates while accessing Nextcloud through desktop client app.


 [Wed Apr 18 01:29:52.284830 2018] [core:error] [pid 921:tid 140353340397312] (104)Connection reset by peer: [client 208.69.59.132:24923] AH00574: ap_content_length_filter: apr_bucket_read() failed

As next cloud is loading fine from the Web Browser this might be a compatible issue with Nextcloud client app. Please contact the Nextcloud support for further assistance. We had already checked this with cPanel support as well as Senior admins here.