django-social-auth problem with facebook

215 views
Skip to first unread message

Jeff Hsu

unread,
Apr 15, 2013, 2:01:21 AM4/15/13
to django...@googlegroups.com
Hi, I just pip installed django-social-auth from omab today on github(beginner here).  I think I can almost get it to work with facebook login, but I always have this "InternalError: Exception Value: current transaction is aborted, commands ignored until end of transaction block", after I log in with my facebook account and before I redirect to the profile page.  The request url shows 
http://127.0.0.1:8000/complete/facebook/?redirect_state=xxx&code=xxx&state=xxx.  I'm using Django 1.5.  Can anybody give me some directions to debug this?

Thank you tons,
Jeff


Brad Pitcher

unread,
Apr 15, 2013, 11:49:49 AM4/15/13
to django-users
In my experience, that particular error always means that the database doesn't match what you have in your models. Try a syncdb and/or check your south migrations to make sure your database is up to date.

---------
Brad Pitcher
Software Developer
(702)723-8255


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jeff Hsu

unread,
Apr 15, 2013, 12:26:11 PM4/15/13
to django...@googlegroups.com
Thanks for the reply.  I did sync db before I run the code.  I am actually on localhost when I test it.  Do I have to be online to test it?  But, I was successful on authenticating in the Login Dialog.  This error happens during the code exchanging process for the access token I think.  

Thanks,
Jeff


--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/9YkrCD2veRQ/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.

Serdar Dalgic

unread,
Apr 15, 2013, 4:36:23 AM4/15/13
to django...@googlegroups.com
Hi, 

On Mon, Apr 15, 2013 at 9:01 AM, Jeff Hsu <jyhs...@gmail.com> wrote:
Hi, I just pip installed django-social-auth from omab today on github(beginner here).  I think I can almost get it to work with facebook login, but I always have this "InternalError: Exception Value: current transaction is aborted, commands ignored until end of transaction block", after I log in with my facebook account and before I redirect to the profile page.  The request url shows 
http://127.0.0.1:8000/complete/facebook/?redirect_state=xxx&code=xxx&state=xxx.  I'm using Django 1.5.  Can anybody give me some directions to debug this?


Your question is Django-Social-Auth specific. If you ask that question http://groups.google.com/group/django-social-auth you would get more accurate and fast answer. I'd suggest you to do so.

I've met the same error while using postgresql as the database, and the reason was that, when a transaction meets an error, it changes its stabilized state. If you do not rollback this transaction, further transactions after this one gives such error. You should find the problematic transaction to get rid of this error. For details, see https://docs.djangoproject.com/en/dev/topics/db/transactions/#handling-exceptions-within-postgresql-transactions

More info about this issue from Django Social Auth users/developers would appear on Django Social Auth mailing list.

--
- Serdar Dalgıç <s...@serdardalgic.org>
FLOSS Developer, Life & Nature Hacker
twitter: https://twitter.com/serdaroncode

Jeff Hsu

unread,
Apr 15, 2013, 1:50:36 PM4/15/13
to django...@googlegroups.com
Hello Serdar,

       Thank you so much, I do use postgresql as my database.  The problem might be what you listed above, I'll take deep look at it.  If I have more questions, I'll post it in that group.  Thank you!

Jeff


--

Jeff Hsu

unread,
Apr 15, 2013, 6:30:43 PM4/15/13
to django...@googlegroups.com
I solved the problem.  The problem is that I set up my project with south.  So, I have to use south migration to set up the proper database schema for social_auth.

Thanks,
Jeff

Jeff Hsu

unread,
Apr 16, 2013, 11:57:48 AM4/16/13
to django...@googlegroups.com
First, check to see if you have 3 tables, social_auth_association, social_auth_nonce, and social_auth_usersocialauth.  If not, you need to create those DB tables.  SyncDB did not work for me.  I had south installed.  So, you just do use south to create proper schema for those DB tables.  Some tutorial on south:http://south.readthedocs.org/en/latest/tutorial/part1.html

Jeff


On Tue, Apr 16, 2013 at 8:35 AM, Alex Ksenzov <alexh...@gmail.com> wrote:
Hi Jeff .I have this problem too, but still can't figure out. Can you please provide resolving more detail and step by step please. Thanks.


Rainy

unread,
Apr 17, 2013, 10:50:45 AM4/17/13
to django...@googlegroups.com
When you get this error, you need to look at your database error log, e.g. for postgres 8.4 on linux:

tail -n100 /var/log/postgresql-8.4-main.log

It should tell you the exact sql command that caused the first error (you might need to scroll up).
Reply all
Reply to author
Forward
0 new messages