id,summary,reporter,owner,description,type,status,priority,component,severity,resolution,keywords,cc,release
10772,ProgrammingError: operator does not exist: text = integer,mbunkus,hasienda,I've checked the other tickets here with similar subjects; none of them applies.\r\n\r\nAccountManagerPlugin 0.5dev from trunk_ revision 12516; Trac 1.0.1; PostgreSQL 9.1\r\n\r\nHappens when you log in. In my special case I've registered a new user account_ logged in for the first time. Error occurred.\r\n\r\nError message from log file:\r\n\r\n{{{\r\n2013-01-08 18:49:21_821 Trac[main] ERROR: Exception caught while post-processing request:\r\nTraceback (most recent call last):\r\n  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1dev_r11468-py2.7.egg/trac/web/main.py"_ line 243_ in dispatch\r\n    self._post_process_request(req)\r\n  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1dev_r11468-py2.7.egg/trac/web/main.py"_ line 340_ in _post_process_request\r\n    f.post_process_request(req_ *(None_)*extra_arg_count)\r\n  File "build/bdist.linux-i686/egg/acct_mgr/web_ui.py"_ line 123_ in post_process_request\r\n    if req.authname and req.authname != 'anonymous':\r\n  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1dev_r11468-py2.7.egg/trac/web/api.py"_ line 304_ in __getattr__\r\n    value = self.callbacks[name](self)\r\n  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1dev_r11468-py2.7.egg/trac/web/main.py"_ line 135_ in authenticate\r\n    authname = authenticator.authenticate(req)\r\n  File "build/bdist.linux-i686/egg/acct_mgr/util.py"_ line 83_ in wrap\r\n    return func(self_ *args_ **kwds)\r\n  File "build/bdist.linux-i686/egg/acct_mgr/web_ui.py"_ line 334_ in authenticate\r\n    user = self._remote_user(req)\r\n  File "build/bdist.linux-i686/egg/acct_mgr/web_ui.py"_ line 680_ in _remote_user\r\n    if acctmgr.check_password(user_ password) == True:\r\n  File "build/bdist.linux-i686/egg/acct_mgr/api.py"_ line 273_ in check_password\r\n    valid = store.check_password(user_ password)\r\n  File "build/bdist.linux-i686/egg/acct_mgr/db.py"_ line 106_ in check_password\r\n    """_ (self.key_ user))\r\n  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1dev_r11468-py2.7.egg/trac/db/util.py"_ line 65_ in execute\r\n    return self.cursor.execute(sql_escape_percent(sql)_ args)\r\nInternalError: current transaction is aborted_ commands ignored until end of transaction block\r\nInternalError: current transaction is aborted_ commands ignored until end of transaction block\r\n\r\n2013-01-08 18:49:21_876 Trac[main] ERROR: Internal Server Error:\r\nTraceback (most recent call last):\r\n  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1dev_r11468-py2.7.egg/trac/web/main.py"_ line 497_ in _dispatch_request\r\n    dispatcher.dispatch(req)\r\n  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1dev_r11468-py2.7.egg/trac/web/main.py"_ line 179_ in dispatch\r\n    chosen_handler)\r\n  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1dev_r11468-py2.7.egg/trac/web/main.py"_ line 325_ in _pre_process_request\r\n    chosen_handler = filter_.pre_process_request(req_ chosen_handler)\r\n  File "build/bdist.linux-i686/egg/acct_mgr/api.py"_ line 420_ in pre_process_request\r\n    if not req.session.authenticated or \\\r\n  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1dev_r11468-py2.7.egg/trac/web/api.py"_ line 304_ in __getattr__\r\n    value = self.callbacks[name](self)\r\n  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1dev_r11468-py2.7.egg/trac/web/main.py"_ line 268_ in _get_session\r\n    return Session(self.env_ req)\r\n  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1dev_r11468-py2.7.egg/trac/web/session.py"_ line 200_ in __init__\r\n    if req.authname == 'anonymous':\r\n  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1dev_r11468-py2.7.egg/trac/web/api.py"_ line 304_ in __getattr__\r\n    value = self.callbacks[name](self)\r\n  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1dev_r11468-py2.7.egg/trac/web/main.py"_ line 135_ in authenticate\r\n    authname = authenticator.authenticate(req)\r\n  File "build/bdist.linux-i686/egg/acct_mgr/util.py"_ line 83_ in wrap\r\n    return func(self_ *args_ **kwds)\r\n  File "build/bdist.linux-i686/egg/acct_mgr/web_ui.py"_ line 334_ in authenticate\r\n    user = self._remote_user(req)\r\n  File "build/bdist.linux-i686/egg/acct_mgr/web_ui.py"_ line 680_ in _remote_user\r\n    if acctmgr.check_password(user_ password) == True:\r\n  File "build/bdist.linux-i686/egg/acct_mgr/api.py"_ line 277_ in check_password\r\n    self._maybe_update_hash(user_ password)\r\n  File "build/bdist.linux-i686/egg/acct_mgr/api.py"_ line 381_ in _maybe_update_hash\r\n    if not get_user_attribute(self.env_ 1_ user_ 'password_refreshed'_ 1):\r\n  File "build/bdist.linux-i686/egg/acct_mgr/model.py"_ line 125_ in get_user_attribute\r\n    cursor.execute(sql_ sql_args)\r\n  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1dev_r11468-py2.7.egg/trac/db/util.py"_ line 65_ in execute\r\n    return self.cursor.execute(sql_escape_percent(sql)_ args)\r\nProgrammingError: operator does not exist: text = integer\r\nLINE 4:         WHERE sid=1 AND authenticated='testfufu' AND name='p...\r\n}}}\r\n\r\nRelevant configuration:\r\n\r\n{{{\r\n[account-manager]\r\ndb_htpasswd_hash_type = sha\r\nforce_passwd_change = true\r\nhash_method = HtPasswdHashMethod\r\nhtpasswd_file = /opt/trac/kivitendo/htpasswd\r\nhtpasswd_hash_type = sha\r\nlogin_attempt_max_count = 0\r\nnotify_actions =\r\npassword_store = SessionStore\r\npersistent_sessions = False\r\nrefresh_passwd = true\r\nregister_check = BasicCheck_ EmailCheck_ UsernamePermCheck_ RegExpCheck\r\nverify_email = true\r\n\r\n[components]\r\nacct_mgr.admin.accountguardadminpage = enabled\r\nacct_mgr.admin.accountmanageradminpage = enabled\r\nacct_mgr.api.accountmanager = enabled\r\nacct_mgr.db.sessionstore = enabled\r\nacct_mgr.guard.accountguard = enabled\r\nacct_mgr.htfile.abstractpasswordfilestore = disabled\r\nacct_mgr.htfile.htdigeststore = disabled\r\nacct_mgr.htfile.htpasswdstore = disabled\r\nacct_mgr.http.httpauthstore = disabled\r\nacct_mgr.notification.accountchangelistener = enabled\r\nacct_mgr.notification.accountchangenotificationadminpanel = enabled\r\nacct_mgr.pwhash.htdigesthashmethod = enabled\r\nacct_mgr.pwhash.htpasswdhashmethod = enabled\r\nacct_mgr.register.basiccheck = enabled\r\nacct_mgr.register.bottrapcheck = enabled\r\nacct_mgr.register.emailcheck = enabled\r\nacct_mgr.register.emailverificationmodule = enabled\r\nacct_mgr.register.regexpcheck = enabled\r\nacct_mgr.register.registrationmodule = enabled\r\nacct_mgr.register.usernamepermcheck = enabled\r\nacct_mgr.web_ui.loginmodule = enabled\r\n}}}\r\n\r\nI have a fix for this. When I apply it I get the next error message (only showing the last lines) in a related place:\r\n\r\n{{{\r\n  File "build/bdist.linux-i686/egg/acct_mgr/api.py"_ line 381_ in _maybe_update_hash\r\n    if not get_user_attribute(self.env_ 1_ user_ 'password_refreshed'_ 1):\r\n  File "build/bdist.linux-i686/egg/acct_mgr/model.py"_ line 125_ in get_user_attribute\r\n    cursor.execute(sql_ sql_args)\r\n  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1dev_r11468-py2.7.egg/trac/db/util.py"_ line 65_ in execute\r\n    return self.cursor.execute(sql_escape_percent(sql)_ args)\r\nProgrammingError: operator does not exist: text = integer\r\nLINE 4:         WHERE sid=1 AND authenticated='testfufu' AND name='p...\r\n}}}\r\n\r\nThis error message shows two problems: 1. the data type mismatch and 2. the field order is wrong (have to swap the `name` and `authenticated` columns).\r\n\r\nI'll attach a diff that fixes both places for me. PostgreSQL is simply way more picky about data types than other databases.,defect,new,normal,AccountManagerPlugin,normal,,db PostreSQL,rjollos,1.0
