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

sqlite3.OperationalError: unable to open database file #3833

Closed
tyler-suard-parker opened this issue Oct 17, 2024 · 6 comments
Closed

sqlite3.OperationalError: unable to open database file #3833

tyler-suard-parker opened this issue Oct 17, 2024 · 6 comments
Labels
0.2 Issues which are related to the pre 0.4 codebase

Comments

@tyler-suard-parker
Copy link
Contributor

What happened?

I am not sure why this is happening. This issue just cropped up today. As far as I can tell, I have disabled caching and cache seeds in the LLM configs.

2024-10-17T22:07:56.1052989
Traceback (most recent call last):
Ok
2024-10-17T22:07:56.1055413
File "/home/site/wwwroot/app.py", line 12, in
Ok
2024-10-17T22:07:56.1064371
from autogen.io.websockets import IOWebsockets
Ok
2024-10-17T22:07:56.1064591
File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/autogen/init.py", line 9, in
Ok
2024-10-17T22:07:56.1072326
from .agentchat import *
Ok
2024-10-17T22:07:56.1072504
File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/autogen/agentchat/init.py", line 11, in
Ok
2024-10-17T22:07:56.1078949
from .groupchat import GroupChat, GroupChatManager
Ok
2024-10-17T22:07:56.1080123
File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/autogen/agentchat/groupchat.py", line 24, in
Ok
2024-10-17T22:07:56.1089838
from .contrib.capabilities import transform_messages
Ok
2024-10-17T22:07:56.1090018
File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/autogen/agentchat/contrib/capabilities/transform_messages.py", line 12, in
Ok
2024-10-17T22:07:56.1097109
from .transforms import MessageTransform
Ok
2024-10-17T22:07:56.1097402
File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/autogen/agentchat/contrib/capabilities/transforms.py", line 316, in
Ok
2024-10-17T22:07:56.1106854
class TextMessageCompressor:
Ok
2024-10-17T22:07:56.1107012
File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/autogen/agentchat/contrib/capabilities/transforms.py", line 328, in TextMessageCompressor
Ok
2024-10-17T22:07:56.1115061
cache: Optional[AbstractCache] = Cache.disk(),
Ok
2024-10-17T22:07:56.1117088
^^^^^^^^^^^^
Ok
2024-10-17T22:07:56.1119746
File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/autogen/cache/cache.py", line 68, in disk
Ok
2024-10-17T22:07:56.1127058
return Cache({"cache_seed": cache_seed, "cache_path_root": cache_path_root})
Ok
2024-10-17T22:07:56.1127214
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Ok
2024-10-17T22:07:56.1127268
File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/autogen/cache/cache.py", line 117, in init
Ok
2024-10-17T22:07:56.1134796
self.cache = CacheFactory.cache_factory(
Ok
2024-10-17T22:07:56.1134979
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Ok
2024-10-17T22:07:56.1135035
File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/autogen/cache/cache_factory.py", line 85, in cache_factory
Ok
2024-10-17T22:07:56.1144275
return DiskCache(os.path.join(".", path))
Ok
2024-10-17T22:07:56.1144469
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Ok
2024-10-17T22:07:56.1144526
File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/autogen/cache/disk_cache.py", line 49, in init
Ok
2024-10-17T22:07:56.1151971
self.cache = diskcache.Cache(seed)
Ok
2024-10-17T22:07:56.1152142
^^^^^^^^^^^^^^^^^^^^^
Ok
2024-10-17T22:07:56.1152199
File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/diskcache/core.py", line 478, in init
Ok
2024-10-17T22:07:56.1162989
self.reset(key, value, update=False)
Ok
2024-10-17T22:07:56.1163179
File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/diskcache/core.py", line 2431, in reset
Ok
2024-10-17T22:07:56.117679
((old_value,),) = sql(
Ok
2024-10-17T22:07:56.1176965
^^^^
Ok
2024-10-17T22:07:56.1177017
sqlite3.OperationalError: unable to open database file

What did you expect to happen?

No errors

How can we reproduce it (as minimally and precisely as possible)?

I am not sure actually, I think just importing the autogen websockets module did it.

AutoGen version

pyautogen[websockets]

Which package was this bug in

Core

Model used

gpt-4

Python version

3.11

Operating system

Windows

Any additional info you think would be helpful for fixing this bug

No response

@ekzhu
Copy link
Collaborator

ekzhu commented Oct 18, 2024

2024-10-17T22:07:56.1163179
File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/diskcache/core.py", line 2431, in reset
Ok
2024-10-17T22:07:56.117679
((old_value,),) = sql(
Ok
2024-10-17T22:07:56.1176965
^^^^
Ok
2024-10-17T22:07:56.1177017
sqlite3.OperationalError: unable to open database file

This is clearly the case when you app has no permission to access the sqlite database path, or part of the path does not exist.

Also we don't have this file:

File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/autogen/agentchat/init.py", line 11, in

See https://github.com/microsoft/autogen/tree/0.2/autogen/agentchat

What version of the package you are using? Are you using the right package?

@ekzhu ekzhu added 0.2 Issues which are related to the pre 0.4 codebase awaiting-op-response Issue or pr has been triaged or responded to and is now awaiting a reply from the original poster and removed needs-triage labels Oct 18, 2024
@tyler-suard-parker
Copy link
Contributor Author

@ekzhu Thank you for your response. However, no part of my code accesses an sqlite database, and I have turned off caching.

That is interesting, you do not have init.py, but you do have init.py

I am using the most recent version of autogen, pyautogen==0.3.0

@ekzhu
Copy link
Collaborator

ekzhu commented Oct 18, 2024

That is interesting, you do not have init.py, but you do have init.py

Okay I see it is the markdown styling of your log. Next time use a large code block helps to make it more readable.

However, no part of my code accesses an sqlite database, and I have turned off caching.

I looked into this line:

cache: Optional[AbstractCache] = Cache.disk(),

and it looks like the default option creates a disk cache. This is a bug, it should've been default to None.

Can you create a PR to fix this?

@tyler-suard-parker
Copy link
Contributor Author

Hello @ekzhu . I am sorry, but no, I do not have time to work on this.

@ekzhu ekzhu removed the awaiting-op-response Issue or pr has been triaged or responded to and is now awaiting a reply from the original poster label Oct 18, 2024
@ekzhu
Copy link
Collaborator

ekzhu commented Oct 22, 2024

@tyler-suard-parker fix is in, will be reflected in the next release.

@ekzhu ekzhu closed this as completed Oct 22, 2024
@tyler-suard-parker
Copy link
Contributor Author

Thank you, Eric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.2 Issues which are related to the pre 0.4 codebase
Projects
None yet
Development

No branches or pull requests

2 participants