Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Password hashing error after upgrading postfixadmin. #561

Closed
Arturitu12 opened this issue Nov 21, 2021 · 10 comments
Closed

Password hashing error after upgrading postfixadmin. #561

Arturitu12 opened this issue Nov 21, 2021 · 10 comments

Comments

@Arturitu12
Copy link

Arturitu12 commented Nov 21, 2021

Hello, i just upgraded postfixadmin to newest version (3.3.8). After upgrade (have followed DOCUMENTS/UPGRADE.txt) i have following error on setup page:

`Errors (MUST be fixed)
⛔Password Hashing - attempted to use configured encrypt backend (dovecot:ARGON2I) triggered an error: /usr/bin/doveadm pw -r 5 failed, see error log for details
⛔You will have problems logging into PostfixAdmin.
⛔Check out our Dovecot documentation at https://github.com/postfixadmin/postfixadmin/blob/master/DOCUMENTS/DOVECOT.txt, specifically around '3. Permissions'.`

My config.local.php looks like this:

<?php
$CONF['encrypt'] = 'dovecot:ARGON2I';
$CONF['dovecotpw'] = "/usr/bin/doveadm pw -r 5";
if(@file_exists('/usr/bin/doveadm')) { // @ to silence openbase_dir stuff; see https://github.com/postfixad>
    $CONF['dovecotpw'] = "/usr/bin/doveadm pw -r 5"; # debian

$CONF['setup_password'] = 'My hash is here';
}

Error log:
[Sun Nov 21 12:43:27.838721 2021] [php:notice] [pid 25279] [client 83.25.89.236:61247] Failed to read password from /usr/bin/doveadm pw -r 5 ... stderr: doveadm: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: Permission >

I have read DOCUMENTS/DOVECOT.txt
I done usermod -aG dovecot www-data
I tried already this solution with no luck: https://github.com/postfixadmin/postfixadmin/issues/398#issuecomment-843124406

What can i do to fix this?

@DavidGoodwin
Copy link
Member

Hi -
Could you try using the version of Postfixadmin from the 'master' branch (i..e git clone https://github.com/postfixadmin/postfixadmin.git ) and use that?

You SHOULD be able to specify $CONF['encrypt'] = 'ARGON2I';

See also https://github.com/postfixadmin/postfixadmin/blob/master/DOCUMENTS/HASHING.md

thanks

@Arturitu12
Copy link
Author

I done it, but idk why i can't go to setup.php in my web browser now giving me error 500
I ve set already permissions like in instruction, alias is correct too i can only see this page:
image

@Arturitu12
Copy link
Author

Arturitu12 commented Nov 21, 2021


[Sun Nov 21 18:09:11.764445 2021] [php:warn] [pid 36928] [client MYIP] PHP Warning:  require_once(/var/www/postfixadmin/vendor/autoload.php): Failed to open stream: No such file or directory in /var/www/postfixadmin/common>
[Sun Nov 21 18:09:11.764493 2021] [php:error] [pid 36928] [client MYIP] PHP Fatal error:  Uncaught Error: Failed opening required '/var/www/postfixadmin/vendor/autoload.php' (include_path='.:/usr/share/php') in /var/www/po>


Path i installed postfixadmin to: /var/www/postfixadmin
Path apache2 alias is set to: /var/www/postfixadmin/public

@DavidGoodwin
Copy link
Member

Ah - there's an ìnstall.sh script there - run it.

(Or do a "composer install" manually if you have composer present).

@Arturitu12
Copy link
Author

Thanks, all went ok now except of this message on setup page:

Exception message: DEBUG INFORMATION: SQLSTATE[HY000]: General error: 1833 Cannot change column 'email': used in a foreign key constraint 'vacation_notification_pkey' of table 'postfixadmin.vacation_notification'
Check your error_log for the failed query - check logs!

Something went wrong while trying to apply database updates, a message should be logged - check PHP's error_log ()

Log:

[Sun Nov 21 22:04:13.170664 2021] [php:notice] [pid 45707] [client IP] Invalid query: SQLSTATE[HY000]: General error: 1833 Cannot change column 'email': used in a foreign key constraint 'vacation_notification_pkey' of table 'postfixadmin.vacation_notification' caused by ALTER TABLE `vacation` MODIFY email varchar(255)  COLLATE latin1_general_ci NOT NULL, referer: https://watever.ddns.net/postfixadmin/setup.php
[Sun Nov 21 22:04:13.170741 2021] [php:notice] [pid 45707] [client IP] Couldn't perform PostfixAdmin database update via upgrade.php - DEBUG INFORMATION: SQLSTATE[HY000]: General error: 1833 Cannot change column 'email': used in a foreign key constraint 'vacation_notification_pkey' of table 'postfixadmin.vacation_notification'<br/> Check your error_log for the failed query Trace: #0 /var/www/postfixadmin/public/upgrade.php(2068): db_query()\n#1 /var/www/postfixadmin/public/upgrade.php(217): upgrade_1846_mysql()\n#2 /var/www/postfixadmin/public/upgrade.php(162): _do_upgrade()\n#3 /var/www/postfixadmin/public/setup.php(348): require_once('...')\n#4 {main}, referer: https://my-domain/postfixadmin/setup.php


@Arturitu12
Copy link
Author

Also i can login to login.php normally see domain, admins but when i click on domain or Virtual list it gave me internal error:


[Sun Nov 21 22:12:29.707668 2021] [php:notice] [pid 36927] [client IP] Invalid query: SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (latin1_general_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '=' caused by SELECT `mailbox`.* , `alias`.goto , `mailbox`.password_expiry as password_expiration , `vacation`.active AS v_active \n FROM `mailbox` \n LEFT JOIN `alias` ON `mailbox`.username=`alias`.address  LEFT JOIN `vacation` ON `mailbox`.username=`vacation`.email \n WHERE  `mailbox`.domain= :domain \n ORDER BY `mailbox`.username \n LIMIT 10 OFFSET 0, referer: https://my-domain/postfixadmin/main.php
[Sun Nov 21 22:12:29.707734 2021] [php:error] [pid 36927] [client IP] PHP Fatal error:  Uncaught Exception: DEBUG INFORMATION: SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (latin1_general_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '='<br/> Check your error_log for the failed query in /var/www/postfixadmin/functions.inc.php:1911\nStack trace:\n#0 /var/www/postfixadmin/functions.inc.php(1847): db_query()\n#1 /var/www/postfixadmin/public/list-virtual.php(236): db_query_all()\n#2 {main}\n  thrown in /var/www/postfixadmin/functions.inc.php on line 1911, referer: https://my-domain/postfixadmin/main.php

@Arturitu12
Copy link
Author

Arturitu12 commented Nov 21, 2021

my DB is from prevoius version of postfixadmin and all worked perfectly. Sorry but i really beginner in databases and have no idea why it gets error on own database from previous version.

DavidGoodwin added a commit that referenced this issue Nov 21, 2021
@DavidGoodwin
Copy link
Member

can you apply 047774b and then visit setup.php to see if that allows the db update to complete please?

@Arturitu12
Copy link
Author

It fixed the problems, thanks so much!

@DavidGoodwin
Copy link
Member

Super - thanks for testing it so quickly :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants