#10319 closed defect (fixed)
Error with postgresql and Trac 1.0
Reported by: | Owned by: | branson | |
---|---|---|---|
Priority: | normal | Component: | DirectoryAuthPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.0 |
Description (last modified by )
I tried to upgraded from version 0.2.2 and have some problems
Installation:
- since v0.3 a database upgrade is needed
- this does only work if tracext.adauth.db.activedirectoryauthpluginsetup = enabled (this hint qould be good in the documentation)
- the upgrade fails on postgresql with unknown type varcahar(32) -> typo: varchar(32)
- the upgrade fails on postgresql with unknown type binary -> i tried: text
After this the installation and upgrade succeeds
But i've still an error:
File "/usr/local/lib/python2.6/dist-packages/TracActiveDirectoryAuth-0.3.2-py2.6.egg/tracext/adauth/auth.py", line 139, in check_password dn = self._get_user_dn(user) File "/usr/local/lib/python2.6/dist-packages/TracActiveDirectoryAuth-0.3.2-py2.6.egg/tracext/adauth/auth.py", line 271, in _get_user_dn if self.has_user(user): File "/usr/local/lib/python2.6/dist-packages/TracActiveDirectoryAuth-0.3.2-py2.6.egg/tracext/adauth/auth.py", line 129, in has_user users = self.get_users() File "/usr/local/lib/python2.6/dist-packages/TracActiveDirectoryAuth-0.3.2-py2.6.egg/tracext/adauth/auth.py", line 73, in get_users userinfo = self.expand_group_users(self.auth_group) File "/usr/local/lib/python2.6/dist-packages/TracActiveDirectoryAuth-0.3.2-py2.6.egg/tracext/adauth/auth.py", line 97, in expand_group_users g = self._ad_search(self.base_dn, ldap.SCOPE_SUBTREE, groupfilter, ['member']) File "/usr/local/lib/python2.6/dist-packages/TracActiveDirectoryAuth-0.3.2-py2.6.egg/tracext/adauth/auth.py", line 439, in _ad_search cur.execute("SELECT lut,data FROM ad_cache WHERE id='%s'" % key) File "/usr/local/lib/python2.6/dist-packages/Trac-1.0-py2.6.egg/trac/db/util.py", line 66, in execute return self.cursor.execute(sql) InternalError: FEHLER: aktuelle Transaktion wurde abgebrochen, Befehle werden bis zum Ende der Transaktion ignoriert
Any idea what's wrong?
Attachments (0)
Change History (6)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Description: | modified (diff) |
---|
comment:3 Changed 12 years ago by
I believe the correct database-agnostic fix for the issue in comment:1 is to utilize the db.quote(param)
function. See t:TracDev/DatabaseApi#GuidelinesforSQLStatements and:
comment:4 Changed 12 years ago by
As a follow-up to comment:3, I should add that my suggestion was speculative, and I've not had occasion to use the db.quote
function. I've been studying the Trac db
API lately though, and it seems like the function is intended for this circumstance. I'll be interested to see what you find while implementing the fix.
comment:5 follow-up: 6 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed the queries to match t:TracDev/DatabaseApi#GuidelinesforSQLStatements .. wish I had known that was there before .. ;-)
This fix will be in DirectoryAuthPlugin 0.5
comment:6 Changed 12 years ago by
Replying to sandinak:
Fixed the queries to match t:TracDev/DatabaseApi#GuidelinesforSQLStatements .. wish I had known that was there before .. ;-)
You are not alone. Failing to follow those guidelines is probably the most widespread problem with plugins.
There is also a problem with the query definition:
_ad_search:
postgresql does not like double quotes. I changed it to
for now. I don't know if it's the correct way.