[GH-ISSUE #1653] mail dovecot auth to pgsql failed #1302

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

Originally created by @jkorac on GitHub (Jan 9, 2019).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1653

Impacted versions

  • CentOS Linux release 7.5.1804 (Core), Linux 3.10.0-862.14.4.el7.x86_64
  • Modoboa: 1.12.2
  • installer used: Yes
  • Webserver: Nginx
  • Database: PostgreSQL

Steps to reproduce

Create new user and email on Modoboa
Fetch mail from Modoboa installation using IMAP with SSL

In:
/var/lib/pgsql/data/postgresql.conf

tried to fiddle with
max_locks_per_transaction
max_connections
we've put 1500 as the max connections available. No change.

Current behavior

Error happens every several minutes (~30min):
user@domain.tld.cfg: credential/login error ([UNAVAILABLE] Temporary authentication failure.

From log file:
mail dovecot: auth: Warning: pgsql: Query failed, retrying:
Password query failed: Not connected to database

Expected behavior

Should work without failed attempts to reach the db.

(optional)

Is there a painless process to migrate databases from PostgreSQL to mySQL?

Originally created by @jkorac on GitHub (Jan 9, 2019). Original GitHub issue: https://github.com/modoboa/modoboa/issues/1653 # Impacted versions * CentOS Linux release 7.5.1804 (Core), Linux 3.10.0-862.14.4.el7.x86_64 * Modoboa: 1.12.2 * installer used: Yes * Webserver: Nginx * Database: PostgreSQL # Steps to reproduce Create new user and email on Modoboa Fetch mail from Modoboa installation using IMAP with SSL In: `/var/lib/pgsql/data/postgresql.conf` tried to fiddle with `max_locks_per_transaction` `max_connections` we've put 1500 as the max connections available. No change. # Current behavior Error happens every several minutes (~30min): `user@domain.tld.cfg: credential/login error ([UNAVAILABLE] Temporary authentication failure.` From log file: `mail dovecot: auth: Warning: pgsql: Query failed, retrying:` `Password query failed: Not connected to database` # Expected behavior Should work without failed attempts to reach the db. # (optional) Is there a painless process to migrate databases from PostgreSQL to mySQL?
kerem 2026-02-27 11:16:24 +03:00
Author
Owner

@tonioo commented on GitHub (Jan 9, 2019):

@jkorac How many users do you host? Are you monitoring the number of active postgres connections?

About migrating to mysql, you can try with the 2 following commands:

python manage.py dumpdata
python manage.py loaddata

but I don't guarantee it will work.

<!-- gh-comment-id:452685983 --> @tonioo commented on GitHub (Jan 9, 2019): @jkorac How many users do you host? Are you monitoring the number of active postgres connections? About migrating to mysql, you can try with the 2 following commands: ```shell python manage.py dumpdata python manage.py loaddata ``` but I don't guarantee it will work.
Author
Owner

@jkorac commented on GitHub (Jan 9, 2019):

@tonioo we are currently running a test system with approx 50 active users. Pgsql log is constantly monitored, level = debug1. Connection limit for pgsql is set @ 1500. Re: migration - are the db/table structures the same for pgsql & mysql installations? If not, simple dump and import would not help. Has anyone tried that b4?

<!-- gh-comment-id:452690567 --> @jkorac commented on GitHub (Jan 9, 2019): @tonioo we are currently running a test system with approx 50 active users. Pgsql log is constantly monitored, level = debug1. Connection limit for pgsql is set @ 1500. Re: migration - are the db/table structures the same for pgsql & mysql installations? If not, simple dump and import would not help. Has anyone tried that b4?
Author
Owner

@tonioo commented on GitHub (Jan 9, 2019):

And what is the average number of active connections?

Structures are the same.

<!-- gh-comment-id:452697887 --> @tonioo commented on GitHub (Jan 9, 2019): And what is the average number of active connections? Structures are the same.
Author
Owner

@jkorac commented on GitHub (Jan 10, 2019):

@tonioo all users are actively connected to modoboa server. Connections are set @ 2 minutes with imap (ssl). We have tried plain imap, pop with ssl, and plain pop with same results. We believe there is a problem with postgre db. Tonight we will try to migrate dbs to mysql to test it out. Do you have some hints to share in relation with migration?

<!-- gh-comment-id:453080874 --> @jkorac commented on GitHub (Jan 10, 2019): @tonioo all users are actively connected to modoboa server. Connections are set @ 2 minutes with imap (ssl). We have tried plain imap, pop with ssl, and plain pop with same results. We believe there is a problem with postgre db. Tonight we will try to migrate dbs to mysql to test it out. Do you have some hints to share in relation with migration?
Author
Owner

@jkorac commented on GitHub (Jan 14, 2019):

Still without solution.

We have tried several things, so here is feedback:

  1. Migrate postgre to mysql on present installation
    a) dumpdata does incomplete job
python manage.py dumpdata
python manage.py loaddata

It doesn't work.

b) after switching pgsql with mysql installation was in ruins. There were too many errors in system, all pointing to a missing connection with postgre, even though we did everything to plug it out. Nothing worked, in short.

  1. (auto)Installer with mysql doesn't exist on github
    If there is, I kindly ask to point me to it so we could try that way.

  2. Manual Installation of modoboa using mysql is incomplete
    There is a lot of missing information and packets during this process. Also, documentation is scarce about manual installation with mysql, and there are steps missing. Is there any valid documentation or at least some kind of step-by-step that might help us out here?

  3. Trying different methods
    We also tried to use different methods of authentication. We tried to connect with plain IMAP, POP with SSL, or plain POP. Problem persists.
    Last thing we did, we tried to reach modoboa with several different clients from different systems: Thunderbird, Outlook, Gmail app, Apple mail (mojave), and our server. With every combination of client and method gives the same problem:

PGSQL
CETLOG: incomplete startup packet

DOVECOT
dovecot: imap-login: Internal login failure (pid=9790 id=1) (internal failure, 1 successful auths)

<!-- gh-comment-id:453946417 --> @jkorac commented on GitHub (Jan 14, 2019): Still without solution. We have tried several things, so here is feedback: 1. Migrate postgre to mysql on present installation a) dumpdata does incomplete job > ```shell > python manage.py dumpdata > python manage.py loaddata > ``` It doesn't work. b) after switching pgsql with mysql installation was in ruins. There were too many errors in system, all pointing to a missing connection with postgre, even though we did everything to plug it out. Nothing worked, in short. 2. (auto)Installer with mysql doesn't exist on github If there is, I kindly ask to point me to it so we could try that way. 3. Manual Installation of modoboa using mysql is incomplete There is a lot of missing information and packets during this process. Also, documentation is scarce about manual installation with mysql, and there are steps missing. Is there any valid documentation or at least some kind of step-by-step that might help us out here? 4. Trying different methods We also tried to use different methods of authentication. We tried to connect with plain IMAP, POP with SSL, or plain POP. Problem persists. Last thing we did, we tried to reach modoboa with several different clients from different systems: Thunderbird, Outlook, Gmail app, Apple mail (mojave), and our server. With every combination of client and method gives the same problem: > PGSQL > CETLOG: incomplete startup packet > > DOVECOT > dovecot: imap-login: Internal login failure (pid=9790 id=1) (internal failure, 1 successful auths)
Author
Owner

@tonioo commented on GitHub (Jan 18, 2019):

@jkorac FYI, the official installer does support mysql. You only have to modify the installer.cfg file, look at the database section.
About manual installation, if you think it's incomplete, please provide a PR containing documentation fixes, I'd glad to approve it :)

<!-- gh-comment-id:455629334 --> @tonioo commented on GitHub (Jan 18, 2019): @jkorac FYI, the official installer does support mysql. You only have to modify the installer.cfg file, look at the database section. About manual installation, if you think it's incomplete, please provide a PR containing documentation fixes, I'd glad to approve it :)
Author
Owner

@jkorac commented on GitHub (Jan 25, 2019):

Problem solved.

Installing and using MySQL instead solved the problem.

We managed to manually install modoboa with mysql. I don't know what went wrong last time, I wasn't there, but we did it! I'm still waiting for the documentation, if I'll ever get one.

<!-- gh-comment-id:457535837 --> @jkorac commented on GitHub (Jan 25, 2019): Problem solved. Installing and using MySQL instead solved the problem. We managed to manually install modoboa with mysql. I don't know what went wrong last time, I wasn't there, but we did it! I'm still waiting for the documentation, if I'll ever get one.
Author
Owner

@tonioo commented on GitHub (Jan 31, 2019):

@jkorac Feel free to open a new PR about the documentation or an issue.

<!-- gh-comment-id:459447579 --> @tonioo commented on GitHub (Jan 31, 2019): @jkorac Feel free to open a new PR about the documentation or an 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#1302
No description provided.