Nextcloud Drama

I run an instance of Nextcloud for storing files, contacts, calendars and similar things that most other people use Google or Microsoft for. I self-host the server, as should be done to truly own the data, but about a month ago, the official Nextcloud app on my phone stopped working for no discernible reason.

I have got to where fixing that was the next task, so that’s what I tackled today. At first glance, the problem was that I was running an ancient version of Nextcloud (16.0.1.1! Yikes!), so the first order of business was to update to a newer version.

I tried using the built-in updated, but every time it hung up and refused to upgrade to 17.x. Even manually clearing out the update and restarting it failed. I looked into doing a manual update, but the Virtual Machine it was running on ran out of disk space.

Since I initially installed the Nextcloud Appliance from Turnkey Linux, I checked over there to see if there was an update I could install and be done in 15-20 minutes including the download. A quick look at the appliance and it was still the same version (V16.0). A new install won’t help.

The last thing to try was to install Nextcloud directly to my Network Attached Storage (NAS) server that runs Archlinux. A quick look at the packages and there is an officially supported package (community repo) and it is a much newer 20.0.3. Doing it this way, it would get updated with the rest of the software on the system and I wouldn’t have to specifically handle an update unless something broke. Only problem:

It’s Archlinux, and the installation is completely manual, so it was going to take at least a couple hours if everything went right. About two and a half hours later, I finally had it setup. Login from the workstation, and everything looks file. Login from the phone browser and it works fine. Login from the Nextcloud App and…. Nope! Crap…

Back to troubleshooting. It was unlikely that the software was the problem, and I’m not going to be able to fix the problem if its an app bug, so I started looking at the rest. Turn off WiFi, try to login. Fail. Turn WiFi back on and try again. Success? Huh? Followed quickly by a “Can’t connect to server”. Hmm…

Backing up, I have the NAS in a closet in my house and an encrypted connection to a Virtual Private Server (VPS) with nice static IP addresses. All the web-based services are HTTPS and the VPS does not have the private keys. Instead it uses socat, a socket relay, to forward TCP connections to ports 80 and 443 to the closet server. A bit convoluted, but it mostly works. But looking closer at it, it only does so for IPv4. The VPS has both IPv4 and IPv6 addresses and DNS has both A and AAAA records.

I suspect what happened is that the phone finally started to use IPv6 and in doing so, was unable to connect to the server. The fix turned out to be just adding a -6 flag to the commands that launch the relays and everything works.

Now to rebuild the contacts and calendars…again…

Comments