[GH-ISSUE #2613] Stats do not work after fresh 2.0.1 install #1655

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

Originally created by @stefaweb on GitHub (Sep 23, 2022).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/2613

Impacted versions

  • OS Type: Debian
  • OS Version: bullseye
  • Database Type: PostgreSQL
  • Database version: 13.8-0+deb11u1
  • Modoboa:2.0.1
  • installer used: Yes
  • Webserver: Nginx

Current behavior

Hello,

Statistics pages do not display data.

In the web console, we see that the data seems empty and the parsing fails.

Error: Problem parsing d="MNaN,300CNaN,300,NaN,0,NaN,0SNaN,257.14285714285717,NaN,257.14285714285717SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300LNaN,300CNaN,300,NaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300Z"

If we launch the cron manually, there is an error accessing the file.

# sudo -u modoboa -i
$ /srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py update_statistics
Traceback (most recent call last):
  File "/srv/modoboa/instance/manage.py", line 22, in <module>
    main()
  File "/srv/modoboa/instance/manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/srv/modoboa/env/lib/python3.9/site-packages/modoboa/maillog/management/commands/update_statistics.py", line 84, in handle
    self.update_account_creation_stats(options["rebuild"])
  File "/srv/modoboa/env/lib/python3.9/site-packages/modoboa/maillog/management/commands/update_statistics.py", line 79, in update_account_creation_stats
    rrdtool.update(str(db_path), *data)
rrdtool.OperationalError: opening '/srv/modoboa/rrdfiles/new_accounts.rrd': Permission denied
root@mailhub:/srv/modoboa# ll
total 16
drwxr-xr-x 6 modoboa modoboa 4096 Sep 20 12:29 env
drwxr-xr-x 6 modoboa modoboa 4096 Sep 20 12:31 instance
drwxr-x--- 2 modoboa modoboa 4096 Sep 22 11:14 pdfcredentials
drwxr-x--- 2 modoboa modoboa 4096 Sep 22 15:30 rrdfiles

root@mailhub:/srv/modoboa/rrdfiles# ll
total 468
-rw-r--r-- 1 root root 123064 Sep 22 15:30 xxxx.com.rrd
-rw-r--r-- 1 root root 109520 Sep 21 11:15 xxxxx.com.rrd
-rw-r--r-- 1 root root 109520 Sep 22 08:20 xxxxxxx.org.rrd
-rw-r--r-- 1 root root 123064 Sep 22 15:30 global.rrd
-rw-r--r-- 1 root root   2448 Sep 23 08:00 new_accounts.rrd
Originally created by @stefaweb on GitHub (Sep 23, 2022). Original GitHub issue: https://github.com/modoboa/modoboa/issues/2613 # Impacted versions * OS Type: Debian * OS Version: bullseye * Database Type: PostgreSQL * Database version: 13.8-0+deb11u1 * Modoboa:2.0.1 * installer used: Yes * Webserver: Nginx # Current behavior Hello, Statistics pages do not display data. In the web console, we see that the data seems empty and the parsing fails. `Error: Problem parsing d="MNaN,300CNaN,300,NaN,0,NaN,0SNaN,257.14285714285717,NaN,257.14285714285717SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300LNaN,300CNaN,300,NaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300SNaN,300,NaN,300Z"` If we launch the cron manually, there is an error accessing the file. ``` # sudo -u modoboa -i $ /srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py update_statistics Traceback (most recent call last): File "/srv/modoboa/instance/manage.py", line 22, in <module> main() File "/srv/modoboa/instance/manage.py", line 18, in main execute_from_command_line(sys.argv) File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line utility.execute() File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv self.execute(*args, **cmd_options) File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute output = self.handle(*args, **options) File "/srv/modoboa/env/lib/python3.9/site-packages/modoboa/maillog/management/commands/update_statistics.py", line 84, in handle self.update_account_creation_stats(options["rebuild"]) File "/srv/modoboa/env/lib/python3.9/site-packages/modoboa/maillog/management/commands/update_statistics.py", line 79, in update_account_creation_stats rrdtool.update(str(db_path), *data) rrdtool.OperationalError: opening '/srv/modoboa/rrdfiles/new_accounts.rrd': Permission denied ``` ``` root@mailhub:/srv/modoboa# ll total 16 drwxr-xr-x 6 modoboa modoboa 4096 Sep 20 12:29 env drwxr-xr-x 6 modoboa modoboa 4096 Sep 20 12:31 instance drwxr-x--- 2 modoboa modoboa 4096 Sep 22 11:14 pdfcredentials drwxr-x--- 2 modoboa modoboa 4096 Sep 22 15:30 rrdfiles root@mailhub:/srv/modoboa/rrdfiles# ll total 468 -rw-r--r-- 1 root root 123064 Sep 22 15:30 xxxx.com.rrd -rw-r--r-- 1 root root 109520 Sep 21 11:15 xxxxx.com.rrd -rw-r--r-- 1 root root 109520 Sep 22 08:20 xxxxxxx.org.rrd -rw-r--r-- 1 root root 123064 Sep 22 15:30 global.rrd -rw-r--r-- 1 root root 2448 Sep 23 08:00 new_accounts.rrd ```
kerem 2026-02-27 11:18:24 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@stefaweb commented on GitHub (Sep 23, 2022):

Still not found the problem.

Have a nice we.

<!-- gh-comment-id:1256582190 --> @stefaweb commented on GitHub (Sep 23, 2022): Still not found the problem. Have a nice we.
Author
Owner

@Spitfireap commented on GitHub (Sep 24, 2022):

root@mailhub:/srv/modoboa/rrdfiles# ll
total 468
-rw-r--r-- 1 root root 123064 Sep 22 15:30 xxxx.com.rrd
-rw-r--r-- 1 root root 109520 Sep 21 11:15 xxxxx.com.rrd
-rw-r--r-- 1 root root 109520 Sep 22 08:20 xxxxxxx.org.rrd
-rw-r--r-- 1 root root 123064 Sep 22 15:30 global.rrd
-rw-r--r-- 1 root root 2448 Sep 23 08:00 new_accounts.rrd

Have you tried chown -R modoboa:modoboa /srv/modoboa/rrdfiles ?

<!-- gh-comment-id:1256914991 --> @Spitfireap commented on GitHub (Sep 24, 2022): > root@mailhub:/srv/modoboa/rrdfiles# ll > total 468 > -rw-r--r-- 1 root root 123064 Sep 22 15:30 xxxx.com.rrd > -rw-r--r-- 1 root root 109520 Sep 21 11:15 xxxxx.com.rrd > -rw-r--r-- 1 root root 109520 Sep 22 08:20 xxxxxxx.org.rrd > -rw-r--r-- 1 root root 123064 Sep 22 15:30 global.rrd > -rw-r--r-- 1 root root 2448 Sep 23 08:00 new_accounts.rrd Have you tried `chown -R modoboa:modoboa /srv/modoboa/rrdfiles` ?
Author
Owner

@stefaweb commented on GitHub (Sep 24, 2022):

Hi!

Already tried. No change.

If I run these commands, I got an error.

root@mailhub:~# /srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py logparser
/srv/modoboa/env/lib/python3.9/site-packages/modoboa/maillog/management/commands/logparser.py:96: FutureWarning: Possible nested set at position 29
  self._regex = {k: re.compile(v) for k, v in self._regex.items()}
root@mailhub:~# /srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py update_statistics
Traceback (most recent call last):
  File "/srv/modoboa/instance/manage.py", line 22, in <module>
    main()
  File "/srv/modoboa/instance/manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/srv/modoboa/env/lib/python3.9/site-packages/modoboa/maillog/management/commands/update_statistics.py", line 84, in handle
    self.update_account_creation_stats(options["rebuild"])
  File "/srv/modoboa/env/lib/python3.9/site-packages/modoboa/maillog/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 1664006400 when last update time is 1664006400 (minimum one second step)
root@mailhub:~# date
Sat Sep 24 11:19:30 CEST 2022
<!-- gh-comment-id:1256920601 --> @stefaweb commented on GitHub (Sep 24, 2022): Hi! Already tried. No change. If I run these commands, I got an error. ``` root@mailhub:~# /srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py logparser /srv/modoboa/env/lib/python3.9/site-packages/modoboa/maillog/management/commands/logparser.py:96: FutureWarning: Possible nested set at position 29 self._regex = {k: re.compile(v) for k, v in self._regex.items()} ``` ``` root@mailhub:~# /srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py update_statistics Traceback (most recent call last): File "/srv/modoboa/instance/manage.py", line 22, in <module> main() File "/srv/modoboa/instance/manage.py", line 18, in main execute_from_command_line(sys.argv) File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line utility.execute() File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv self.execute(*args, **cmd_options) File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute output = self.handle(*args, **options) File "/srv/modoboa/env/lib/python3.9/site-packages/modoboa/maillog/management/commands/update_statistics.py", line 84, in handle self.update_account_creation_stats(options["rebuild"]) File "/srv/modoboa/env/lib/python3.9/site-packages/modoboa/maillog/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 1664006400 when last update time is 1664006400 (minimum one second step) ``` ``` root@mailhub:~# date Sat Sep 24 11:19:30 CEST 2022 ```
Author
Owner

@Spitfireap commented on GitHub (Sep 24, 2022):

This looks like #1348

<!-- gh-comment-id:1256922674 --> @Spitfireap commented on GitHub (Sep 24, 2022): This looks like #1348
Author
Owner

@stefaweb commented on GitHub (Sep 24, 2022):

I deleted the .rrd files and rebooted.

New files are created with same right.

The first command give the same error but not the second.

root@mailhub:/srv/modoboa/rrdfiles# /srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py logparser
/srv/modoboa/env/lib/python3.9/site-packages/modoboa/maillog/management/commands/logparser.py:96: FutureWarning: Possible nested set at position 29
  self._regex = {k: re.compile(v) for k, v in self._regex.items()}

root@mailhub:/srv/modoboa/rrdfiles# ll
total 496
-rw-r--r-- 1 root root 123064 Sep 24 14:42 actionweb.fr.rrd
-rw-r--r-- 1 root root 123064 Sep 24 14:42 awdiy.com.rrd
-rw-r--r-- 1 root root 123064 Sep 24 14:42 cyberkata.org.rrd
-rw-r--r-- 1 root root 123064 Sep 24 14:42 global.rrd

root@mailhub:/srv/modoboa/rrdfiles# /srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py update_statistics

EDIT: same NaN wrong code in console.

<!-- gh-comment-id:1256961331 --> @stefaweb commented on GitHub (Sep 24, 2022): I deleted the .rrd files and rebooted. New files are created with same right. The first command give the same error but not the second. ``` root@mailhub:/srv/modoboa/rrdfiles# /srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py logparser /srv/modoboa/env/lib/python3.9/site-packages/modoboa/maillog/management/commands/logparser.py:96: FutureWarning: Possible nested set at position 29 self._regex = {k: re.compile(v) for k, v in self._regex.items()} root@mailhub:/srv/modoboa/rrdfiles# ll total 496 -rw-r--r-- 1 root root 123064 Sep 24 14:42 actionweb.fr.rrd -rw-r--r-- 1 root root 123064 Sep 24 14:42 awdiy.com.rrd -rw-r--r-- 1 root root 123064 Sep 24 14:42 cyberkata.org.rrd -rw-r--r-- 1 root root 123064 Sep 24 14:42 global.rrd root@mailhub:/srv/modoboa/rrdfiles# /srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py update_statistics ``` EDIT: same NaN wrong code in console.
Author
Owner

@tonioo commented on GitHub (Sep 25, 2022):

@stefaweb Statistics does not work anymore in the old interface, that's something I must fix. But they work in the new one

<!-- gh-comment-id:1257138992 --> @tonioo commented on GitHub (Sep 25, 2022): @stefaweb Statistics does not work anymore in the old interface, that's something I must fix. But they work in the new one
Author
Owner

@tonioo commented on GitHub (Sep 25, 2022):

@stefaweb And the logparser command must en run as root since it reads the mail.log file.

<!-- gh-comment-id:1257141570 --> @tonioo commented on GitHub (Sep 25, 2022): @stefaweb And the logparser command must en run as root since it reads the mail.log file.
Author
Owner

@stefaweb commented on GitHub (Sep 25, 2022):

HI @tonioo,

A problem with 2.0.2 upgrade.

root@mailhub:/home/modoboa-works# sudo -u modoboa -i
$ bash
modoboa@mailhub:~$ source /srv/modoboa/env/bin/activate
(env) modoboa@mailhub:~$ pip install modoboa==2.0.2
...
...
(env) modoboa@mailhub:~$ cd /srv/modoboa/instance
(env) modoboa@mailhub:~/instance$ python manage.py migrate
Operations to perform:
  Apply all migrations: admin, auth, authtoken, contenttypes, core, dnstools, lib, limits, maillog, modoboa_amavis, modoboa_contacts, modoboa_postfix_autoreply, modoboa_radicale, otp_static, otp_totp, relaydomains, reversion, sessions, sites, transport
Running migrations:
  Applying admin.0021_auto_20220922_1052...Traceback (most recent call last):
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
psycopg2.errors.FeatureNotSupported: cannot alter type of a column used by a view or rule
DETAIL:  rule _RETURN on view dkim depends on column "id"


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/srv/modoboa/instance/manage.py", line 22, in <module>
    main()
  File "/srv/modoboa/instance/manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/base.py", line 89, in wrapped
    res = handle_func(*args, **kwargs)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/commands/migrate.py", line 244, in handle
    post_migrate_state = executor.migrate(
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/migrations/executor.py", line 117, in migrate
    state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/migrations/executor.py", line 227, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/migrations/migration.py", line 126, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/migrations/operations/fields.py", line 244, in database_forwards
    schema_editor.alter_field(from_model, from_field, to_field)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/backends/base/schema.py", line 608, in alter_field
    self._alter_field(model, old_field, new_field, old_type, new_type,
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/backends/postgresql/schema.py", line 196, in _alter_field
    super()._alter_field(
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/backends/base/schema.py", line 765, in _alter_field
    self.execute(
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/backends/base/schema.py", line 145, in execute
    cursor.execute(sql, params)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
django.db.utils.NotSupportedError: cannot alter type of a column used by a view or rule
DETAIL:  rule _RETURN on view dkim depends on column "id"
(env) modoboa@mailhub:~/instance$ python manage.py collectstatic

You have requested to collect static files at the destination
location as specified in your settings:

    /srv/modoboa/instance/sitestatic

This will overwrite existing files!
Are you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: yes
Found another file with the destination path 'index.html'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.

0 static files copied to '/srv/modoboa/instance/sitestatic', 3306 unmodified.
(env) modoboa@mailhub:~/instance$ python manage.py check --deploy
System check identified some issues:

WARNINGS:
?: (modoboa-amavis.W001) AMAVIS_DEFAULT_DATABASE_ENCODING does not match the character encoding used by the Amavis database.
	HINT: Check your database character encoding and set/update AMAVIS_DEFAULT_DATABASE_ENCODING.
?: (security.W001) You do not have 'django.middleware.security.SecurityMiddleware' in your MIDDLEWARE so the SECURE_HSTS_SECONDS, SECURE_CONTENT_TYPE_NOSNIFF, SECURE_BROWSER_XSS_FILTER, SECURE_REFERRER_POLICY, and SECURE_SSL_REDIRECT settings will have no effect.
?: (security.W009) Your SECRET_KEY has less than 50 characters, less than 5 unique characters, or it's prefixed with 'django-insecure-' indicating that it was generated automatically by Django. Please generate a long and random SECRET_KEY, otherwise many of Django's security-critical features will be vulnerable to attack.

System check identified 3 issues (3 silenced).

And 2.0.2 not installed.

EDIT: 2.0.2 was finally installed. Just had to reboot. Statistics in GUIv1 works.

<!-- gh-comment-id:1257154669 --> @stefaweb commented on GitHub (Sep 25, 2022): HI @tonioo, A problem with 2.0.2 upgrade. ``` root@mailhub:/home/modoboa-works# sudo -u modoboa -i $ bash modoboa@mailhub:~$ source /srv/modoboa/env/bin/activate (env) modoboa@mailhub:~$ pip install modoboa==2.0.2 ... ... (env) modoboa@mailhub:~$ cd /srv/modoboa/instance (env) modoboa@mailhub:~/instance$ python manage.py migrate Operations to perform: Apply all migrations: admin, auth, authtoken, contenttypes, core, dnstools, lib, limits, maillog, modoboa_amavis, modoboa_contacts, modoboa_postfix_autoreply, modoboa_radicale, otp_static, otp_totp, relaydomains, reversion, sessions, sites, transport Running migrations: Applying admin.0021_auto_20220922_1052...Traceback (most recent call last): File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) psycopg2.errors.FeatureNotSupported: cannot alter type of a column used by a view or rule DETAIL: rule _RETURN on view dkim depends on column "id" The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/srv/modoboa/instance/manage.py", line 22, in <module> main() File "/srv/modoboa/instance/manage.py", line 18, in main execute_from_command_line(sys.argv) File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line utility.execute() File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv self.execute(*args, **cmd_options) File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute output = self.handle(*args, **options) File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/base.py", line 89, in wrapped res = handle_func(*args, **kwargs) File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/commands/migrate.py", line 244, in handle post_migrate_state = executor.migrate( File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/migrations/executor.py", line 117, in migrate state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial) File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial) File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/migrations/executor.py", line 227, in apply_migration state = migration.apply(state, schema_editor) File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/migrations/migration.py", line 126, in apply operation.database_forwards(self.app_label, schema_editor, old_state, project_state) File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/migrations/operations/fields.py", line 244, in database_forwards schema_editor.alter_field(from_model, from_field, to_field) File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/backends/base/schema.py", line 608, in alter_field self._alter_field(model, old_field, new_field, old_type, new_type, File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/backends/postgresql/schema.py", line 196, in _alter_field super()._alter_field( File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/backends/base/schema.py", line 765, in _alter_field self.execute( File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/backends/base/schema.py", line 145, in execute cursor.execute(sql, params) File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers return executor(sql, params, many, context) File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) django.db.utils.NotSupportedError: cannot alter type of a column used by a view or rule DETAIL: rule _RETURN on view dkim depends on column "id" (env) modoboa@mailhub:~/instance$ python manage.py collectstatic You have requested to collect static files at the destination location as specified in your settings: /srv/modoboa/instance/sitestatic This will overwrite existing files! Are you sure you want to do this? Type 'yes' to continue, or 'no' to cancel: yes Found another file with the destination path 'index.html'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path. 0 static files copied to '/srv/modoboa/instance/sitestatic', 3306 unmodified. (env) modoboa@mailhub:~/instance$ python manage.py check --deploy System check identified some issues: WARNINGS: ?: (modoboa-amavis.W001) AMAVIS_DEFAULT_DATABASE_ENCODING does not match the character encoding used by the Amavis database. HINT: Check your database character encoding and set/update AMAVIS_DEFAULT_DATABASE_ENCODING. ?: (security.W001) You do not have 'django.middleware.security.SecurityMiddleware' in your MIDDLEWARE so the SECURE_HSTS_SECONDS, SECURE_CONTENT_TYPE_NOSNIFF, SECURE_BROWSER_XSS_FILTER, SECURE_REFERRER_POLICY, and SECURE_SSL_REDIRECT settings will have no effect. ?: (security.W009) Your SECRET_KEY has less than 50 characters, less than 5 unique characters, or it's prefixed with 'django-insecure-' indicating that it was generated automatically by Django. Please generate a long and random SECRET_KEY, otherwise many of Django's security-critical features will be vulnerable to attack. System check identified 3 issues (3 silenced). ``` And 2.0.2 not installed. EDIT: 2.0.2 was finally installed. Just had to reboot. Statistics in GUIv1 works.
Author
Owner

@tonioo commented on GitHub (Sep 26, 2022):

@stefaweb That's a different issue...

<!-- gh-comment-id:1257774597 --> @tonioo commented on GitHub (Sep 26, 2022): @stefaweb That's a different issue...
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#1655
No description provided.