Edgewall Software
Modify

Ticket #5096 (closed defect: worksforme)

Opened 5 years ago

Last modified 3 years ago

Error getting user's permissions with Postgres

Reported by: anonymous Owned by: jonas
Priority: normal Milestone:
Component: general Version: 0.10.3
Severity: normal Keywords: postgres pypgsql needinfo
Cc:
Release Notes:
API Changes:

Description (last modified by cboos) (diff)

http://trac.gajim.org/ticket/2468
Oops…
Trac detected an internal error:

If you think this really should work and you can reproduce it, you should consider reporting this problem to the Trac team.

Go to http://trac.edgewall.org/ and create a new ticket where you describe the problem, how to reproduce it. Don't forget to include the Python traceback found below.

TracGuide — The Trac User and Administration Guide
Python Traceback

Traceback (most recent call last):
  File "/var/lib/python-support/python2.4/trac/web/main.py", line 387, in dispatch_request
    dispatcher.dispatch(req)
  File "/var/lib/python-support/python2.4/trac/web/main.py", line 183, in dispatch
    req.perm = PermissionCache(self.env, req.authname)
  File "/var/lib/python-support/python2.4/trac/perm.py", line 263, in __init__
    self.perms = PermissionSystem(env).get_user_permissions(username)
  File "/var/lib/python-support/python2.4/trac/perm.py", line 227, in get_user_permissions
    for perm in self.store.get_user_permissions(username):
  File "/var/lib/python-support/python2.4/trac/perm.py", line 112, in get_user_permissions
    rows = cursor.fetchall()
  File "/usr/lib/python2.4/site-packages/pyPgSQL/PgSQL.py", line 3261, in fetchall
    return self.__fetchManyRows(self._rows_, _list)
  File "/usr/lib/python2.4/site-packages/pyPgSQL/PgSQL.py", line 2838, in __fetchManyRows
    _j = self.__fetchOneRow()
  File "/usr/lib/python2.4/site-packages/pyPgSQL/PgSQL.py", line 2813, in __fetchOneRow
    _j.append(_c.typecast(self.description[_i],
TypeError: unsubscriptable object

Attachments

Change History

comment:1 Changed 5 years ago by hyuga <hyugaricdeau@…>

  • Keywords needinfo added
  • Summary changed from Oops... to Error getting user's permissions with Postgre

comment:2 Changed 5 years ago by cboos

  • Description modified (diff)
  • Keywords postgres pgsql added
  • Summary changed from Error getting user's permissions with Postgre to Error getting user's permissions with Postgres
  • Version set to 0.10.3

comment:3 Changed 5 years ago by mgood

Are you the administrator of the Gajim site? If you're not the administrator please report it to their admin because they will need to provide more information to help in resolving this.

Based on the traceback this looks like it's likely to be a bug in pyPgSQL, so I'd recommend checking the version of pyPgSQL in use and upgrade it if possible.

comment:4 Changed 4 years ago by sid

  • Resolution set to worksforme
  • Status changed from new to closed

Closing due to lack of information. Most likely a pyPgSQL bug.

comment:5 Changed 4 years ago by hvram1 AT gmail.com

  • Resolution worksforme deleted
  • Status changed from closed to reopened

I get the same error and the same trace
This is the sequence of steps that I have done :

I have Trac set up and running for about 8 months. Trac authenticates using the LDAP Server . things were fine and there was no error.
Recently there was a requirement for access control. I applied the RBAC patch as described in ticket Ticket 898
Since I could not create groups in LDAP ( I am using the Zimbra LDAP server and there did not seem to be any easy way to create groups ) I created a set of groups in the auth.ini file

I also noticed that I had to create groups in the Web Admin tool in the wiki since this grouping in the ini file did not reflect in the UI . So I created a new group and also deleted the anonymous group / permissions .

I checked the version of PyPgsql? and I seem to have the latest version. (2.5.1) .

2007-09-27 10:37:11,469 Trac[main] ERROR: unsubscriptable object
Traceback (most recent call last):

File "/usr/lib/python2.4/site-pacages/trac/web/main.py", line 387, in dispatch_request dispatcher.dispatch(req)
File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 183, in dispatch req.perm = PermissionCache?(self.env, req.authname)
File "/usr/lib/python2.4/site-packages/trac/perm.py", line 263, in init self.perms = PermissionSystem?(env).get_user_permissions(username)
File "/usr/lib/python2.4/site-packages/trac/perm.py", line 227, in get_user_permissions for perm in self.store.get_user_permissions(username):
File "/usr/lib/python2.4/site-packages/trac/perm.py", line 112, in get_user_permissions rows = cursor.fetchall()
File "/usr/lib/python2.4/site-packages/pyPgSQL/PgSQL.py", line 3261, in fetchall

return self.fetchManyRows(self._rows_, _list)

File "/usr/lib/python2.4/site-packages/pyPgSQL/PgSQL.py", line 2838, in fetchManyRows

_j = self.fetchOneRow()

File "/usr/lib/python2.4/site-packages/pyPgSQL/PgSQL.py", line 2813, in fetchOneRow

_j.append(_c.typecast(self.description[_i],

TypeError?: unsubscriptable object

comment:6 follow-up: Changed 4 years ago by cboos

  • Keywords pypgsql added; pgsql removed
  • Milestone set to 0.10.5

#6236 reported a similar problem with fetchone on an empty result set.

comment:7 in reply to: ↑ 6 ; follow-up: Changed 4 years ago by Dave Abrahams <dave@…>

Replying to cboos:

#6236 reported a similar problem with fetchone on an empty result set.

Correction: the result set wasn't empty. It had one row. The cursor was getting its "res" attribute set to None somehow (and despite adding lots of tracing I was unable to find out where.) It appeared to be happening when a second thread processed a request while the cursor was still active.

comment:8 in reply to: ↑ 7 ; follow-up: Changed 4 years ago by Dave Abrahams <dave@…>

Replying to Dave Abrahams <dave@boost-consulting.com>:

Replying to cboos:

#6236 reported a similar problem with fetchone on an empty result set.

Correction: the result set wasn't empty. It had one row. The cursor was getting its "res" attribute set to None somehow (and despite adding lots of tracing I was unable to find out where.) It appeared to be happening when a second thread processed a request while the cursor was still active.

Further detail: here's what I wrote about it on IRC:

while one thread is iterating through a cursor, bitten.BuildConfigController?._render_overview gets called on another thread. It does a repository sync(), which somehow causes the other thread's cursor's .res to be None.

Using psycopg2 made all my problems go away

comment:9 follow-up: Changed 4 years ago by cboos

Does changing poolable = True to poolable = False in trac/db/postgres_backend.py make any difference?

comment:10 in reply to: ↑ 9 Changed 4 years ago by Dave Abrahams <dave@…>

Replying to cboos:

Does changing poolable = True to poolable = False in trac/db/postgres_backend.py make any difference?

No.

comment:11 in reply to: ↑ 8 Changed 3 years ago by cboos

  • Resolution set to worksforme
  • Status changed from reopened to closed

Replying to Dave Abrahams <dave@…>:

...
Using psycopg2 made all my problems go away

comment:12 Changed 3 years ago by cboos

  • Milestone 0.10.6 deleted
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from jonas. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.