Breaking Things: ownCloud

Thursday afternoon, I’d snapped a photo with my phone of my goats, and headed into my office to edit it for a web page. Opening my InstantUpload, folder found it empty. Why was my phone not syncing to ownCloud? It was a mystery!

The mystery deepened when I VNCed over to my ownCloud server. I couldn’t get in. It took 10 minutes to make a connection into the server. It was running slow as molasses in winter. Opening system information found thousands of internal connections between localhost and localhost. Weirdest thing I have ever seen.

A log snip:
127.0.0.1:3306    ESTABLISHED    127.0.0.1:42014    tcp
127.0.0.1:41967    ESTABLISHED    127.0.0.1:3306    tcp
127.0.0.1:3306    ESTABLISHED    127.0.0.1:42014    tcp
127.0.0.1:42008    ESTABLISHED    127.0.0.1:3306    tcp

Over and over, thousands of times. The result of all of these concurrent connections were to eat 100% of the processor and memory, preventing the computer from doing anything at all!

Finally, I was able to SSH into my ownCloud server, and force an apache2 server shut down. Of course the problem instantly went away.

2 hours of searching on line, found several potential causes, but none of the fixes I found would help.

With the web server no longer running, I was able to back-up my www directory and ownCloud mySQL databases to an external drive, just in case!

What better time to upgrade to ownCloud 7!

Following the instructions from the ownCloud web site, I installed version 7 to my server. The upgrade did not go without a bump or two. For starters, it installed using sql-light, ignoring the fact that I already had a mySQL database installed and running.

Fixing that was pretty simple though, just edit the config.php file in ownCloud, finding the line:   ‘installed’ => true,
and change it to:  ‘installed’ => false,

Then start ownCloud in your browser again, create a NEW admin user name and password, and point ownCloud to your mySQL database from the previous version. ownCloud will then attach itself to your database and everything will be back to normal. One thing though, using the new admin credentials, reset the passwords for your current users, and your old admin account. After that, you can log in with your previous user name and find all of your files still intact.

It was a long couple of days getting it all up and running again, but it’s worth it. ownCloud is wonderful software!