Re: Django, Postgres and Core Dumps

2007-07-01 Thread Vikrant

Hi,

I am running postgresql with pyscopg2. I have put the details on my
blog post at http://www.vyomtech.com/vyomcms/pyscopg2onubuntu64bit.html
The essence is first you uninstall your existing python-psycopg2
package. Then install python-dev (in your case it would be 2.5) and
then download the psycopg2 source and install by command sudo python
setup.py install in pyscopg2 source directory.

If you have any questions let me know.

Vikrant


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django, Postgres and Core Dumps

2007-05-26 Thread Sam Morris

On Sat, 26 May 2007 19:28:03 +1000, Malcolm Tredinnick wrote:
> On Sat, 2007-05-26 at 02:20 -0700, Grant D. Watson wrote:
>> Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
>> 
>> > > In an unusually (for Ubuntu) boneheaded move, it
>> > looks
>> > > like Ubuntu doesn't leave core files for packaged programs, even
>> > > after a "ulimit -c unlimited".  Any other way to pull this off?
>> > 
>> > I wouldn't have thought it was possible to permanently disable that,
>> > so
>> > my first thought would be you haven't changed the limits for the
>> > right
>> > process.
>> 
>> Entirely possible, but I ran the "ulimit -c unlimited" in the same bash
>> session that I subsequently ran the sync in.
>> 
>> > Is Python crashing? Or the PostgreSQL server?
>> 
>> Python:
>>   ~$ python project/manage.py syncdb
>>   Segmentation fault (core dumped)
> 
> Oh, right. :-(
> 
> I think you're a little bit doomed here, if Ubuntu ships stripped
> binaries. On a Fedora system I would install the *-debuginfo at this
> point. Then you could try
> 
> gdb python
> ...
> (gdb) run manage.py syncdb
> 
> and at least you will be in gdb when it crashes and can type "bt" to see
> what's going on. Though, as I said, with stripped binaries this is going
> to tell you nuffink.

On Debian, Ubuntu & friends the package is python-dbg. After installing 
that, run 'gdb python-dbg', and then use gdb normally.

BTW, the updated python 2.5.1 package entered feisty-updates recently, so 
assuming you have a line like this in your sources.list:

  ## Major bug fix updates produced after the final release of the
  deb http://gb.archive.ubuntu.com/ubuntu feisty-updates main restricted 
universe multiverse

then a normal upgrade should pull it in. You can check which version
of the python package you have installed with a command like:

$ apt-cache policy python
python:
  Installed: 2.5.1-0ubuntu3
  Candidate: 2.5.1-0ubuntu3
  Version table:
 *** 2.5.1-0ubuntu3 0
500 http://gb.archive.ubuntu.com feisty-updates/main Packages
100 /var/lib/dpkg/status
 2.5.1~rc1-0ubuntu3 0
500 http://gb.archive.ubuntu.com feisty/main Packages

-- 
Sam Morris
http://robots.org.uk/

PGP key id 1024D/5EA01078
3412 EA18 1277 354B 991B  C869 B219 7FDB 5EA0 1078


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django, Postgres and Core Dumps

2007-05-26 Thread Eugene Morozov

Hello,
Here it is: https://bugs.launchpad.net/bugs/108067

I've planned to make a public repository with fixed packages, but I'm
too busy for this.

Anyway, you can take Feisty package, replace source code with
downloaded 2.0.6 source code from psycopg site, bump version number in
debian changelog and build the new package. It's easy, I've done it in
less than 10 minutes.
Eugene

On 26 май, 16:54, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> On Sat, 2007-05-26 at 12:42 +, Eugene Morozov wrote:
> > python-psycopg2 package in Ubuntu Feisty for x86-64 is completely
> > broken. I've reported it in the Launchpad on the next day after
> > release, but maintainer is still reluctant to apply patch which should
> > fix 64 bit issues.
>
> Ha ha! Problem understood, at least then.
>
> Do you have a Launchpad bug number for this, Eugene (or, better, a URL)?
> It'd be nice to know so that we can point others to it if they hit the
> same problems.
>
> Regards,
> Malcolm


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django, Postgres and Core Dumps

2007-05-26 Thread Malcolm Tredinnick

On Sat, 2007-05-26 at 12:42 +, Eugene Morozov wrote:
> python-psycopg2 package in Ubuntu Feisty for x86-64 is completely
> broken. I've reported it in the Launchpad on the next day after
> release, but maintainer is still reluctant to apply patch which should
> fix 64 bit issues.

Ha ha! Problem understood, at least then.

Do you have a Launchpad bug number for this, Eugene (or, better, a URL)?
It'd be nice to know so that we can point others to it if they hit the
same problems.

Regards,
Malcolm



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django, Postgres and Core Dumps

2007-05-26 Thread Eugene Morozov

python-psycopg2 package in Ubuntu Feisty for x86-64 is completely
broken. I've reported it in the Launchpad on the next day after
release, but maintainer is still reluctant to apply patch which should
fix 64 bit issues.

I've solved the problem by downloading upstream beta version and
compiling a custom package from it.
Eugene


On 26 май, 07:51, "Grant D. Watson" <[EMAIL PROTECTED]> wrote:
> I'm a newbie to Django.  It looks amazing, and I've
> decided to give it a whirl, but when I try a syncdb on
> my new project I get a core dump; the only things I've
> changed in settings.py are ADMINS and DATABASE_*.
> Given the context I assume it's something to do with
> the psycopg2 library and Django?
>
> I'm running Ubuntu Feisty (amd64) with repository
> versions of Python (2.5.1c1), PostgreSQL (8.2.4) and
> python-psycopg2 (2.0.1.5-6).  I'm using Django 0.96
> installed with setup.py.
>
> I suspected the sameuser identification for Postgres
> was causing problems, but I changed it to md5 with no
> luck.
>
> I wasn't able to find anything terribly helpful on the
> web or in the list archives.  Does anybody know what
> might be causing this?
>
> Grant D. Watson, <[EMAIL PROTECTED]>
>
>   
> Shape
>  Yahoo! in your own image.  Join our Network Research Panel today!  
> http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django, Postgres and Core Dumps

2007-05-26 Thread Grant D. Watson

Of course I omitted the part that might be marginally more useful:

(gdb) bt
#0  0x00418f22 in ?? ()
#1  0x00419a10 in PyObject_CallMethod ()
#2  0x2b062bf4c7e3 in microprotocol_getquoted ()
   from /usr/lib/python2.5/site-packages/psycopg2/_psycopg.so
#3  0x2b062bf4e29b in ?? ()
   from /usr/lib/python2.5/site-packages/psycopg2/_psycopg.so
#4  0x2b062bf4efa8 in ?? ()
   from /usr/lib/python2.5/site-packages/psycopg2/_psycopg.so
#5  0x2b062bf4f7ff in ?? ()
   from /usr/lib/python2.5/site-packages/psycopg2/_psycopg.so
#6  0x004885fd in PyEval_EvalFrameEx ()
#7  0x00488951 in PyEval_EvalFrameEx ()
#8  0x004895da in PyEval_EvalCodeEx ()
#9  0x004878e5 in PyEval_EvalFrameEx ()
#10 0x004895da in PyEval_EvalCodeEx ()
#11 0x004878e5 in PyEval_EvalFrameEx ()
#12 0x004895da in PyEval_EvalCodeEx ()
#13 0x004878e5 in PyEval_EvalFrameEx ()
#14 0x004895da in PyEval_EvalCodeEx ()
#15 0x00489622 in PyEval_EvalCode ()
#16 0x004aad1e in PyRun_FileExFlags ()
#17 0x004aafb0 in PyRun_SimpleFileExFlags ()
#18 0x004146b5 in Py_Main ()
#19 0x2b062a7388e4 in __libc_start_main () from /lib/libc.so.6
#20 0x00413bf9 in _start ()

Grant D. Watson, <[EMAIL PROTECTED]>


   
Take
 the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, 
photos & more. 
http://mobile.yahoo.com/go?refer=1GNXIC

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django, Postgres and Core Dumps

2007-05-26 Thread Grant D. Watson

--- Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> I think you're a little bit doomed here, if Ubuntu
> ships stripped
> binaries. On a Fedora system I would install the
> *-debuginfo at this
> point. Then you could try
> 
> gdb python
> ...
> (gdb) run manage.py syncdb
> 
> and at least you will be in gdb when it crashes and
> can type "bt" to see
> what's going on. Though, as I said, with stripped
> binaries this is going
> to tell you nuffink.

True enough.  Toward the top of a very symbol-free
call stack was:
  [Thread debugging using libthread_db enabled]
  [New Thread 47305485371120 (LWP 3023)]
Don't know whether that's a useful clue to you or not.
 I don't know enough about the implementation of
Python to know whether that'd be the interpreter or
the module.

> I'm really not sure what else to suggest here.
> 
> One last idea: since you're using Python 2.5, you
> could try using the
> sqlite3 backend (it's shipped standard with 2.5) and
> see if that gets
> you through syncdb. No changes other than one line
> settings.py will be
> needed. That might tell us what we already suspect
> (that psycopg2 is
> involved somehow).

  Of course I didn't think of that.  That works,
and sqlite will do the job quite well for just playing
around with Django.

I wish I had more info for you-- and to satisfy my
curiosity; I guess I'll learn to live with the
uncertainty.  :-P

Thanks very much for your help.

Grant D. Watson, <[EMAIL PROTECTED]>


   
Choose
 the right car based on your needs.  Check out Yahoo! Autos new Car Finder tool.
http://autos.yahoo.com/carfinder/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django, Postgres and Core Dumps

2007-05-26 Thread Malcolm Tredinnick

On Sat, 2007-05-26 at 02:20 -0700, Grant D. Watson wrote:
> Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> 
> > > In an unusually (for Ubuntu) boneheaded move, it
> > looks
> > > like Ubuntu doesn't leave core files for packaged
> > > programs, even after a "ulimit -c unlimited".  Any
> > > other way to pull this off?
> > 
> > I wouldn't have thought it was possible to
> > permanently disable that, so
> > my first thought would be you haven't changed the
> > limits for the right
> > process.
> 
> Entirely possible, but I ran the "ulimit -c unlimited"
> in the same bash session that I subsequently ran the
> sync in.
> 
> > Is Python crashing? Or the PostgreSQL
> > server?
> 
> Python:
>   ~$ python project/manage.py syncdb
>   Segmentation fault (core dumped)

Oh, right. :-(

I think you're a little bit doomed here, if Ubuntu ships stripped
binaries. On a Fedora system I would install the *-debuginfo at this
point. Then you could try

gdb python
...
(gdb) run manage.py syncdb

and at least you will be in gdb when it crashes and can type "bt" to see
what's going on. Though, as I said, with stripped binaries this is going
to tell you nuffink.

I'm really not sure what else to suggest here.

One last idea: since you're using Python 2.5, you could try using the
sqlite3 backend (it's shipped standard with 2.5) and see if that gets
you through syncdb. No changes other than one line settings.py will be
needed. That might tell us what we already suspect (that psycopg2 is
involved somehow).

Cheers,
Malcolm



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django, Postgres and Core Dumps

2007-05-26 Thread Grant D. Watson

Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:

> > In an unusually (for Ubuntu) boneheaded move, it
> looks
> > like Ubuntu doesn't leave core files for packaged
> > programs, even after a "ulimit -c unlimited".  Any
> > other way to pull this off?
> 
> I wouldn't have thought it was possible to
> permanently disable that, so
> my first thought would be you haven't changed the
> limits for the right
> process.

Entirely possible, but I ran the "ulimit -c unlimited"
in the same bash session that I subsequently ran the
sync in.

> Is Python crashing? Or the PostgreSQL
> server?

Python:
  ~$ python project/manage.py syncdb
  Segmentation fault (core dumped)

> Are you running with the dev server or with
> mod_python? The latter case
> might be harder to debug.

I wasn't running either, actually.  I was following
the introductory steps of the tutorial
,
and I didn't know that was necessary.  But now I find
that if I start the dev server in another terminal
first I get the same crash.

The "Welcome to Django" page on port 8000 seems to
work just fine, though.

Grant D. Watson, <[EMAIL PROTECTED]>


 

Looking for earth-friendly autos? 
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django, Postgres and Core Dumps

2007-05-25 Thread Malcolm Tredinnick

On Fri, 2007-05-25 at 22:46 -0700, Grant D. Watson wrote:
> > No idea about the core dump -- it's not very usual
> > (for Python).
> 
> Definitely my experience.
> 
> > However, you will have to do something about your
> > Python version. Either
> 
> I checked, and as Jeremy said an update was just
> released recently; I've upgraded to 2.5.1.  Thanks for
> the heads-up.
> 
> > Is there sufficient debug information in the
> > coredump that can run "gdb
> > python core.dump" and see from the backtrace what is
> > actually causing
> > the problem? It certainly sounds like it would be
> 
> In an unusually (for Ubuntu) boneheaded move, it looks
> like Ubuntu doesn't leave core files for packaged
> programs, even after a "ulimit -c unlimited".  Any
> other way to pull this off?

I wouldn't have thought it was possible to permanently disable that, so
my first thought would be you haven't changed the limits for the right
process. Is Python crashing? Or the PostgreSQL server?

Are you running with the dev server or with mod_python? The latter case
might be harder to debug.

Malcolm


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django, Postgres and Core Dumps

2007-05-25 Thread Grant D. Watson

> No idea about the core dump -- it's not very usual
> (for Python).

Definitely my experience.

> However, you will have to do something about your
> Python version. Either

I checked, and as Jeremy said an update was just
released recently; I've upgraded to 2.5.1.  Thanks for
the heads-up.

> Is there sufficient debug information in the
> coredump that can run "gdb
> python core.dump" and see from the backtrace what is
> actually causing
> the problem? It certainly sounds like it would be

In an unusually (for Ubuntu) boneheaded move, it looks
like Ubuntu doesn't leave core files for packaged
programs, even after a "ulimit -c unlimited".  Any
other way to pull this off?

(The crash does seem to occur after Django
authenticates with the database; I've turned sameuser
authentication back on, and running the code as a
different user generates a Python stack trace
complaining of failed authentication.)

Grant D. Watson, <[EMAIL PROTECTED]>


 

We won't tell. Get more on shows you hate to love 
(and love to hate): Yahoo! TV's Guilty Pleasures list.
http://tv.yahoo.com/collections/265 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django, Postgres and Core Dumps

2007-05-25 Thread Jeremy Dunck

On 5/25/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> However, you will have to do something about your Python version. Either
> downgrade to 2.5.0 or upgrade to 2.5.1 proper. The problem is that there
> was a regression in the 2.5.1-pre-releases with the way dictionary
> subclasses are initialised and this causes a problem with Django; the
> regression was fixed in 2.5.1-final. This was pointed out very early to
> the Ubuntu guys (I think before Feisty final was released) and I thought
> there was an upgraded package in the pipeline, but it may not have been
> released yet (not an Ubuntu user myself, so not entirely familiar with
> how to check this out easily).

In fact, I ran into a 1c1 regression yesterday, spent part of the day
building 2.5.1 and associated stuff from scratch, and then awoke this
morning to a newly-available 2.5.1 ubuntu package.

I'm lucky like that-- but everyone using ubu feisty should definitely
apt-get update/install.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django, Postgres and Core Dumps

2007-05-25 Thread Malcolm Tredinnick

On Fri, 2007-05-25 at 20:51 -0700, Grant D. Watson wrote:
> I'm a newbie to Django.  It looks amazing, and I've
> decided to give it a whirl, but when I try a syncdb on
> my new project I get a core dump; the only things I've
> changed in settings.py are ADMINS and DATABASE_*. 
> Given the context I assume it's something to do with
> the psycopg2 library and Django?
> 
> I'm running Ubuntu Feisty (amd64) with repository
> versions of Python (2.5.1c1), 

No idea about the core dump -- it's not very usual (for Python).

However, you will have to do something about your Python version. Either
downgrade to 2.5.0 or upgrade to 2.5.1 proper. The problem is that there
was a regression in the 2.5.1-pre-releases with the way dictionary
subclasses are initialised and this causes a problem with Django; the
regression was fixed in 2.5.1-final. This was pointed out very early to
the Ubuntu guys (I think before Feisty final was released) and I thought
there was an upgraded package in the pipeline, but it may not have been
released yet (not an Ubuntu user myself, so not entirely familiar with
how to check this out easily).

> PostgreSQL (8.2.4) and
> python-psycopg2 (2.0.1.5-6).  I'm using Django 0.96
> installed with setup.py.
> 
> I suspected the sameuser identification for Postgres
> was causing problems, but I changed it to md5 with no
> luck.

Is there sufficient debug information in the coredump that can run "gdb
python core.dump" and see from the backtrace what is actually causing
the problem? It certainly sounds like it would be something like
psyscopg2, since Python itself almost never core dumps, so it's more
likely to be something running in C -- like a loaded module (of course,
this is just playing the odds, not a definitive answer). I use pretty
much the same setup as you, although with Python 2.4, on a 64-bit system
without problems.

Regards,
Malcolm


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django, Postgres and Core Dumps

2007-05-25 Thread Grant D. Watson

I'm a newbie to Django.  It looks amazing, and I've
decided to give it a whirl, but when I try a syncdb on
my new project I get a core dump; the only things I've
changed in settings.py are ADMINS and DATABASE_*. 
Given the context I assume it's something to do with
the psycopg2 library and Django?

I'm running Ubuntu Feisty (amd64) with repository
versions of Python (2.5.1c1), PostgreSQL (8.2.4) and
python-psycopg2 (2.0.1.5-6).  I'm using Django 0.96
installed with setup.py.

I suspected the sameuser identification for Postgres
was causing problems, but I changed it to md5 with no
luck.

I wasn't able to find anything terribly helpful on the
web or in the list archives.  Does anybody know what
might be causing this?

Grant D. Watson, <[EMAIL PROTECTED]>


  
Shape
 Yahoo! in your own image.  Join our Network Research Panel today!   
http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---