Since moving my personal Nextcloud instance from an OVH VM to Oracle Cloud Infrastructure, I had problems with certain apps that wouldn't render in the browser, and some of the theme graphical elements weren't displaying.  For over a year, I had been putting up without being able to access Tasks, Notes, or Contacts on the web.  Email and Calendar worked fine, and I could use Notes and Tasks on my phone or tablet.  But it was getting frustrating that I couldn't interact with note content in a browser, and couldn't add or remove task lists from my phone.  Oh, and I had neglected upgrading to a current supported release of Nextcloud, because all of this felt like a big escalating issue that had become intimidating to tackle.  I had told myself I was going to rebuild everything in Docker on a new version, for a mostly clean slate.

Version upgrades and backups

To break the project down to manageable size, I decided to delay switching to Docker containers, and that upgrading was the first priority.  I have a second instance of Nextcloud on my home server, which was also running a slightly outdated version, but everything worked fine.  That was set up awhile ago, and it runs under servername/nextcloud.  Tinkering with the production site hosted through Oracle seemed risky, so I wanted to be safe:

  1. Sync data between instances
  2. Upgrade home server Nextcloud, and resolve any issues
  3. Upgrade production Oracle-hosted Nextcloud

Sync ended up being the long project.  In short, I enabled the setting 'filesystem_check_changes' to make the server detect updated user files, used rclone to sync files in my user subdirectory, and then used pimsync to duplicate calendar entries, tasks, and contacts. (Pimsync still is having trouble with contacts, so I did a manual export and import for now.)

Upgrading from the command line worked great for a single major-version bump, on both servers. Of course, this didn't fix the non-rendering web apps on production, but now I was closer to current and my backup instance is a fair copy of production.

The Nginx server directives I needed

On to the broken apps problem, that only exists on the production site.  Searching the web only yielded people with similar issues, but not quite the same problem.  I broke down and used an AI chatbot, Euria from Infomaniak.  After giving it some detail on what was happening, it had a few things to try that didn't fix it, but it helped me find and investigate errors in the developer console of my browser's rendering engine.  It revealed that Javascript files with the extension .MJS weren't being retrieved, but I ran out of chatbot usage (I hate the term "tokens") for the day before finding the fix. It got me close, because it had mentioned that the failure can be because the server is sending the requests to the PHP interpreter instead of to the browser directly.

From there, it didn't take much searching to find an example of a configuration needed to pass MJS files in Nginx.  This configuration is in the documentation now for installing Nexctloud with Nginx, but I must have used an outdated one, and my configuration was passing .JS but not .MJS.  A little more poking around, and I figured out that some of the other file types I needed to add in order to get some theming elements to load were WEBP and SVG.

Now what next?

I have two working instances of Nextcloud, and all the apps work in the browser now.  Data is synced, but it's manual work to do that.  I haven't decided what to tackle next:

  • Fix contacts sync and automate backups
  • Upgrade both instances to the latest release
  • Containerize Nextcloud (starting with home server)

Before all that, I need to make a real disaster recovery plan: map out what I would need to back up, where to put the backups, and a procedure for rebuilding everything.  That is a huge project though, and it makes sense to start with the home server.  Each app on there has different config and content data to catalog.  It's also a good time to consider moving other apps to containers, and set up tools for managing containers, like Portainer and Kubernetes.