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

Uncaught exception for incorrect application name #60

Open
bnaul opened this issue Mar 17, 2016 · 3 comments
Open

Uncaught exception for incorrect application name #60

bnaul opened this issue Mar 17, 2016 · 3 comments

Comments

@bnaul
Copy link

bnaul commented Mar 17, 2016

Makes sense that this would fail but it was a bit tricky to debug because of the error. Changing our STORMPATH_APPLICATION config variable led to the following error:

ERROR:cesium.Flask.flask_app:Exception on /login [POST]
Traceback (most recent call last):
  File "/Users/brettnaul/miniconda3/envs/cesium/lib/python3.5/site-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/brettnaul/miniconda3/envs/cesium/lib/python3.5/site-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/brettnaul/miniconda3/envs/cesium/lib/python3.5/site-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/brettnaul/miniconda3/envs/cesium/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/Users/brettnaul/miniconda3/envs/cesium/lib/python3.5/site-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/brettnaul/miniconda3/envs/cesium/lib/python3.5/site-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/brettnaul/miniconda3/envs/cesium/lib/python3.5/site-packages/flask_stormpath/views.py", line 129, in login
    account = User.from_login(form.login.data, form.password.data)
  File "/Users/brettnaul/miniconda3/envs/cesium/lib/python3.5/site-packages/flask_stormpath/models.py", line 126, in from_login
    _user = current_app.stormpath_manager.application.authenticate_account(login, password).account
  File "/Users/brettnaul/miniconda3/envs/cesium/lib/python3.5/site-packages/flask_stormpath/__init__.py", line 271, in application
    )[0]
  File "/Users/brettnaul/miniconda3/envs/cesium/lib/python3.5/site-packages/stormpath/resources/base.py", line 450, in __getitem__
    return self.__dict__['items'][idx]
IndexError: list index out of range

Seems like this should be caught and reported in a nicer fashion.

@rdegges
Copy link
Contributor

rdegges commented Mar 18, 2016

Makes sense. This is a side-effect of the way our integration lazily-loads this data. I'm going to be changing this in the near future, so I'm leaving this issue open until it's resolved! <3

@peersa
Copy link

peersa commented Jul 3, 2016

I guess my problem is related, but I have a hard time see where the problem is. Trying to register a user.

2016-07-03T12:25:10.585315+00:00 app[web.1]: [2016-07-03 12:25:10 +0000] [8] [ERROR] Error handling request /register
2016-07-03T12:25:10.585332+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/workers/sync.py", line 130, in handle
2016-07-03T12:25:10.585328+00:00 app[web.1]: Traceback (most recent call last):
2016-07-03T12:25:10.585334+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/workers/sync.py", line 171, in handle_request
2016-07-03T12:25:10.585335+00:00 app[web.1]: respiter = self.wsgi(environ, resp.start_response)
2016-07-03T12:25:10.585338+00:00 app[web.1]: response = self.make_response(self.handle_exception(e))
2016-07-03T12:25:10.585333+00:00 app[web.1]: self.handle_request(listener, req, client, addr)
2016-07-03T12:25:10.585337+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.5/site-packages/flask/app.py", line 1820, in wsgi_app
2016-07-03T12:25:10.585337+00:00 app[web.1]: return self.wsgi_app(environ, start_response)
2016-07-03T12:25:10.585342+00:00 app[web.1]: response = self.full_dispatch_request()
2016-07-03T12:25:10.585343+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.5/site-packages/flask/app.py", line 1477, in full_dispatch_request
2016-07-03T12:25:10.585340+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
2016-07-03T12:25:10.585336+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.5/site-packages/flask/app.py", line 1836, in call
2016-07-03T12:25:10.585339+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.5/site-packages/flask/app.py", line 1403, in handle_exception
2016-07-03T12:25:10.585339+00:00 app[web.1]: reraise(exc_type, exc_value, tb)
2016-07-03T12:25:10.585345+00:00 app[web.1]: reraise(exc_type, exc_value, tb)
2016-07-03T12:25:10.585341+00:00 app[web.1]: raise value
2016-07-03T12:25:10.585346+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
2016-07-03T12:25:10.585343+00:00 app[web.1]: rv = self.handle_user_exception(e)
2016-07-03T12:25:10.585341+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.5/site-packages/flask/app.py", line 1817, in wsgi_app
2016-07-03T12:25:10.585346+00:00 app[web.1]: raise value
2016-07-03T12:25:10.585349+00:00 app[web.1]: return self.view_functionsrule.endpoint
2016-07-03T12:25:10.585350+00:00 app[web.1]: account = User.create(**data)
2016-07-03T12:25:10.585350+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.5/site-packages/flask_stormpath/views.py", line 78, in register
2016-07-03T12:25:10.585351+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.5/site-packages/flask_stormpath/models.py", line 101, in create
2016-07-03T12:25:10.585344+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.5/site-packages/flask/app.py", line 1381, in handle_user_exception
2016-07-03T12:25:10.585352+00:00 app[web.1]: _user = current_app.stormpath_manager.application.accounts.create({
2016-07-03T12:25:10.585354+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.5/site-packages/stormpath/resources/base.py", line 447, in getitem
2016-07-03T12:25:10.585347+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.5/site-packages/flask/app.py", line 1475, in full_dispatch_request
2016-07-03T12:25:10.585353+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.5/site-packages/flask_stormpath/init.py", line 271, in application
2016-07-03T12:25:10.585347+00:00 app[web.1]: rv = self.dispatch_request()
2016-07-03T12:25:10.585348+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.5/site-packages/flask/app.py", line 1461, in dispatch_request
2016-07-03T12:25:10.585355+00:00 app[web.1]: return self.dict['items'][idx]
2016-07-03T12:25:10.585355+00:00 app[web.1]: IndexError: list index out of range
2016-07-03T12:25:10.585353+00:00 app[web.1]: )[0]

@jphilipsen05
Copy link

@peersa I'm not sure if you got your error figured out or if this will help someone else. The config for 'STORMPATH_APPLICATION' has to be the name of your app in stormpath. I had the application url in there and that wasn't going to work so if your using your test instance they created it would be like this:
STORMPATH_APPLICATION='My Application

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

4 participants