modoboa / modoboa-stats

Graphical statistics for Modoboa
MIT License
9 stars 13 forks source link

rrdtool.OperationalError: new_accounts.rrd: illegal attempt to update using time (minimum one second step) #44

Open jaesivsm opened 6 years ago

jaesivsm commented 6 years ago

Impacted versions

Steps to reproduce

root@server# $PYTHON $INSTANCE/manage.py update_statistics
Traceback (most recent call last):
  File "/srv/modoboa/instance/manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_stats/management/commands/update_statistics.py", line 84, in handle
    self.update_account_creation_stats(options["rebuild"])
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_stats/management/commands/update_statistics.py", line 79, in update_account_creation_stats
    rrdtool.update(str(db_path), *data)
rrdtool.OperationalError: /srv/modoboa/rrdfiles/new_accounts.rrd: illegal attempt to update using time 1528812000 when last update time is 1528812000 (minimum one second step)
BioSs54 commented 6 years ago

Have same problem. Have you solved it ??

tonioo commented 6 years ago

Looks like the script tries to record two samples for the same timestamp... Do you have this error every time you run the script? If you run it manually, make sure to respect the defined interval between 2 samples (5 minutes if I remember well)

cremesk commented 5 years ago

Same here. default cron: 0 * * * * root $PYTHON $INSTANCE/manage.py update_statistics