Skip to content

Backup not working because of a service-runner redis issue. #64

Description

@andyjbm

So just upgraded from v9.8 to v10.3.2 via a more or less manual reinstall of emoncms on a debian system which was reasonably painless considering emoncms is built for PIs

I did this to be able to backup my system from the webgui. However it didn't work. Pressing the backup button, absolutely nothing happened.

The problem. The backup_controller.php uses this line to push to redis:
$redis->rpush("service-runner","$export_script $export_flag>$export_logfile")

But the service-runner.py was doing nothing. A little bit of python monitoring thus:

import redis
server = redis.Redis()
with server.monitor() as m:
   for command in m.listen():
      print (command)

...revealed that when pressing the Create backup button backup_controller.php was sending this to redis: (shortened a bit..)

u'command': u'RPUSH emoncmsservice-runner /opt/emoncms/modules/backup/emoncms-export.sh

But this code in service-runner.py:

      if server.exists('service-runner'):
        flag = server.lpop('service-runner')
      elif server.exists('emoncms:service-runner'):
        flag = server.lpop('emoncms:service-runner')

checks for 'service-runner' or 'emoncms:service-runner and not the 'emoncmsservice-runner' which is being posted by the .php

Note the discrepancy over the colon after 'emoncms' and before 'service-runner'
I've not discovered yet where this is set in emoncms so for now I modifed the service-runner.py file and removed the colon from there. Once this was done the service-runner picked up the script and the backups sprang into life.

For the record my settings.ini file has this relating to redis:

; Redis Database (used as a cache for improved performance)
[redis]
enabled = true
host = 'localhost'
port = 6379
auth = ''
dbnum = ''

So it looks like a bug and not a configuration problem. Or at least a very nasty gotcha!
I thought this would be useful to know.

Posted in backup as that's what was being affected for me although it could be a service-runner issue or and emoncms (config but where?) issue.

Thanks.
Andy.

Edit: code formatting barf...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions