The values being missing would also explain why it said your debian-sys-maint has an empty password;
Postinst will try to log in as debian-sys-maint first. If that fails it will try to read the password from debian.cnf and set that as the user's password, then run mysql_upgrade.
I'm thinking that maybe if that login check fails we should simply overwrite the debian.cnf file with a new one.
The values being missing would also explain why it said your debian-sys-maint has an empty password;
Postinst will try to log in as debian-sys-maint first. If that fails it will try to read the password from debian.cnf and set that as the user's password, then run mysql_upgrade.
I'm thinking that maybe if that login check fails we should simply overwrite the debian.cnf file with a new one.