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
'sqlite3.OperationalError: unable to open database file' error with a fresh install #116
Comments
That's surprising - what operating system is that? You may be able to get a better idea of what's going on by running this: python -i $(which llm) models list This should drop you into a Python interactive prompt when the program hits an error. Then run:
And then: (pdb) str(filename_or_conn)` To see the value of that variable. |
@simonw, Thanks for your response OS: macOS Monterey
|
Also I want to confirm something as I noticed it is listing gpt-4-32k in the models list, although I don't have access to it yet. |
I’m also seeing an error like this (on osx 13.4.1). llm models list
OpenAI Chat: gpt-3.5-turbo (aliases: 3.5, chatgpt)
OpenAI Chat: gpt-3.5-turbo-16k (aliases: chatgpt-16k, 3.5-16k)
OpenAI Chat: gpt-4 (aliases: 4, gpt4)
OpenAI Chat: gpt-4-32k (aliases: 4-32k)
llm logs
Error: No log database found at /Users/danesummers/Library/Application Support/io.datasette.llm/logs.db
# I tried to fix it myself :P
mkdir ~/Library/Application\ Support/io.datasette.llm
sqlite3 ~/Library/Application\ Support/io.datasette.llm/logs.db "vacuum;"
llm logs
…
…
File "~/.pyenv/versions/3.10.2/lib/python3.10/site-packages/llm/cli.py", line 431, in logs_list
migrate(db)
File "~/.pyenv/versions/3.10.2/lib/python3.10/site-packages/llm/migrations.py", line 14, in migrate
fn(db)
File "~/.pyenv/versions/3.10.2/lib/python3.10/site-packages/llm/migrations.py", line 61, in m003_chat_id_foreign_key
db["log"].add_foreign_key("chat_id", "log", "id")
File "~/.pyenv/versions/3.10.2/lib/python3.10/site-packages/sqlite_utils/db.py", line 2194, in add_foreign_key
self.db.add_foreign_keys([(self.name, column, other_table, other_column)])
File "~/.pyenv/versions/3.10.2/lib/python3.10/site-packages/sqlite_utils/db.py", line 1143, in add_foreign_keys
cursor.execute(
sqlite3.OperationalError: table sqlite_master may not be modified Not sure how to debug this further but happy to help… |
I'm seeing the same thing and was able to workaround it by commenting out the two I also needed to manually create the logs directory as mentioned above:
Here's the diff for llm/migrations.py:
|
This thread was useful to me: simonw/sqlite-utils#235 Seems to be a common problem, which can be address by: pip3 install sqlean.py
pip3 install sqlite-dump
# now works!
llm logs list |
Hello, I appreciate everyone's input.
For future reference, I also uninstalled both sqlean.py and sqlite-dump, and everything continues to function correctly. So, I'm not entirely certain if solely the 'mkdir' solution would have been sufficient to fix the issue. |
Just running the following line works for me 👍
|
Same problem here, fresh install. I did not have a .config folder. Once I added both .config and then io.datasette.llm inside that things worked as expected. |
For this fix: - simonw/sqlite-utils#577 Refs #60, #116, #123
I encountered the same issue today on WSL on Windows 10 (Ubuntu 20.04). It looks like the user_dir() (~/.config/io.datasette.llm) does not get created during the pip installation. I manually created that directory and after that the error went away! |
Dupe of: Fixed in b30f689 |
Hi,
I just installed llm
then when I use it for anything it would output the result then append it with the following error message
The text was updated successfully, but these errors were encountered: