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

500 HTTP error on login #235

Open
ofzza opened this issue Oct 17, 2018 · 0 comments
Open

500 HTTP error on login #235

ofzza opened this issue Oct 17, 2018 · 0 comments
Assignees
Labels

Comments

@ofzza
Copy link
Contributor

ofzza commented Oct 17, 2018

On staging server, on failed login the API returns a 500 HTTP error:

POST /ThreatKB/login
{"email":"[email protected]","password":"*******"}

AttributeError
AttributeError: 'AnonymousUserMixin' object has no attribute 'id'

Traceback (most recent call last)
File "/opt/threatkb/env/lib/python2.7/site-packages/flask/app.py", line 1701, in __call__
                                'Flask.blueprints instead'), stacklevel=2)
        return self.blueprints
 
    def __call__(self, environ, start_response):
        """Shortcut for :attr:`wsgi_app`."""
        return self.wsgi_app(environ, start_response)
File "/opt/threatkb/env/lib/python2.7/site-packages/flask/app.py", line 1689, in wsgi_app
        """
        with self.request_context(environ):
            try:
                response = self.full_dispatch_request()
            except Exception, e:
                response = self.make_response(self.handle_exception(e))
            return response(environ, start_response)
 
    @property
    def modules(self):
        from warnings import warn
File "/opt/threatkb/env/lib/python2.7/site-packages/flask/app.py", line 1687, in wsgi_app
                               a list of headers and an optional
                               exception context to start the response
        """
        with self.request_context(environ):
            try:
                response = self.full_dispatch_request()
            except Exception, e:
                response = self.make_response(self.handle_exception(e))
            return response(environ, start_response)
 
    @property
File "/opt/threatkb/env/lib/python2.7/site-packages/flask/app.py", line 1360, in full_dispatch_request
            request_started.send(self)
            rv = self.preprocess_request()
            if rv is None:
                rv = self.dispatch_request()
        except Exception, e:
            rv = self.handle_user_exception(e)
        response = self.make_response(rv)
        response = self.process_response(response)
        request_finished.send(self, response=response)
        return response
 
File "/opt/threatkb/env/lib/python2.7/site-packages/flask/app.py", line 1262, in handle_user_exception
        if handlers is not None:
            blueprint_handlers = handlers.get(None, ())
        app_handlers = self.error_handler_spec[None].get(None, ())
        for typecheck, handler in chain(blueprint_handlers, app_handlers):
            if isinstance(e, typecheck):
                return handler(e)
 
        raise exc_type, exc_value, tb
 
    def handle_exception(self, e):
        """Default exception handling that kicks in when an exception
File "/opt/threatkb/app/routes/error_handling.py", line 24, in handle_exception
 
    stacktrace = "%s" % (
        re.sub(r'\"[^\"]+\/([^\"]+)', r"\1", traceback.format_exc().replace("\n", "<BR>").replace(" ", "&nbsp;")))
    err = Error(
        stacktrace=traceback.format_exc(),
        user_id=current_user.id,
        remote_addr=request.remote_addr,
        args=str(request.args.to_dict(flat=False)),
        method=request.method,
        route=request.url_rule
    )
File "/opt/threatkb/env/lib/python2.7/site-packages/werkzeug/local.py", line 347, in __getattr__
            return []
 
    def __getattr__(self, name):
        if name == '__members__':
            return dir(self._get_current_object())
        return getattr(self._get_current_object(), name)
 
    def __setitem__(self, key, value):
        self._get_current_object()[key] = value
 
    def __delitem__(self, key):
AttributeError: 'AnonymousUserMixin' object has no attribute 'id'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Ready
Development

No branches or pull requests

2 participants