Sunday, February 14, 2016

ownCloud 8.1 APCu Memcache error

Yet another error I encountered while tweaking my ownCloud installation on my VPS at time4vps.eu. I was trying to enable the APCu memory caching to improve performance on my ownCloud 8.1 running with php 5.5.9 on an Ubuntu 14.04 server. 

Problem

I was following the guide and instructions found under doc.owncloud.org, however I quickly encountered a problem. Upon installing php5-apcu with
sudo apt-get install php5-apcu
and enabling it as per the guide, I was greeted with a white screen when trying to log in to owncloud. No error messages, it seemed the server just didn't load. No entries in logs under /var/log/. Interesting.

Solution

It took me a while to figure out what happened, finally I stumbled upon this github issue 14386.

Basically it turns out that in Ubuntu 14.04 if you install php5-apcu with apt-get install you will get APCu version 4.0.2 and the required version for ownCloud is 4.0.6 at least. Hence you need to remove the one installed form the repository and install a later version manually.

To check if this is indeed your issue do,
sudo dpkg -s php5-apcu
This should return the currently installed php5-apcu version. If this is older than 4.0.6 then continue reading.
  1. Remove the old APCu version (if installed via apt-get) with
    sudo apt-get remove php5-apcu
  2. Go to http://mirrors.kernel.org/ubuntu/pool/universe/p/php-apcu/ and copy the link to a version 4.0.6 at least which corresponds with your system's architecture.
  3. cd /tmp/
  4. sudo wget http://mirrors.kernel.org/ubuntu/pool/universe/p/php-apcu/php5-apcu_4.0.7-1build1~ubuntu14.04.1_amd64.deb
    (since my system is amd64 architecture)
  5. Install manually with dpkg
    sudo dpkg -i php5-apcu_4.0.7-1build1~ubuntu14.04.1_amd64.deb
  6. Remove downloaded file
    sudo rm php5-apcu_4.0.7-1build1~ubuntu14.04.1_amd64.deb
  7. Restart your apache2 server
    sudo /etc/init.d/apache2 restart
Note: Make sure you download the correct .deb file, i.e. amd64 or i386.
You can check what kind of system you have with uname -a.

Additional to ownCloud Caching Guide

In addition to the official doc.ownCloud.org guide you might have to adjust some settings in your /etc/php5/cli/php.ini if your installation is still not working. First check if apc.enable is "On" in your php.

Check,
php -i
And look for
apc.enable_cli => On => On
apc.enabled => On => On
If any of them is Off then this is your problem. Edit your php.ini with,
sudo nano /etc/php5/cli/php.ini
and copy the following into the file,
;;;;;;;;;;;;;;;;;;
;Memory chacing  ;
;;;;;;;;;;;;;;;;;;

;Added manually to enable memory chancing for ownCloud
apc.enable_cli=1
Press CTRL+O for saving and CTRL+X for exiting.

Restart apache with
sudo /etc/init.d/apache2 restart
It should work now. If not, you can leave me a message and I will do my best to get back to you or you can also join the IRC channel at #owncloud for some help.

Saturday, February 13, 2016

ownCloud "Server Not Installed" Error on Android Client

I have a server from the guys at time4vps.eu where I am running - among other things - an ownCloud instance. It was basically just a learning exercise to get it up and running, maybe invite a few friends if interested. Then I started also looking at certificates from letsencrypt.org and set up some sub-domains for my server.

Issue

The point where I ran into an issue was after I set up my sub-domains and the required encryption certificates. For some reason the browser login would work, but on my Android device I got an error from various apps saying,
"Server not Installed!"
This was weird, because desktop clients were syncing with absolutely no problem.

Solution

I was clueless for a long time and honestly demotivated to fix this, because I wasn't using it so often. Nevertheless, it was bothering me and whenever I logged into my server I remembered that something is broken and needed to be fixed.

I have spent hours trying to troubleshoot, unfortunately the error logs
/var/log/apache2/error.log
/var/log/owncloud.log
were empty or contained nothing related to the issue.

Finally after some IRC help and searching I stumbled upon the solution at forums.owncloud.org,

In /var/www/owncloud/config/config.php I had an entry
'installed' => 'true',
this had to be replaced by
'installed' => '1',
I have no clue as to why or how this error occurs, however possible there are some issues with the installation. Nevertheless, after changing this entry and restarting my apache the Android client worked right away.

Note: Depending on your installation of owncloud config.php might be elsewhere, e.g. /var/www/config/config.php if you installed it to the "root" web directory.
Editing the file is done by sudo nano /path/to/owncloud/config/config.php

I am troubleshooting further to find the true source of the error, but one issue has been fended off.