Enabling Redis is causing issues in emonCMS

[ Discussion moved from Does the emonTx Shield need an actual Arduino? ]

sooo i just enabled REDIS…

ideas?

no errors on emoncms.log

What do you have listed in the Redis section of the emoncms admin page?

and what version of php and phpredis do you have installed ?

so now it loads (after reboot) im shows:

and screen as requested

have you tried using the database check on the admin page ?

I have seen something like this before but cannot recall off hand what it was,

PS - I think I’ll move this redis discussion to another thread as it has little to do with this discussion.

yes, it did an update once right at the beggening… now it says nothing to do.

Third time lucky maybe? :slight_smile:

[email protected]:~ $ php --version
PHP 5.6.29-0+deb8u1 (cli) (built: Dec 17 2016 06:04:43)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

and

[email protected]:~ $ redis-server --version
Redis server v=2.8.17 sha=00000000:0 malloc=jemalloc-3.6.0 bits=32 build=7893cf7a6bbbe347

and

What version of phpredis did you install?

not sure on that one :o I followed this:

There are choices in that guide that I have no way of knowing what you chose.

I also see there is an error in the guide regards installing the php redis module.

Can you create a file called “info.php” in the emoncms folder containing this one line ?

<?php phpinfo(); ?>

Then navigate to emoncms/info.php in a brozser and scroll down to the “Redis” section and see what version it is?

if you foloowed the guide you may have ended up with phpredis version 2.3.x for php7 even though you should be running v2.2.7 or v2.2.8 for php5.x, whether that is the case or is the issue I cannot say but either way it needs to be correct.

php5 needs phpredis 2.2.7 or 2.2.8
php7 needs phpredis 2.3.0<

Are you running Ubuntu 14.04 or 16.04? or are you using Raspbian ?

Redis Version 2.2.5

Using Raspbian

I’m thinking just removing REDIS and reinstall via apt-get, that should get me up to date with correct versions…

Your Redis version is v2.8.17, the same as mine, it is the correct version and mine was installed via apt-get.

I still do not know how you have installed your setup, the guide you linked is for Linux Ubuntu and the very first line says “This guide should work on most debian systems including Ubuntu. For installation guide on installing emoncms on a raspberrypi see raspberrypi installation guides.”, Did you continue to use this guide or use the Raspberry Pi guide?

Redis version 2.2.5 is the current version in a Debian package via apt-get, it was found to cause Apache to crash due to segmentation errors.

The guide you linked has instructions to install the latest phpredis from PECL without regard for the version of PHP you are running, so it would have resulted in v2.3.1. Where as the Pi guide explains the need to use a version greater than v2.2.7 and includes a guide to download and install it from Github. So if you have 2.2.5 you must have used apt-get and not followed either of these guides that closely.

My recommendation is to do this

  • remove phpredis v2.2.5 with
sudo apt-get purge php5-redis
  • install phpredis v2.2.7 via PECL with
sudo pecl install redis-2.2.7
sudo sh -c 'echo "extension=redis.so" > /etc/php5/mods-available/redis.ini'
sudo php5enmod redis
sudo redis-cli flushall

Technically v2.2.8 might be a better version as it is later, but I do not know if anyone has tried it, v2.2.7 is the version most if not all php5 systems including the emonSD is using.

If you can confirm EXACTLY which guide you used and highlight any options taken or changes you made it would make debugging much easier.

Is your Pi running a hdd or just on a SD card ? Have installed and configured as low-write to protect the SD card?

Okay my bad, it was the rPi guide… i can see on my history the commands and i can see i used the ones just as you wrote… I used the other guide before on my test VM and thus where I’m getting confused from :frowning:

I remember reading the note about the Apache crashing with current sources…

Having said that i have not made any changes other then make emonCMS load on root rul instead of /emoncms.

pi is on a SD and have not yet enabled any of the low-write options.

Okay, so if you follow my recommendation above to remove v2.2.5 and install v2.2.7, when you browse to /info.php and check the redis section again it should say v2.2.7, then retest and see if the the input and feeds pages load.

2.2.7 installed and enabled:

only have one feed?

and confirmed as v2.2.7 in info.php?

yap

Are there any errors logged in emoncms.log ? and can you see any errors highlighted via the developer mode of your browser (F12)? We need some clues!

ohh :smiley: its working… just hope it wont break again haha

there were no errors on emoncms.log, i seem to have fixed it by disabling REDIS support and then using FLUSHALL command using redis-cli, i guess the question is why where they out of sync?

I think the reason is more likely to be the fact you have changed from using a version that is known to give issues to a version that is known to be ok, the flushing just removed anything that was originally processed with the old version.

EDIT - I have updated the instructions in my post above to include “redi-cli flushall” for future readers of this thread.

1 Like