brettkromkamp / contextualise

Contextualise is an effective tool particularly suited for organising information-heavy projects and activities consisting of unstructured and widely diverse data and information resources
https://contextualise.dev/
MIT License
1.05k stars 44 forks source link

ValueError: User model must contain fs_uniquifier as of 4.0.0 #108

Closed mmsrubar closed 2 years ago

mmsrubar commented 3 years ago

Hi, I'm trying to get working a developement version in a docker container using base image https://hub.docker.com/_/postgres. I managed to get to flask run but it end it up with the following error

(playground) root@b3156e139c10:~/contextualise# flask run
 * Serving Flask app 'contextualise' (lazy loading)
 * Environment: development
 * Debug mode: on
Traceback (most recent call last):
  File "/usr/local/bin/flask", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/dist-packages/flask/cli.py", line 990, in main
    cli.main(args=sys.argv[1:])
  File "/usr/local/lib/python3.7/dist-packages/flask/cli.py", line 596, in main
    return super().main(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/flask/cli.py", line 845, in run_command
    app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)
  File "/usr/local/lib/python3.7/dist-packages/flask/cli.py", line 321, in __init__
    self._load_unlocked()
  File "/usr/local/lib/python3.7/dist-packages/flask/cli.py", line 346, in _load_unlocked
    self._app = rv = self.loader()
  File "/usr/local/lib/python3.7/dist-packages/flask/cli.py", line 402, in load_app
    app = locate_app(self, import_name, name)
  File "/usr/local/lib/python3.7/dist-packages/flask/cli.py", line 273, in locate_app
    return find_best_app(script_info, module)
  File "/usr/local/lib/python3.7/dist-packages/flask/cli.py", line 68, in find_best_app
    app = call_factory(script_info, app_factory)
  File "/usr/local/lib/python3.7/dist-packages/flask/cli.py", line 119, in call_factory
    return app_factory(*args, **kwargs)
  File "/root/contextualise/contextualise/__init__.py", line 127, in create_app
    security = Security(app, user_datastore)
  File "/usr/local/lib/python3.7/dist-packages/flask_security/core.py", line 1034, in __init__
    app, datastore, register_blueprint=register_blueprint, **kwargs
  File "/usr/local/lib/python3.7/dist-packages/flask_security/core.py", line 1089, in init_app
    raise ValueError("User model must contain fs_uniquifier as of 4.0.0")
ValueError: User model must contain fs_uniquifier as of 4.0.0

(playground) root@b3156e139c10:~/contextualise# pip3 freeze flask
click==8.0.1
Flask==2.0.1
importlib-metadata==4.5.0
itsdangerous==2.0.1
Jinja2==3.0.1
MarkupSafe==2.0.1
pkg-resources==0.0.0
typing-extensions==3.10.0.0
Werkzeug==2.0.1
zipp==3.4.1

Any suggestions how to resolve the issue?

EDIT: I'm facing the same issue using the Dockerfile from the repo.

brettkromkamp commented 3 years ago

@mmsrubar I have a seperate branch (updates-210213: https://github.com/brettkromkamp/contextualise/tree/updates-210213) with a fix for this issue.

Context:

Also, keep in mind that I haven't updated and tested Contextualise with Flask 2 (and related dependencies), yet... still on my TODO-list.

brettkromkamp commented 3 years ago

Upgrade to Flask 2.0 issue: https://github.com/brettkromkamp/contextualise/issues/109

mmsrubar commented 3 years ago

Thank you! Now I'm able to build the container. Going to get it running and test the app.

brettkromkamp commented 3 years ago

Thank you! Now I'm able to build the container. Going to get it running and test the app.

Great! Would appreciate if you let me know how it goes :)

brettkromkamp commented 3 years ago

Thank you! Now I'm able to build the container. Going to get it running and test the app.

@mmsrubar Forgot to mention: you will have to manually uninstall Mistune version 0.84 and install version 2.0.0rc1 (pip install mistune==2.0.0rc1)

brettkromkamp commented 2 years ago

Done.