Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
andyjbm opened this issue Jun 23, 2020 · 0 comments
Open

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

andyjbm opened this issue Jun 23, 2020 · 0 comments
Labels

Comments

@andyjbm
Copy link

andyjbm commented Jun 23, 2020

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants