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

Lots of crashes since upgrading from 3.5.0 to 3.13.1 #201

Closed
mark-anders opened this issue Oct 26, 2018 · 3 comments
Closed

Lots of crashes since upgrading from 3.5.0 to 3.13.1 #201

mark-anders opened this issue Oct 26, 2018 · 3 comments

Comments

@mark-anders
Copy link

I think this might be the same thing as #86, but since I'm using different packages, I thought I'd report it anyway.

I'm using Flask-RESTful for some of my API work and I'm getting 500 returned for things like ExpiredSignatureError. I just got this when using with a react admin app I've written:

cs_1        | Traceback (most recent call last):
cs_1        |   File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
cs_1        |     rv = self.dispatch_request()
cs_1        |   File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1799, in dispatch_request
cs_1        |     return self.view_functions[rule.endpoint](**req.view_args)
cs_1        |   File "/usr/local/lib/python2.7/site-packages/flask_restful/__init__.py", line 480, in wrapper
cs_1        |     resp = resource(*args, **kwargs)
cs_1        |   File "/usr/local/lib/python2.7/site-packages/flask/views.py", line 88, in view
cs_1        |     return self.dispatch_request(*args, **kwargs)
cs_1        |   File "/usr/local/lib/python2.7/site-packages/flask_restful/__init__.py", line 595, in dispatch_request
cs_1        |     resp = meth(*args, **kwargs)
cs_1        |   File "/usr/local/lib/python2.7/site-packages/flask_jwt_extended/view_decorators.py", line 102, in wrapper
cs_1        |     verify_jwt_in_request()
cs_1        |   File "/usr/local/lib/python2.7/site-packages/flask_jwt_extended/view_decorators.py", line 31, in verify_jwt_in_request
cs_1        |     jwt_data = _decode_jwt_from_request(request_type='access')
cs_1        |   File "/usr/local/lib/python2.7/site-packages/flask_jwt_extended/view_decorators.py", line 265, in _decode_jwt_from_request
cs_1        |     decoded_token = decode_function()
cs_1        |   File "/usr/local/lib/python2.7/site-packages/flask_jwt_extended/view_decorators.py", line 194, in _decode_jwt_from_headers
cs_1        |     return decode_token(encoded_token)
cs_1        |   File "/usr/local/lib/python2.7/site-packages/flask_jwt_extended/utils.py", line 77, in decode_token
cs_1        |     encoded_token, verify=False, algorithms=config.algorithm
cs_1        |   File "/usr/local/lib/python2.7/site-packages/jwt/api_jwt.py", line 85, in decode
cs_1        |     payload, _, _, _ = self._load(jwt)
cs_1        |   File "/usr/local/lib/python2.7/site-packages/jwt/api_jws.py", line 184, in _load
cs_1        |     raise DecodeError('Not enough segments')
cs_1        | DecodeError: Not enough segments

As a test, I downgraded back to 3.5.0, which I had been using for a while, and am not seeing the issues.

@vimalloc
Copy link
Owner

Can you try setting app.config[‘PROPAGATE_EXCEPTIONS’] = True? I bet that will fix the issues for you. That was changed in 3.7.1 (https://github.com/vimalloc/flask-jwt-extended/releases/tag/3.7.1)

@mark-anders
Copy link
Author

Thanks! I think that fixed it. I hadn't read all of the release notes, but I see this was done to work around issues in Flask-RESTFul. Sorry about that!

Thanks again!

@vimalloc
Copy link
Owner

No problem, glad that fixed things up for you. I’m going to close this issue now, but don’t hesitate to re-open it or create a new one if you run into other problems.

Cheers.

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

2 participants