pallets-eco / flask-session

Server side session extension for Flask
https://flask-session.readthedocs.io
BSD 3-Clause "New" or "Revised" License
488 stars 236 forks source link

flask-session 0.6.0 causes runtime error #209

Closed kelvin-j-li closed 5 months ago

kelvin-j-li commented 5 months ago

Right after upgrading to 0.6.0 from 0.5.0, I got the below runtime error during start up in k8s env:

Traceback (most recent call last):
  File "/home/pyuser/app/main.py", line 115, in <module>
    Session(app)
  File "/home/pyuser/app/dist-packages/flask_session/__init__.py", line 48, in __init__
    self.init_app(app)
  File "/home/pyuser/app/dist-packages/flask_session/__init__.py", line 55, in init_app
    app.session_interface = self._get_interface(app)
  File "/home/pyuser/app/dist-packages/flask_session/__init__.py", line 115, in _get_interface
    session_interface = MongoDBSessionInterface(
TypeError: __init__() got an unexpected keyword argument 'sid_length'

Checking the source for 0.5.0 and 0.6.0 -- sid_length seems to be a new attribute introduced in the newer version (0.6.0) only.

davidism commented 5 months ago

0.6.0 was released by accident, it was intended to be a prerelease. We're considering whether to just keep going with a 0.6.1, or yank it and make a 0.6.0-rc1. For now, if something isn't working, you can report it and go back to 0.5.0 temporarily.

kelvin-j-li commented 5 months ago

Hi @davidism Thanks for your quick reply.

It turns out that it's my bad -- I forgot I had a manual patching of sessions.py in the build pipeline for pull request 154 to enable pymongo v4 support in flask-session-0.5.0. After I took out this manual patch, the error related 'sid_length' does not occur any more. And flask-session-0.6.0 also works with flask-3.0, which is great!

Best regards

Kelvin

pankajkoti commented 5 months ago

We have started observing few failures in our CI with errors with the new release.

TypeError: __init__() missing 6 required positional arguments: 'sequence', 'schema', 'bind_key', 'use_signer', 'permanent', and 'sid_length
davidism commented 5 months ago

@pankajkoti Be sure to include the full traceback when reporting an error, not only the final message. And please use a separate issue to report a separate issue.

Since the original report appears to have been sovled by the issue, I'll close this.