Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#8762 closed (fixed)

regressiontests/comment_tests fail with postgreSQL (and likely other transactional backends)

Reported by: Richard Davies <richard.davies@…> Owned by: nobody
Component: contrib.comments Version: dev
Severity: Keywords:
Cc: richard.davies@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

A clean checkout of r8798 (current head) fails the comments_test regression test when run against postgresql (but not against sqlite):

$ ./runtests.py --settings=SETT_sqlite comment_tests
----------------------------------------------------------------------
Ran 64 tests in 4.348s

OK

vs.

$ ./runtests.py --settings=SETT_postgresql_psycopg2 comment_tests
Error: Database test_test couldn't be flushed. Possible reasons:
      * The database isn't running or isn't configured correctly.
      * At least one of the expected database tables doesn't exist.
      * The SQL was invalid.
    Hint: Look at the output of 'django-admin.py sqlflush'. That's the SQL this command wasn't able to run.
    The full error: current transaction is aborted, commands ignored until end of transaction block

I'm confident this isn't simply database misconfiguration, since other tests do work with postgreSQL.

Change History (6)

comment:1 by Malcolm Tredinnick, 16 years ago

milestone: 1.0

This works fine for me with both the postgresql and postgresql_pysocpg2 backends, so a few more details are going to be required. PostgreSQL version and psycopg version will be a good start. Are you running a completely unmodified Django? Are you able to test it with the psycopg2 backend and see if it occurs there?

Anything non-standard about the way your PostgreSQL is set up?

At the moment, you might be the only one can debug this since you have the failing case and it works in a standard (out of the box PostgreSQL and psycopg/psycopg2) setup. But the above information might provide some clues about something special in particular versions.

Leaving open for now, pending more information, so that if other people are seeing the same thing, maybe they can help diagnose.

comment:2 by Richard Davies <richard.davies@…>, 16 years ago

This occurs on a standard set-up, with a completely unmodified Django r8798 (I've just redownloaded, and reconfirmed). It's a Psycopg2 bug - I haven't tested Psycopg.

The machine is Ubuntu 8.04 ('Hardy Heron') with default packages (Python: 2.5.2-2ubuntu4.1, Psycopg2: 2.0.6-3, PostgreSQL: 8.3.3-0ubuntu0.8.04). PostgreSQL was installed this morning to test the other ticket that I'm working on.

Only possible peculiarity is that I'm running 64-bit Linux (on Intel, not AMD)

comment:3 by Malcolm Tredinnick, 16 years ago

turns out the key part is that you're running PostgreSQL 8.3, which doesn't do automatic type casting. So the error you saw is not the real error. We've tracked it down on IRC, though.

comment:4 by Malcolm Tredinnick, 16 years ago

milestone: 1.0

comment:5 by Jacob, 16 years ago

Resolution: fixed
Status: newclosed

(In [8800]) Make sure to use force_unicode when looking up comment objects by object_pk. Fixes #8762, and one other bug that nobody's reported yet.

comment:6 by Jacob, 13 years ago

milestone: 1.0

Milestone 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top