Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe not related to fandjango: user.oauth_token.extend() fails very often #56

Closed
Morpho opened this issue Mar 8, 2012 · 5 comments
Closed

Comments

@Morpho
Copy link

Morpho commented Mar 8, 2012

About 10% of the requests generated by user.oauth_token.extend() fail. I have no clue why exactly they fail. Facebook returns the following:
response = {u'error_code': 1, u'error_msg': u'An unknown error occurred'}

So in models.py line 256 an AttributeError exception is raised, because it cannot parse the response.

  1. components = parse_qs(response)

Do you guys have any clue why Facebook returns that error?

@jgorset
Copy link
Owner

jgorset commented Mar 8, 2012

Hi @Morpho,

I haven't had the opportunity to run the latest version in production yet. Have you enabled the migration in your application's settings on Facebook?

@Morpho
Copy link
Author

Morpho commented Mar 8, 2012

Yes everything is enabled. I am using the newest version of the Facebook API, so no more "offline access", new auth dialog, etc. Its just weird that it only fails sometimes, without any reason. I will look further into it and let you know here. Besides of that, your code is VERY stable and runs without any exceptions. I really love it!

@jgorset
Copy link
Owner

jgorset commented Mar 8, 2012

Thanks!

If the issue persists, we might consider to catch and ignore the exception until Facebook sorts it out (presuming it's a bug on their side, which seems likely).

@mbaechtold
Copy link

And here's a stacktrace:

AttributeError: 'dict' object has no attribute 'split'

Stacktrace (most recent call last):

  File "django/core/handlers/base.py", line 168, in get_response
    receivers = signals.got_request_exception.send(sender=self.__class__, request=request)

  File "fandjango/middleware.py", line 102, in process_request
    user.oauth_token.extend()

  File "fandjango/models.py", line 256, in extend
    components = parse_qs(response)

  File "python2.6/urlparse.py", line 337, in parse_qs
    for name, value in parse_qsl(qs, keep_blank_values, strict_parsing):

  File "python2.6/urlparse.py", line 363, in parse_qsl
    pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')]

@jgorset
Copy link
Owner

jgorset commented Mar 13, 2012

Thanks guys. I've made some configurations to ignore exceptions raised by extend until Facebook resolves this issue.

$ pip install fandjango --upgrade

@jgorset jgorset closed this as completed Mar 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants