[GH-ISSUE #1424] logparser fails to create RRD directory #1130

Closed
opened 2026-02-27 11:15:26 +03:00 by kerem · 3 comments
Owner

Originally created by @jficz on GitHub (Mar 5, 2018).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1424

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.

Originally created by @jficz on GitHub (Mar 5, 2018). Original GitHub issue: https://github.com/modoboa/modoboa/issues/1424 # 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.
kerem closed this issue 2026-02-27 11:15:27 +03:00
Author
Owner

@tonioo commented on GitHub (Mar 7, 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?

<!-- gh-comment-id:371218368 --> @tonioo commented on GitHub (Mar 7, 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?
Author
Owner

@jficz commented on GitHub (Mar 8, 2018):

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.

<!-- gh-comment-id:371630800 --> @jficz commented on GitHub (Mar 8, 2018): 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.
Author
Owner

@tonioo commented on GitHub (Mar 15, 2018):

This issue was moved to modoboa/modoboa-stats#40

<!-- gh-comment-id:373293995 --> @tonioo commented on GitHub (Mar 15, 2018): This issue was moved to modoboa/modoboa-stats#40
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#1130
No description provided.