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

Attempting to run PADE (pade create-pade-db) returns. sqlalchemy.exc.OperationalError #71

Open
naimaryan1 opened this issue May 19, 2021 · 0 comments

Comments

@naimaryan1
Copy link

naimaryan1 commented May 19, 2021

Hi All,

I attempted to install and run PADE on Ubuntu 20.04.1 OR Centos 7, both cloud servers are fresh installs with no other software.

I 1st attempted on Ubuntu 20.04.1 but another error:

[...] Creating Pade tables in selected data base.
[ok_] Tables created in selected data base

        This is
         ____   _    ____  _____
        |  _ \ / \  |  _ \| ____|
        | |_) / _ \ | | | |  _|
        |  __/ ___ \| |_| | |___
        |_| /_/   \_\____/|_____|

        Python Agent DEvelopment framework


        PADE is a free software under development by:

        - Electric Smart Grid Group - GREI
        Federal University of Ceara - UFC - Brazil

        - Laboratory of Applied Artificial Intelligence - LAAI
        Federal University of Para - UFPA

        https://github.com/grei-ufc/pade
 * Serving Flask app "pade.web.flask_server" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
Traceback (most recent call last):
  File "/usr/local/bin/pade", line 12, in <module>
    load_entry_point('pade==2.2.4', 'console_scripts', 'pade')()
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/pade-2.2.4-py3.8.egg/pade/cli/pade_cmd.py", line 268, in start_runtime
    main(config)
  File "/usr/local/lib/python3.8/dist-packages/pade-2.2.4-py3.8.egg/pade/cli/pade_cmd.py", line 169, in main
    p = subprocess.Popen(commands, stdin=subprocess.PIPE)
  File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'python'

Here is my entire setup (For example for the CentOS 7) :

All setup scripts:

#Python3 installation https://www.liquidweb.com/kb/how-to-install-python-3-on-centos-7/
yum update -y
sudo yum update -y
sudo yum install -y python3
sudo yum install gcc openssl-devel bzip2-devel libffi-devel -y
sudo curl -O https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz
sudo tar -xzf Python-3.8.1.tgz
cd Python-3.8.1/
sudo make altinstall
sudo ./configure --enable-optimizations
sudo make altinstall
#pip install
sudo yum install -y pip3 -y
sudo yum install epel-release -y
sudo yum install python-pip -y
#other python dev tools
sudo yum install python-devel -y
sudo yum groupinstall 'development tools' -y
#install Pade (https://github.com/lucassm/Pade)
mkdir pade
cd pade
git clone https://github.com/grei-ufc/pade.git
cd Pade
pip3 install twisted
sudo python3 setup.py install


1st example based on (https://github.com/grei-ufc/pade):

# command to deal with formatting issues
LC_ALL=en_US.utf-8 && export LANG=en_US.utf-8

1) pade create-pade-db

This is the error that I'm getting:

[...] Creating Pade tables in selected data base.
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2285, in _wrap_pool_connect
    return fn()
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 363, in connect
    return _ConnectionFairy._checkout(self)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 773, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
    rec = pool._do_get()
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 238, in _do_get
    return self._create_connection()
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
    return _ConnectionRecord(self)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
    self.__connect(first_connect_check=True)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 657, in __connect
    pool.logger.debug("Error on connect(): %s", e)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
    exc_value, with_traceback=exc_tb,
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
    raise exception
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 652, in __connect
    connection = pool._invoke_creator(self)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 488, in connect
    return self.dbapi.connect(*cargs, **cparams)
sqlite3.OperationalError: unable to open database file

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

Traceback (most recent call last):
  File "/usr/local/bin/pade", line 11, in <module>
    load_entry_point('pade==2.2.4', 'console_scripts', 'pade')()
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pade/cli/pade_cmd.py", line 267, in start_runtime
    create_tables()
  File "/usr/local/lib/python3.6/site-packages/pade/cli/pade_cmd.py", line 307, in create_tables
    db.create_all()
  File "/usr/local/lib/python3.6/site-packages/flask_sqlalchemy/__init__.py", line 1033, in create_all
    self._execute_for_all_tables(app, bind, 'create_all')
  File "/usr/local/lib/python3.6/site-packages/flask_sqlalchemy/__init__.py", line 1025, in _execute_for_all_tables
    op(bind=self.get_engine(app, bind), **extra)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 4321, in create_all
    ddl.SchemaGenerator, self, checkfirst=checkfirst, tables=tables
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2057, in _run_visitor
    with self._optional_conn_ctx_manager(connection) as conn:
  File "/usr/lib64/python3.6/contextlib.py", line 81, in __enter__
    return next(self.gen)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2049, in _optional_conn_ctx_manager
    with self._contextual_connect() as conn:
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2251, in _contextual_connect
    self._wrap_pool_connect(self.pool.connect, None),
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2289, in _wrap_pool_connect
    e, dialect, self
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1555, in _handle_dbapi_exception_noconnection
    sqlalchemy_exception, with_traceback=exc_info[2], from_=e
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
    raise exception
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2285, in _wrap_pool_connect
    return fn()
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 363, in connect
    return _ConnectionFairy._checkout(self)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 773, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
    rec = pool._do_get()
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 238, in _do_get
    return self._create_connection()
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
    return _ConnectionRecord(self)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
    self.__connect(first_connect_check=True)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 657, in __connect
    pool.logger.debug("Error on connect(): %s", e)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
    exc_value, with_traceback=exc_tb,
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
    raise exception
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 652, in __connect
    connection = pool._invoke_creator(self)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 488, in connect
    return self.dbapi.connect(*cargs, **cparams)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file
(Background on this error at: http://sqlalche.me/e/e3q8)

I thought there was an issue with sqlite installation , so uninstalled sqlite & then re-installed sqlite

using:
pip install pysqlite3

However I'm still getting the above error.

My target platform is actually CentOS 7, so how do i resolve this exception (sqlalchemy.exc.OperationalError) ???

Appreciated.

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