Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

logparser fails to create RRD directory #40

Open
tonioo opened this issue Mar 15, 2018 · 6 comments
Open

logparser fails to create RRD directory #40

tonioo opened this issue Mar 15, 2018 · 6 comments

Comments

@tonioo
Copy link
Member

tonioo commented Mar 15, 2018

From @cptMikky on March 5, 2018 23:14

Impacted versions

  • Modoboa: 1.10.3
  • installer used: No
  • Webserver: Nginx (irrelevant)

Steps to reproduce

root@server# /path/to/venv/bin/python /path/to/modoboa/instance/manage.py logparser

Current behavior

Traceback (most recent call last):
  File "./manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/srv/app/modoboa/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/srv/app/modoboa/venv/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/app/modoboa/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/srv/app/modoboa/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/srv/app/modoboa/venv/local/lib/python2.7/site-packages/modoboa_stats/management/commands/logparser.py", line 588, in handle
    p.process()
  File "/srv/app/modoboa/venv/local/lib/python2.7/site-packages/modoboa_stats/management/commands/logparser.py", line 559, in process
    self.update_rrd(dom, t)
  File "/srv/app/modoboa/venv/local/lib/python2.7/site-packages/modoboa_stats/management/commands/logparser.py", line 257, in update_rrd
    self.lupdates[fname] = self.init_rrd(fname, m)
  File "/srv/app/modoboa/venv/local/lib/python2.7/site-packages/modoboa_stats/management/commands/logparser.py", line 215, in init_rrd
    *params)
rrdtool.OperationalError: Cannot create temporary file

RRD storage directory does not exist and logparser probably doesn't even try to create it.

Expected behavior

Parse log and create RRD files. Create the necessary directory structure and fail properly if that isn't possible.

Command works as expected after the directory is created manually.

Copied from original issue: modoboa/modoboa#1424

@tonioo
Copy link
Member Author

tonioo commented Mar 15, 2018

@cptMikky I don't think the script should be responsible for creating the directory structure. A better option would be to ensure the directory exists when the global setting is modified. What do you think?

@tonioo
Copy link
Member Author

tonioo commented Mar 15, 2018

From @cptMikky on March 8, 2018 21:30

Not sure. Directory structure, especially in /tmp is definitely a responsibility of the owner (the script in this scenario). As for other places, well, hard to tell, I have no single opinion.

However, a directory existence test and a (sane) error message would be enough I guess.

@florealcab
Copy link

I have the same issue on ubuntu 20.04 with modoboa 16.0. Which folder should I create please?

@tonioo
Copy link
Member Author

tonioo commented Oct 6, 2020

@florealcab You can customize the folder in the admin panel (settings).

@yannfill
Copy link

I don't see anything related to statistics in the new or old admin.

In the old admin I get No preferences available.

In the new admin, no tab or option related to statistics.

I have followed all the steps in the README (install plugin, modify settings.py, restart gunicorn).

@yannfill
Copy link

yannfill commented Apr 8, 2023

Nervermind, I was looking at the wrong place. Configuration is in the modoboa menu in the old admin interface.

I had to add sudo policy because the cron command update_statistics wanted to launch this:

sudo -u vmail /usr/bin/doveadm pw -l

It also created a new file new_accounts.rrd, which I think I can ignore safely.

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

No branches or pull requests

3 participants