technicalguru / docker-mailserver-postfixadmin

Docker image for postfixadmin in mailserver project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Database update to 79 fails

pixil98 opened this issue · comments

I don't think this is actually caused by anything in this repo, but I'm starting here as I found it using this image. On a fresh deployment of postfixadmin I run into problems with setup updating the database to version 79. The issue appears to be the following lines of the public/upgrade.php file. None of the indexes exist and it errors out trying to drop them. I was able to work around the issue by commenting out all four db_query_parsed lines.

function upgrade_79_mysql() { # MySQL only
    db_query_parsed(_drop_index('admin', 'username'), true);
    db_query_parsed(_drop_index('alias', 'address'), true);
    db_query_parsed(_drop_index('domain', 'domain'), true);
    db_query_parsed(_drop_index('mailbox', 'username'), true);
}

Please refer this to https://github.com/postfixadmin/postfixadmin as this repo just makes use of the release.

Nothing to do

I have replicated this in a Docker environment. This happens if the postfix container bootstraps before the postfixadmin container. The way Postfix creates its tables in the mail DB is not compatible with PostfixAdmin's bootstrap migrations.
To work around this in a Kubernetes environment you just have to do things in order. I am not sure how to solve it "properly" with docker compose other than commenting out the postfix service until you've run setup.php.