chaos testing: wrong user/pass combo gives "TypeError: Object of type AttributeError is not JSON serializable" #9

Closed
opened 3 years ago by decentral1se · 1 comments

Try to log in with wrong username/password and it errors out with:

Traceback (most recent call last):
  File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/app.py", line 2091, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/app.py", line 2076, in wsgi_app
    response = self.handle_exception(e)
  File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/app.py", line 1519, in full_dispatch_request
    return self.finalize_request(rv)
  File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/app.py", line 1540, in finalize_request
    response = self.process_response(response)
  File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/app.py", line 1888, in process_response
    self.session_interface.save_session(self, ctx.session, response)
  File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/sessions.py", line 394, in save_session
    val = self.get_signing_serializer(app).dumps(dict(session))  # type: ignore
  File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/itsdangerous/serializer.py", line 207, in dumps
    payload = want_bytes(self.dump_payload(obj))
  File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/itsdangerous/url_safe.py", line 53, in dump_payload
    json = super().dump_payload(obj)
  File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/itsdangerous/serializer.py", line 169, in dump_payload
    return want_bytes(self.serializer.dumps(obj, **self.serializer_kwargs))
  File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/json/tag.py", line 308, in dumps
    return dumps(self.tag(value), separators=(",", ":"))
  File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/json/__init__.py", line 133, in dumps
    rv = _json.dumps(obj, **kwargs)
  File "/home/d/.pyenv/versions/3.9.0/lib/python3.9/json/__init__.py", line 234, in dumps
    return cls(
  File "/home/d/.pyenv/versions/3.9.0/lib/python3.9/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/home/d/.pyenv/versions/3.9.0/lib/python3.9/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/json/__init__.py", line 57, in default
    return super().default(o)
  File "/home/d/.pyenv/versions/3.9.0/lib/python3.9/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type AttributeError is not JSON serializable
g
Try to log in with wrong username/password and it errors out with: ``` Traceback (most recent call last): File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/app.py", line 2091, in __call__ return self.wsgi_app(environ, start_response) File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/app.py", line 2076, in wsgi_app response = self.handle_exception(e) File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app response = self.full_dispatch_request() File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/app.py", line 1519, in full_dispatch_request return self.finalize_request(rv) File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/app.py", line 1540, in finalize_request response = self.process_response(response) File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/app.py", line 1888, in process_response self.session_interface.save_session(self, ctx.session, response) File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/sessions.py", line 394, in save_session val = self.get_signing_serializer(app).dumps(dict(session)) # type: ignore File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/itsdangerous/serializer.py", line 207, in dumps payload = want_bytes(self.dump_payload(obj)) File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/itsdangerous/url_safe.py", line 53, in dump_payload json = super().dump_payload(obj) File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/itsdangerous/serializer.py", line 169, in dump_payload return want_bytes(self.serializer.dumps(obj, **self.serializer_kwargs)) File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/json/tag.py", line 308, in dumps return dumps(self.tag(value), separators=(",", ":")) File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/json/__init__.py", line 133, in dumps rv = _json.dumps(obj, **kwargs) File "/home/d/.pyenv/versions/3.9.0/lib/python3.9/json/__init__.py", line 234, in dumps return cls( File "/home/d/.pyenv/versions/3.9.0/lib/python3.9/json/encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) File "/home/d/.pyenv/versions/3.9.0/lib/python3.9/json/encoder.py", line 257, in iterencode return _iterencode(o, 0) File "/home/d/work/varia/distribusi-verse/.venv/lib/python3.9/site-packages/flask/json/__init__.py", line 57, in default return super().default(o) File "/home/d/.pyenv/versions/3.9.0/lib/python3.9/json/encoder.py", line 179, in default raise TypeError(f'Object of type {o.__class__.__name__} ' TypeError: Object of type AttributeError is not JSON serializable g ```
decentral1se changed title from chaos testing: wrong user/pass combo leads to TypeError: Object of type AttributeError is not JSON serializable to chaos testing: wrong user/pass combo gives "TypeError: Object of type AttributeError is not JSON serializable" 3 years ago
Owner

b4b9b7ed58

Well spotted, I made another item on the klusboard to review some of the user feedback.

b4b9b7ed58 Well spotted, I made another item on the klusboard to review some of the user feedback.
crunk closed this issue 3 years ago
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.