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

ERROR: column "password_expiry" does not exist (old thread closed) #621

Closed
dom-madrid opened this issue May 13, 2022 · 1 comment
Closed

Comments

@dom-madrid
Copy link

Hi,

(This a repost from sourceforge as it seems this is a better place). I already found reference to the problem in other posts, but they did not fix the problem.

This is my original post for reference:


I recently upgraded my postfixadmin install from 2.x to 3.3.8. I did not realize that I had a previous error in my 2.x install which obviously is still there in 3.3.8.

The upgrade went without a hitch and the database was upgraded as well to the last version 1843/0

It seems there is a problem in the SQL that throws an error 500 in the browser. Looks like column password_expiry is not found, but the column exists in the table mailbox. (Same error was thrown from my version 2.x which I verified afterwards - did not have to connect in the last few months - hence not detected before).

From the apache log, here is what I found:

[Fri May 13 14:36:59.502421 2022] [php7:notice] [pid 440165] [client 192.168.1.193:54782] Invalid query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'password_expiry' in 'field list' caused by  SELECT domain,description,aliases,coalesce(__alias_count,0) - coalesce(__mailbox_count,0)  as alias_count, CASE aliases\n            WHEN '-1' THEN CONCAT(coalesce(__alias_count - coalesce(__mailbox_count,0),0), ' / -')\n            WHEN '0' THEN CONCAT(coalesce(__alias_count - coalesce(__mailbox_count,0),0), ' / ', '\xe2\x88\x9e')\n            ELSE CONCAT(coalesce(__alias_count - coalesce(__mailbox_count,0),0), ' / ', aliases)\n        END AS aliases_quot, CASE aliases\n        WHEN '-1' THEN -1\n        WHEN '0' THEN -1\n        ELSE round(100 * coalesce(__alias_count - coalesce(__mailbox_count,0),0) / aliases)\n    END AS _aliases_quot_percent,mailboxes,coalesce(__mailbox_count,0) as mailbox_count, CASE mailboxes\n            WHEN '-1' THEN CONCAT(coalesce(__mailbox_count,0), ' / -')\n            WHEN '0' THEN CONCAT(coalesce(__mailbox_count,0), ' / ', '\xe2\x88\x9e')\n            ELSE CONCAT(coalesce(__mailbox_count,0), ' / ', mailboxes)\n        END AS mailboxes_quot, CASE mailboxes\n        WHEN '-1' THEN -1\n        WHEN '0' THEN -1\n        ELSE round(100 * coalesce(__mailbox_count,0) / mailboxes)\n    END AS _mailboxes_quot_percent,maxquota,quota,round(coalesce(__total_quota/1024000,0)) AS total_quota, CASE quota\n            WHEN '-1' THEN CONCAT(coalesce(round(coalesce(__total_quota/1024000,0)),0), ' / -')\n            WHEN '0' THEN CONCAT(coalesce(round(coalesce(__total_quota/1024000,0)),0), ' / ', '\xe2\x88\x9e')\n            ELSE CONCAT(coalesce(round(coalesce(__total_quota/1024000,0)),0), ' / ', quota)\n        END AS total_quot, CASE quota\n        WHEN '-1' THEN -1\n        WHEN '0' THEN -1\n        ELSE round(100 * coalesce(round(coalesce(__total_quota/1024000,0)),0) / quota)\n    END AS _total_quot_percent,CASE backupmx WHEN '1' THEN '1'    WHEN '0' THEN '0'   END as backupmx,CASE backupmx WHEN '1' THEN 'YES' WHEN '0' THEN 'NO' END as _backupmx,CASE active WHEN '1' THEN '1'    WHEN '0' THEN '0'   END as active,CASE active WHEN '1' THEN 'YES' WHEN '0' THEN 'NO' END as _active,DATE_FORMAT(modified, '%Y-%m-%d') AS modified, modified AS _modified,password_expiry,1 as _can_edit,1 as _can_delete  FROM `domain`  left join ( select count(*) as __alias_count, domain as __alias_domain from `alias` group by domain) as __alias on domain = __alias_domain\n left join ( select count(*) as __mailbox_count, sum(quota) as __total_quota, domain as __mailbox_domain from `mailbox` group by domain) as __mailbox on domain = __mailbox_domain\n  WHERE 1=1   AND  domain IN ('domain.com','domain.es','domain.net')   AND    ( domain='domain.com' )  ORDER BY domain, referer: http://192.168.1.55/pfa3/edit.php?table=alias
[Fri May 13 14:36:59.502514 2022] [php7:error] [pid 440165] [client 192.168.1.193:54782] PHP Fatal error:  Uncaught Exception: DEBUG INFORMATION: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'password_expiry' in 'field list'<br/> Check your error_log for the failed query in /srv/www/pfa3/functions.inc.php:1858\nStack trace:\n#0 /srv/www/pfa3/functions.inc.php(1797): db_query()\n#1 /srv/www/pfa3/model/PFAHandler.php(772): db_query_all()\n#2 /srv/www/pfa3/model/PFAHandler.php(800): PFAHandler->read_from_db()\n#3 /srv/www/pfa3/model/PFAHandler.php(350): PFAHandler->view()\n#4 /srv/www/pfa3/functions.inc.php(490): PFAHandler->init()\n#5 /srv/www/pfa3/model/AliasHandler.php(224): get_domain_properties()\n#6 /srv/www/pfa3/model/AliasHandler.php(190): AliasHandler->create_allowed()\n#7 /srv/www/pfa3/model/PFAHandler.php(356): AliasHandler->validate_new_id()\n#8 /srv/www/pfa3/model/AliasHandler.php(149): PFAHandler->init()\n#9 /srv/www/pfa3/public/edit.php(156): AliasHandler->init()\n#10 {main}\n  thrown in /srv/www/pfa3/functions.inc.php on line 1858, referer: http://192.168.1.55/pfa3/edit.php?table=alias

The error prevents accessing domain, mailboxes, alias and the creation of more accounts. Not bloquing Postfix or Dovecot so far.


The solution proposed as being a user rights problem could be fine, except the postfixadmin user seems to have all the necessary rights on the database. So if someone could kindly point me in the right directions (with some detail), it would be greatly appreciated.

Dominique

@dom-madrid
Copy link
Author

Nothing like posting a problem to finally find the answer... Sorry

The one that worked for me: #489 (comment)

I missed a step. Now it is working again.

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

1 participant