Clinical-Genomics / genotype

Simple genotype comparison of VCF files
http://taboo.readthedocs.org/en/latest/
MIT License
8 stars 2 forks source link

Error while launching the server with "genotype serve" #23

Closed northwestwitch closed 6 years ago

northwestwitch commented 6 years ago

After cloning and installing the package as it is from github, if you try to launch the app you get this error message: "TypeError: make_declarative_base() takes from 1 to 2 positional arguments but 3 were given"

I've been stuck with this for a while but after many attempts and thanks to google (https://github.com/apache/incubator-superset/issues/891) I've found a solution:

pip3 install flask-appbuilder

ingkebil commented 6 years ago

That doesn't seem right. The error is with sqlalchemy:

 $  genotype serve
Traceback (most recent call last):
  File "/home/kebil/miniconda3/envs/genotype/bin/genotype", line 11, in <module>
    load_entry_point('genotype', 'console_scripts', 'genotype')()
  File "/home/kebil/miniconda3/envs/genotype/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/kebil/miniconda3/envs/genotype/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/kebil/miniconda3/envs/genotype/lib/python3.6/site-packages/click/core.py", line 1061, in invoke
    cmd_name, cmd, args = self.resolve_command(ctx, args)
  File "/home/kebil/miniconda3/envs/genotype/lib/python3.6/site-packages/click/core.py", line 1100, in resolve_command
    cmd = self.get_command(ctx, cmd_name)
  File "/home/kebil/git/genotype/genotype/cli.py", line 44, in get_command
    return commands[name].load()
  File "/home/kebil/miniconda3/envs/genotype/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2318, in load
    return self.resolve()
  File "/home/kebil/miniconda3/envs/genotype/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2324, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/kebil/git/genotype/genotype/server/cli.py", line 7, in <module>
    from genotype.server.app import create_app
  File "/home/kebil/git/genotype/genotype/server/app.py", line 10, in <module>
    from .ext import db, user
  File "/home/kebil/git/genotype/genotype/server/ext.py", line 7, in <module>
    db = Alchy(Model=Model)
  File "/home/kebil/miniconda3/envs/genotype/lib/python3.6/site-packages/flask_alchy.py", line 29, in __init__
    app, use_native_unicode, session_options, metadata=metadata)
  File "/home/kebil/miniconda3/envs/genotype/lib/python3.6/site-packages/flask_sqlalchemy/__init__.py", line 677, in __init__
    self.Model = self.make_declarative_base(model_class, metadata)
TypeError: make_declarative_base() takes from 1 to 2 positional arguments but 3 were given
northwestwitch commented 6 years ago

The error is in flask_sqlalchemy and that package is part of flask-appbuilder. For me it worked

ingkebil commented 6 years ago

I understand it worked for you :) kuddos!

Installing Flask-appbuilder is not a permanent solution tho. How do I know? Well, we have never used that package :) How do I know that? I have checked what packages are installed on production with pip freeze and reinstall those locally. Then it became obvious that the requirements.txt is not up to date (path.py missing, Flask-WTF missing)

The reason why it works with Flask-appbuilder is because it downgrades Flask-Login==0.4.0, downgrades Flask-SQLAlchemy==2.1 (which makes your error disappear) and installs Flask-WTF, which are missing from the requirements.txt of genotype.

northwestwitch commented 6 years ago

I see your point. This app starts to be old and needs a bit of refactoring

northwestwitch commented 6 years ago

(kind of) fixed in #24