/etc/pgbouncerng.ini
[local]
;host = unix:///var/run/postgresql/.s.PGSQL.5432
host = 127.0.0.1
port = 6666
ssl = false
ssl_key = example_server.key
ssl_crt = example_server.crt
[remote]
;host = unix:///var/run/postgresql/.s.PGSQL.5432
host = 127.0.0.1
port = 5432
ssl = false
[global]
poolsize = 20
maxconns = 200
/etc/postgresql/8.4/main/pg_hba.conf
[...]
Database administrative login by UNIX sockets
local all postgres trust
local all django trust
TYPE DATABASE USER CIDR-ADDRESS METHOD
"local" is for Unix domain socket connections only
local all all ident
IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 192.168.10.0/24 md5
IPv6 local connections:
host all all ::1/128 md5
/srv/codex/codex_hg/codex/settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'codex', # Or path to database file if using sqlite3.
'USER': 'django', # Not used with sqlite3.
'PASSWORD': 'holypassword', # Not used with sqlite3.
'HOST': '127.0.0.1', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '6666', # Set to empty string for default. Not used with sqlite3.
}
Product versions
Ubuntu Natty
PostgreSQL 8.4
python-gevent 0.13.0-1build1 gevent.version 0.13
django 1.4a1 rev17500
Traceback
Environment:
Request Method: GET
Request URL: http://codex.ithilien.eu/character/
Django Version: 1.4a1
Python Version: 2.7.1
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',
'web',
'django.contrib.databrowse',
'django_extensions',
'south',
'taggit')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File "/srv/django_svn/django-trunk/django/core/handlers/base.py" in get_response
-
response = callback(request, _callback_args, *_callback_kwargs)
File "/srv/codex/codex_hg/codex/web/views.py" in CharacterSectionView
-
highlightedresult = Character.objects.filter(highlight=True).order_by('?')[0]
File "/srv/django_svn/django-trunk/django/db/models/query.py" in getitem
-
File "/srv/django_svn/django-trunk/django/db/models/query.py" in len
-
self._result_cache.extend(self._iter)
File "/srv/django_svn/django-trunk/django/db/models/query.py" in iterator
-
for row in compiler.results_iter():
File "/srv/django_svn/django-trunk/django/db/models/sql/compiler.py" in results_iter
-
for rows in self.execute_sql(MULTI):
File "/srv/django_svn/django-trunk/django/db/models/sql/compiler.py" in execute_sql
-
cursor.execute(sql, params)
File "/srv/django_svn/django-trunk/django/db/backends/util.py" in execute
-
return self.cursor.execute(sql, params)
File "/srv/django_svn/django-trunk/django/db/backends/postgresql_psycopg2/base.py" in execute
-
return self.cursor.execute(query, args)
Exception Type: DatabaseError at /character/
Exception Value: SET TRANSACTION ISOLATION LEVEL debe ser llamado antes de cualquier consulta
Apache error logs
None
pgbouncer-ng logs
INFO: Now listening on 127.0.0.1:6666
DEBUG: New remote client connected from ('127.0.0.1', 51191)
DEBUG: Waiting for client data...
DEBUG: Creating socket for remote connection.
DEBUG: Connection not found on pool, creating new.
DEBUG: Authenticating client...
DEBUG: Entering on recv/send loop...
DEBUG: Connection is closed in any socket.
DEBUG: Client connection is break.
DEBUG: Reset database connection state.
DEBUG: Returning connection to pool.
DEBUG: Current pool size: 1
OK!
DEBUG: New remote client connected from ('127.0.0.1', 51193)
DEBUG: Waiting for client data...
DEBUG: Creating socket for remote connection.
DEBUG: Remote connection found on pool, returning this.
DEBUG: Authenticating client...
DEBUG: Entering on recv/send loop...
DEBUG: Connection is closed in any socket.
DEBUG: Server connection is break. Closing all connections.
ERROR!
DEBUG: New remote client connected from ('127.0.0.1', 51195)
DEBUG: Waiting for client data...
DEBUG: Creating socket for remote connection.
DEBUG: Connection not found on pool, creating new.
DEBUG: Authenticating client...
DEBUG: Entering on recv/send loop...
DEBUG: Connection is closed in any socket.
DEBUG: Client connection is break.
DEBUG: Reset database connection state.
DEBUG: Returning connection to pool.
DEBUG: Current pool size: 1
OK!
etc.