[GH-ISSUE #1244] Cronjob fails $PYTHON $INSTANCE/manage.py update_statistics #1013

Closed
opened 2026-02-27 11:14:44 +03:00 by kerem · 9 comments
Owner

Originally created by @TonyBostonTB on GitHub (Sep 21, 2017).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1244

Impacted versions

  • Modoboa: 1.9.0
  • installer used: Yes
  • Webserver: Nginx
  • OS: Centos 7
  • DB: Postgresql

Traceback

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/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/srv/modoboa/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/srv/modoboa/env/lib/python2.7/site-packages/django/core/management/base.py", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/srv/modoboa/env/lib/python2.7/site-packages/django/core/management/base.py", line 345, in execute
    output = self.handle(*args, **options)
  File "/srv/modoboa/env/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/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 1505988000 when last update time is 1505988000 (minimum one second step)
Originally created by @TonyBostonTB on GitHub (Sep 21, 2017). Original GitHub issue: https://github.com/modoboa/modoboa/issues/1244 # Impacted versions * Modoboa: 1.9.0 * installer used: Yes * Webserver: Nginx * OS: Centos 7 * DB: Postgresql # Traceback ``` 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/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line utility.execute() File "/srv/modoboa/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/srv/modoboa/env/lib/python2.7/site-packages/django/core/management/base.py", line 294, in run_from_argv self.execute(*args, **cmd_options) File "/srv/modoboa/env/lib/python2.7/site-packages/django/core/management/base.py", line 345, in execute output = self.handle(*args, **options) File "/srv/modoboa/env/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/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 1505988000 when last update time is 1505988000 (minimum one second step) ```
kerem 2026-02-27 11:14:44 +03:00
Author
Owner

@tonioo commented on GitHub (Sep 22, 2017):

Looks like the cron job is running twice at the same time... Did you install modoboa manually?

<!-- gh-comment-id:331372402 --> @tonioo commented on GitHub (Sep 22, 2017): Looks like the cron job is running twice at the same time... Did you install modoboa manually?
Author
Owner

@TonyBostonTB commented on GitHub (Sep 22, 2017):

nope, I used the installer

<!-- gh-comment-id:331372809 --> @TonyBostonTB commented on GitHub (Sep 22, 2017): nope, I used the installer
Author
Owner

@tonioo commented on GitHub (Sep 22, 2017):

Do you see this error each time the command is executed?
Can you please check the cron job definition inside /etc/cron.d/modoboa, it should run every 5 minutes.

<!-- gh-comment-id:331377049 --> @tonioo commented on GitHub (Sep 22, 2017): Do you see this error each time the command is executed? Can you please check the cron job definition inside ``/etc/cron.d/modoboa``, it should run every 5 minutes.
Author
Owner

@sorcer1122 commented on GitHub (Sep 29, 2017):

I am also having the very same error but I suspect this is because I added 'manage.py update_statistics' to crontab file. This is not required, is it?

<!-- gh-comment-id:333034606 --> @sorcer1122 commented on GitHub (Sep 29, 2017): I am also having the very same error but I suspect this is because I added 'manage.py update_statistics' to crontab file. This is not required, is it?
Author
Owner

@tonioo commented on GitHub (Oct 3, 2017):

@sorcer1122 This is indeed optional but you're seeing this error because the RRD file is updated twice for the same timestamp. How did you configure the crontab?

<!-- gh-comment-id:333882549 --> @tonioo commented on GitHub (Oct 3, 2017): @sorcer1122 This is indeed optional but you're seeing this error because the RRD file is updated twice for the same timestamp. How did you configure the crontab?
Author
Owner

@sorcer1122 commented on GitHub (Oct 4, 2017):

@tonioo I had the following in my crontab:

0 * * * * /srv/modoboa/instance/manage.py update_statistics

Once I commented it out, the error disappeared. Most probably because /etc/cron.d/modoboa had the same string.

<!-- gh-comment-id:334058325 --> @sorcer1122 commented on GitHub (Oct 4, 2017): @tonioo I had the following in my crontab: 0 * * * * /srv/modoboa/instance/manage.py update_statistics Once I commented it out, the error disappeared. Most probably because /etc/cron.d/modoboa had the same string.
Author
Owner

@tonioo commented on GitHub (Oct 10, 2017):

@TonyBostonTB Can you check the /etc/cron.d/modoboa to check if the update_statistics command appears only once?

<!-- gh-comment-id:335540384 --> @tonioo commented on GitHub (Oct 10, 2017): @TonyBostonTB Can you check the /etc/cron.d/modoboa to check if the update_statistics command appears only once?
Author
Owner

@kryskool commented on GitHub (Apr 7, 2018):

ping @TonyBostonTB

<!-- gh-comment-id:379463013 --> @kryskool commented on GitHub (Apr 7, 2018): ping @TonyBostonTB
Author
Owner

@TonyBostonTB commented on GitHub (Apr 7, 2018):

@kryskool sorry, not using it anymore

<!-- gh-comment-id:379480989 --> @TonyBostonTB commented on GitHub (Apr 7, 2018): @kryskool sorry, not using it anymore
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1013
No description provided.