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

Not able to create the webage locally. #30

Open
teresa-m opened this issue Sep 26, 2022 · 0 comments
Open

Not able to create the webage locally. #30

teresa-m opened this issue Sep 26, 2022 · 0 comments

Comments

@teresa-m
Copy link
Collaborator

@YedilSerzhan: I tried to create the database locally following your description. However, I get the app.py script running, because of a db connection error.
I will list more information below:

my db_confing:

$ cat db_config.py
DB_CONFIG = {
    'USERNAME': 'teresa',
    'PASSWORD': 'hallo',
    'DB_NAME': 'dnapi'
}

my enviorment:

$ conda list
# packages in environment at /home/teresa/Software/miniconda3/envs/dnanalyzer:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
_openmp_mutex             5.1                       1_gnu  
bzip2                     1.0.8                h7b6447c_0  
ca-certificates           2022.07.19           h06a4308_0  
certifi                   2022.9.14                pypi_0    pypi
click                     8.1.3                    pypi_0    pypi
flask                     2.2.2                    pypi_0    pypi
flask-login               0.6.2                    pypi_0    pypi
flask-marshmallow         0.14.0                   pypi_0    pypi
flask-sqlalchemy          2.5.1                    pypi_0    pypi
greenlet                  1.1.3                    pypi_0    pypi
itsdangerous              2.1.2                    pypi_0    pypi
jinja2                    3.1.2                    pypi_0    pypi
ld_impl_linux-64          2.38                 h1181459_1  
libffi                    3.3                  he6710b0_2  
libgcc-ng                 11.2.0               h1234567_1  
libgomp                   11.2.0               h1234567_1  
libstdcxx-ng              11.2.0               h1234567_1  
libuuid                   1.0.3                h7f8727e_2  
markupsafe                2.1.1                    pypi_0    pypi
marshmallow               3.18.0                   pypi_0    pypi
marshmallow-sqlalchemy    0.28.1                   pypi_0    pypi
ncurses                   6.3                  h5eee18b_3  
openssl                   1.1.1q               h7f8727e_0  
packaging                 21.3                     pypi_0    pypi
pillow                    9.2.0                    pypi_0    pypi
pip                       22.1.2                   pypi_0    pypi
psycopg2                  2.9.3                    pypi_0    pypi
pyparsing                 3.0.9                    pypi_0    pypi
python                    3.10.4               h12debd9_0  
pyyaml                    6.0                      pypi_0    pypi
readline                  8.1.2                h7f8727e_1  
setuptools                63.4.1                   pypi_0    pypi
six                       1.16.0                   pypi_0    pypi
sqlalchemy                1.4.41                   pypi_0    pypi
sqlite                    3.39.2               h5082296_0  
tk                        8.6.12               h1ccaba5_0  
tzdata                    2022c                h04d1e81_0  
werkzeug                  2.2.2                    pypi_0    pypi
wheel                     0.37.1             pyhd3eb1b0_0  
xz                        5.2.5                h7f8727e_1  
zlib                      1.2.12               h5eee18b_3 

the error:

$ python3 app.py
Traceback (most recent call last):
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3361, in _wrap_pool_connect
    return fn()
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 320, in connect
    return _ConnectionFairy._checkout(self)
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 884, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 486, in checkout
    rec = pool._do_get()
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/pool/impl.py", line 145, in _do_get
    with util.safe_reraise():
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
    compat.raise_(
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
    raise exception
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/pool/impl.py", line 143, in _do_get
    return self._create_connection()
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 266, in _create_connection
    return _ConnectionRecord(self)
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 381, in __init__
    self.__connect()
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 677, in __connect
    with util.safe_reraise():
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
    compat.raise_(
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
    raise exception
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 673, in __connect
    self.dbapi_connection = connection = pool._invoke_creator(self)
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 578, in connect
    return dialect.connect(*cargs, **cparams)
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 598, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/psycopg2/__init__.py", line 122, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not connect to server: Connection refused
	Is the server running on host "localhost" (127.0.0.1) and accepting
	TCP/IP connections on port 5432?


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/teresa/Dokumente/BeerDecoded/DNAnalyzer/app.py", line 50, in <module>
    db.create_all()
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1094, in create_all
    self._execute_for_all_tables(app, bind, 'create_all')
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1086, in _execute_for_all_tables
    op(bind=self.get_engine(app, bind), **extra)
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/sql/schema.py", line 4917, in create_all
    bind._run_ddl_visitor(
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3227, in _run_ddl_visitor
    with self.begin() as conn:
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3143, in begin
    conn = self.connect(close_with_result=close_with_result)
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3315, in connect
    return self._connection_cls(self, close_with_result=close_with_result)
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 96, in __init__
    else engine.raw_connection()
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3394, in raw_connection
    return self._wrap_pool_connect(self.pool.connect, _connection)
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3364, in _wrap_pool_connect
    Connection._handle_dbapi_exception_noconnection(
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2198, in _handle_dbapi_exception_noconnection
    util.raise_(
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
    raise exception
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3361, in _wrap_pool_connect
    return fn()
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 320, in connect
    return _ConnectionFairy._checkout(self)
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 884, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 486, in checkout
    rec = pool._do_get()
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/pool/impl.py", line 145, in _do_get
    with util.safe_reraise():
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
    compat.raise_(
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
    raise exception
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/pool/impl.py", line 143, in _do_get
    return self._create_connection()
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 266, in _create_connection
    return _ConnectionRecord(self)
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 381, in __init__
    self.__connect()
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 677, in __connect
    with util.safe_reraise():
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
    compat.raise_(
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
    raise exception
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 673, in __connect
    self.dbapi_connection = connection = pool._invoke_creator(self)
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 578, in connect
    return dialect.connect(*cargs, **cparams)
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 598, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/home/teresa/Software/miniconda3/envs/dnanalyzer/lib/python3.10/site-packages/psycopg2/__init__.py", line 122, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: Connection refused
	Is the server running on host "localhost" (127.0.0.1) and accepting
	TCP/IP connections on port 5432?
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

1 participant