Redis/feedwriter problem when updating Raspbian

Following steps made it work again for me:

  • sudo apt purge php-redis
  • sudo pecl install redis
  • sudo systemctl restart apache

Taken from here: phpredis extension doesn't work, unable to load 'redis.so' - Stack Overflow

I stumbled upon this error after updating my raspbian from stretch to buster. In my instance EmonCMS is still running on php7.0 and redis library got disabled during update. Apparently the new version was no longer compatible. The hint with the phpversion() and analyzing which extension got loaded by apache helped.

Apart from that the feedwriter service was no longer running as well. It was missing the php mysql package for version 7.3 - the new php version.
/usr/bin/php /var/www/emoncms/scripts/feedwriter.php was giving an error and the system service was no longer active.
Fixed by installing sudo apt install php7.3-mysql.

Hi Reimar and welcome to the forum.

I’m not sure what your problem was but this thread was about installing on openSUSE, which works somewhat differently to Raspbian/Debian.

Anyway, I’m glad to hear you got your problem fixed. :grin:

Did you update or start again? Updating between releases is always hazardous on Debian based systems.

If all you run is Emoncms, I’d recommend taking a backup of EmonCMS (using backup module), starting with a fresh EmonSD image or using the EmonScripts to install and then restoring the backup.

There are other things that might surface like Mosquitto compatibility.

Hm. Thanks for moving this to its own topic … I guess.

Updating the underlying raspbian OS of EmonPi truely comes with its issues but it’s not impossible. Although I wonder why it’s so tightly entangled with the debian configuration. But perhaps that’s an php issue and how packages are being updated in Debian. In the current setup describing the setup as hazardous is true. At least now I know how these services interact. A non-programmer probably would have given up pretty soon. I was curious and did not want to setup everything again. Investing an hour in getting it to run again deemed perfectly fair :slight_smile:

What I previously forgot which may be also a problem in the OpenSuse case is that Apache stopped loading the redis extension for some reason.

In Raspbian this was the case because of the update. It disabled the redis extension for the old Apache PHP 7.0 configuration. It was perfectly working with the newly installed PHP 7.3. But Apache for EmonCMS was configured to use PHP 7.0 for which the redis extension got disabled. Simply enabling did not fix it. But updating redis library with pecl brought it back to life.

During the Raspbian Update following happend:
/etc/php/7.0/mods-available/redis.ini got moved to /etc/php/7.0/mods-available/redis.ini.dpkg-bak.
Which makes perfectly sense when the new redis extension is no longer compatible for whatever reason.
Updating redis libarary and putting the file back in place fixed it.

So in addition to what I wrote on the top following needs to be done:

  • sudo apt purge php-redis
  • sudo pecl install redis
  • mv /etc/php/7.0/mods-available/redis.ini.dpkg-bak /etc/php/7.0/mods-available/redis.ini
  • sudo systemctl restart apache

This is not an OpenSUSE install is it?

Most of these issues will be solved by moving to the new SDCard and that can easily be done by exporting a backup, starting with a new SDCard image and importing the backup.

There were a number of things that were done in the past with Emoncms like getting the mosquitto package from mosquitto.org that no longer need to be done (as the Debian package managers have caught up).

The original install method also had some flaws in that it used the Home directory, again this is now fixed.

PHP7.0 is now End Of Life which is another reason to update to the Buster based image.

True. I was updating my Raspbian from stretch to buster.

Hey, that sounds great. I’ll do a fresh install and check out the backup strategy as soon as I get my new RFM69Pi plus sensors.