thevickypedia / Jarvis

Fully Functional Voice Based Natural Language UI
https://jarvis-health.vigneshrao.com
MIT License
207 stars 41 forks source link

Unable to open database file #34

Closed Valeros03 closed 1 year ago

Valeros03 commented 1 year ago

Describe the bug Hi I got this error message when I try to launch it from a py file that looks like this: import jarvis

if name == 'main': jarvis.start()

Before I got another error message here(file models.py, line 93):

if not env.recognizer_settings and not env.phrase.limit: env.recognizer_settings = RecognizerSettings()

it was like: Traceback (most recent call last): File "C:\Users\sebyf\Desktop\Jarv.py", line 1, in import jarvis File "C:\Users\sebyf\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\jarvis__init__.py", line 27, in from ._preexec import keywords_handler # noqa: F401 File "C:\Users\sebyf\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\jarvis_preexec\keywords_handler.py", line 9, in from jarvis.modules.conditions import conversation, keywords File "C:\Users\sebyf\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\jarvis\modules\conditions\conversation.py", line 11, in from jarvis.modules.models import models File "C:\Users\sebyf\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\jarvis\modules\models\models.py", line 272, in _main_process_validations() File "C:\Users\sebyf\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\jarvis\modules\models\models.py", line 93, in _main_process_validations if not env.recognizer_settings and not env.phrase.limit: AttributeError: 'EnvConfig' object has no attribute 'phrase'

than I tried to remove that condition and I got:

Traceback (most recent call last): File "C:\Users\sebyf\Desktop\Jarv.py", line 1, in import jarvis File "C:\Users\sebyf\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\jarvis__init.py", line 27, in from ._preexec import keywords_handler # noqa: F401 File "C:\Users\sebyf\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\jarvis_preexec\keywords_handler.py", line 9, in from jarvis.modules.conditions import conversation, keywords File "C:\Users\sebyf\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\jarvis\modules\conditions\conversation.py", line 11, in from jarvis.modules.models import models File "C:\Users\sebyf\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\jarvis\modules\models\models.py", line 272, in _main_process_validations() File "C:\Users\sebyf\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\jarvis\modules\models\models.py", line 119, in _main_process_validations db = database.Database(database=fileio.base_db) File "C:\Users\sebyf\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\jarvis\modules\database\database.py", line 33, in init__ self.connection = sqlite3.connect(database=database, check_same_thread=False, timeout=timeout) sqlite3.OperationalError: unable to open database file

thevickypedia commented 1 year ago

I'm not sure which version you're running or how (pypi or directly downloaded from Git)! In either case the error AttributeError: 'EnvConfig' object has no attribute 'phrase' seems to be incorrect The attribute has always been phrase_limit and more recently its named as listener_phrase_limit If you installed it via pypi, I'd recommend running the below

python3 -m pip uninstall --no-cache-dir jarvis-ironman
python3 -m pip install --no-cache --upgrade jarvis-ironman

As for the SQL error sqlite3.OperationalError: unable to open database file, it may be because your IDE/terminal is lacking permissions to the repo/DB file. Please update your folder permissions accordingly.

Let me know if you still face the sqlite3.OperationalError: unable to open database file error, and which windows version you are using. I can try pushing out a new version with fileio attributes having the absolute path instead of the current relative ones.

Valeros03 commented 1 year ago

Hi, I'm using the pypi version on Windows 11. The AttributeError: 'EnvConfig' object has no attribute 'phrase' error is solved (I just use the new name listener_phrase_limit instead of phrase_limit. In the other hand for the error sqlite3.OperationalError: unable to open database file I discovered two things actually:

  1. inside models.py file, line 119, db = database.Database(database=fileio.base_db) is trying to call base_db from fileio module, but inside fileio.py there's not such a function or class called in this way (but actually the interpreter does not say anything about that, so I guess it works just fine)
  2. I put a simple debug line print(str(fileio.base_db)) (inside models.py, before db = database.Database(database=fileio.base_db) and I discovered that is trying to reach out a file named database.db inside fileio folder, but there's not a folder named fileio inside jarvis directory. So I guess I'm missing something to install/to do.
thevickypedia commented 1 year ago

You're right, I must have removed the fileio directory creation when I reformatted the logging Thanks for bringing this up. I found more than 1 bug when I was digging into it. Much appreciated. I'm releasing a new version ASAP to fix this.

thevickypedia commented 1 year ago

Please go ahead and redo

python3 -m pip uninstall --no-cache-dir jarvis-ironman
python3 -m pip install --no-cache --upgrade jarvis-ironman

The issue should be addressed in v3.3

Valeros03 commented 1 year ago

Ok now the application is working but I still need to use listener_phrase_limiter. However I got some other errors and a question; should I open a new Issue ticket(I guess are not much related to the previous errors)? Nevertheless I'm glad to help in anyway I can, I'm still a student, but I realy like this project and the idea of a remote AI vocal controller.

thevickypedia commented 1 year ago

@Valeros03 You may create a new issue, I'm closing this as done I appreciate your help in making this library better. Until recently, I was testing the package with multiple operating systems, with and without all the setup requirements before releasing a new version. But it has gotten so big that testing takes away a lot of time, so I gave up on them. Guess that has made some versions unstable. I'll look forward to the new issue. Thank you.