-
Notifications
You must be signed in to change notification settings - Fork 12
Graph suddenly stopped #55
Comments
Hi! If I manually launch :
Nothing found in various logs. |
And with:
|
@stefaweb For the first one, it looks like you have some strange characters in the mail log file, or an issue with encoding. Can you check the file's encoding? |
I got this with Postfix log file:
Postfix version:
|
@stefaweb Can you check if there is any message in french in the log file? |
@tonioo Can you be more specific? |
@stefaweb Do you see non ascii content in the /var/log/mail.log file? (like words with accents, etc.) |
Found this:
|
The date of the recording in the logs seems to correspond to the stop of the recording of the graphs. |
@stefaweb This is the reason why the script fails... I'll try to fix it but in the meantime, you can remove this line from the file and stats should work again. |
ok |
Stats are back. I still have the error message with rrdfiles using update_statistics. |
@tonioo
|
@tonioo
To self.f = io.open(self.logfile, encoding="utf-8", errors="ignore") # Ignores unknown characters (You can use "replace" to replace unknown characters) As a hotfix and everything works again! ... i can create PR if you want ? |
@Salamek Ignoring encoding errors can lead to data loss according to python documentation... I'm not sure it's the right way to fix this if we want accurate stats. |
@tonioo only way we can get non UTF-8 characters in mail.log is from Email Subject/From name snippet inserted into log...
Other options are just too crazy 😄 and just not worth the trouble... |
@Salamek indeed. But since we can non ascii characters in address and domain now, I wonder how the script will behave... |
@tonioo IDN is(should be) converted to punycode... so still ASCII for us... |
If you use postfix internationally, you will hit this error. I believe this is the right fix, because those log files are NOT utf-8 encoded, so you should not read it as utf-8, but with the real encoding of that file. Fixes: modoboa/modoboa#1788, modoboa#55, modoboa#38, ``` root@h7-mailsrv:/etc/cron.d# /srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py logparser 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/logparser.py", line 587, in handle p.process() File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_stats/management/commands/logparser.py", line 552, in process for line in self.f.readlines(): File "/srv/modoboa/env/lib/python2.7/codecs.py", line 314, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf8' codec can't decode byte 0xc1 in position 949: invalid start byte ```
I got a similar error tonight: UnicodeDecodeError:
The logparser should handle UTF-8 exceptions gracefully, there's nothing I can do to prevent error messages containing such invalid snippets from being inserted. |
Modoboa: 1.13.1
Modoboa-stat: 1.4.1
OS: Debian Stretch
The graph on my production serveur suddenly stopped to work.
Do we have a way to know what is happening?
The text was updated successfully, but these errors were encountered: