8000 Internal Server Error · Issue #75 · authomatic/authomatic · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Internal Server Error #75

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

Open
patchie opened this issue Dec 22, 2014 · 2 comments
Open

Internal Server Error #75

patchie opened this issue Dec 22, 2014 · 2 comments

Comments

@patchie
Copy link
patchie commented Dec 22, 2014

Hi,

I am using nginx and uwsgi on linux.

What i try to do: I just downloaded and implemented your files from your page: https://github.com/peterhudec/authomatic/tree/master/examples/flask/werkzeug_adapter.

  1. It starts up without problem.
  2. Then i choose the "facebook" link.
  3. It redirects me to facebook and i accept.
  4. It sends me back and gives me this error message shown below.

I receive this error message in the browser: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

Snippet of my uwsgi logfile:

doesnt work 4
Traceback (most recent call last):
  File "/media/sdy1/home/patchie/development/foo-authomatic/run.py", line 50, in login
    return render_template('login.html', result=result)
  File "/media/sdy1/home/patchie/.virtualenvs/foo-authomatic/local/lib/python2.7/site-packages/flask/templating.py", line 128, in render_template
    context, ctx.app)
  File "/media/sdy1/home/patchie/.virtualenvs/foo-authomatic/local/lib/python2.7/site-packages/flask/templating.py", line 110, in _render
    rv = template.render(context)
  File "/media/sdy1/home/patchie/.virtualenvs/foo-authomatic/local/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render
    return self.environment.handle_exception(exc_info, True)
  File "/media/sdy1/home/patchie/.virtualenvs/foo-authomatic/local/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/media/sdy1/home/patchie/development/foo-authomatic/templates/login.html", line 2, in top-level template code
    {% extends "base.html" %}
  File "/media/sdy1/home/patchie/development/foo-authomatic/templates/base.html", line 8, in top-level template code
    {% block body %}{% endblock %}
  File "/media/sdy1/home/patchie/development/foo-authomatic/templates/login.html", line 38, in block "body"
    {% if response.data.feed.data %}
  File "/media/sdy1/home/patchie/.virtualenvs/foo-authomatic/local/lib/python2.7/site-packages/jinja2/environment.py", line 397, in getattr
    return getattr(obj, attribute)
UndefinedError: 'dict object' has no attribute 'feed'
[pid: 5301|app: 0|req: 2/2] 10.0.0.1 () {50 vars in 2069 bytes} [Mon Dec 22 12:57:30 2014] GET /foo-authomatic/login/fb/?code=AQAJOzoKKM4jZIyQEzahYb-2h6KFN0LdakZGuUjtmbhdMNjyUq8Y5uVeOUq2zMicatDNJWFZr3Pp-sPaEmAuzKhkyirIhDvg_JyZ2izO-9eu81KH7ClFe7C2ay1qGcOwjt1LReWOSpfLEl3DGIt9bX0_L5KylIjR_J4U2KiCRTVMGSO6cbcFoVUjde37dlyLj0Fq_BGZtJDGlXMw5vvXsSiYvOQHNyAWmgCT5wWlA_m8J7J8NajLKYJ7K4dvWVsnrsJ-MbpmYqNyLQQdS_pVURaRO3SiJ5IIoPKOiMiXg7LWsyyBdXGStAWK5y9GIpFWDEY&state=0a51f3bea7e456592da5a2ddea => generated 291 bytes in 779 msecs (HTTP/1.0 500) 2 headers in 84 bytes (1 switches on core 0)

a snippet of my code is:

  # If there is no LoginResult object, the login procedure is still pending.
  if result:
    if result.user:
      # We need to update the user to get more info.
      result.user.update()

    # The rest happens inside the template.
    try:
      return render_template('login.html', result=result)
      print "works4"
    except:
      print "doesnt work 4"
      traceback.print_exc()
      return
  # Don't forget to return the response.
  return response

Any idea what i can do?

Thanks in advance!

@mrichar1
Copy link
Member

It looks like the template expects to receive feed data from facebok as part of the response: https://github.com/authomatic/authomatic/blob/master/examples/flask/werkzeug_adapter/templates/login.html#L38

However there is no response.data.feed attribute.

If this is intermittent, a simple fix would be to test for the presence of the feed attribute before querying it's data, something like:

{% if 'feed' in response data %}
  {% if response.data.feed.data %}
    Your 5 most recent statuses:<br />
                    
    {% for status in response.data.feed.data %}
      <h3>{{ status.message or status.name or status.story }}</h3>
        Posted on: {{ status.created_time }}
    {% endfor %}
  {% endif %}
{% endif %}

however if it always happens, then the issue is likely with the provider.

There have been several updates to the Facebook provider since this issue was made - so please can you let us know if you are still seeing this problem (assuming you are still using authomatic at this point).

@mrichar1
Copy link
Member

After several years of inactivity, authomatic is now under community management, and we have just released a new stable version (1.0.0).

We are now reviewing all issues and PRs and hoping to begin work to solve as many of these as possible.

We are keen to find out which issues still apply, and which PRs are still required/are likely to merge cleanly into the current code. We are aiming to review them all, but any help with prioritisation would be very useful!

If you are still interested in having this issue/PR resolved, or are able to help us work on it, please reply to this message. That way we know which issues are most important to the community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0