autogen icon indicating copy to clipboard operation
autogen copied to clipboard

Database is locked error

Open balakreshnan opened this issue 2 years ago • 7 comments

user_proxy (to assistant):

Who should read this paper: https://arxiv.org/abs/2308.08155



OperationalError Traceback (most recent call last) Cell In[14], line 2 1 # the assistant receives a message from the user, which contains the task description ----> 2 user_proxy.initiate_chat( 3 assistant, 4 message=""" 5 Who should read this paper: https://arxiv.org/abs/2308.08155 6 """, 7 )

File /anaconda/envs/azureml_py310_sdkv2/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py:531, in ConversableAgent.initiate_chat(self, recipient, clear_history, silent, **context) 517 """Initiate a chat with the recipient agent. 518 519 Reset the consecutive auto reply counter. (...) 528 "message" needs to be provided if the generate_init_message method is not overridden. 529 """ 530 self._prepare_chat(recipient, clear_history) --> 531 self.send(self.generate_init_message(**context), recipient, silent=silent)

File /anaconda/envs/azureml_py310_sdkv2/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py:334, in ConversableAgent.send(self, message, recipient, request_reply, silent) 332 valid = self._append_oai_message(message, "assistant", recipient) 333 if valid: --> 334 recipient.receive(message, self, request_reply, silent) 335 else: 336 raise ValueError( 337 "Message can't be converted into a valid ChatCompletion message. Either content or function_call must be provided." 338 )

File /anaconda/envs/azureml_py310_sdkv2/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py:462, in ConversableAgent.receive(self, message, sender, request_reply, silent) 460 if request_reply is False or request_reply is None and self.reply_at_receive[sender] is False: 461 return --> 462 reply = self.generate_reply(messages=self.chat_messages[sender], sender=sender) 463 if reply is not None: 464 self.send(reply, sender, silent=silent)

File /anaconda/envs/azureml_py310_sdkv2/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py:781, in ConversableAgent.generate_reply(self, messages, sender, exclude) 779 continue 780 if self._match_trigger(reply_func_tuple["trigger"], sender): --> 781 final, reply = reply_func(self, messages=messages, sender=sender, config=reply_func_tuple["config"]) 782 if final: 783 return reply

File /anaconda/envs/azureml_py310_sdkv2/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py:606, in ConversableAgent.generate_oai_reply(self, messages, sender, config) 603 messages = self._oai_messages[sender] 605 # TODO: #1143 handle token limit exceeded error --> 606 response = oai.ChatCompletion.create( 607 context=messages[-1].pop("context", None), messages=self._oai_system_message + messages, **llm_config 608 ) 609 return True, oai.ChatCompletion.extract_text_or_function_call(response)[0]

File /anaconda/envs/azureml_py310_sdkv2/lib/python3.10/site-packages/autogen/oai/completion.py:803, in Completion.create(cls, context, use_cache, config_list, filter_func, raise_on_ratelimit_or_timeout, allow_format_str_template, **config) 801 base_config["max_retry_period"] = 0 802 try: --> 803 response = cls.create( 804 context, 805 use_cache, 806 raise_on_ratelimit_or_timeout=i < last or raise_on_ratelimit_or_timeout, 807 **base_config, 808 ) 809 if response == -1: 810 return response

File /anaconda/envs/azureml_py310_sdkv2/lib/python3.10/site-packages/autogen/oai/completion.py:832, in Completion.create(cls, context, use_cache, config_list, filter_func, raise_on_ratelimit_or_timeout, allow_format_str_template, **config) 830 if "seed" in params: 831 cls.set_cache(params.pop("seed")) --> 832 with diskcache.Cache(cls.cache_path) as cls._cache: 833 cls.set_cache(seed) 834 return cls._get_response(params, raise_on_ratelimit_or_timeout=raise_on_ratelimit_or_timeout)

File /anaconda/envs/azureml_py310_sdkv2/lib/python3.10/site-packages/diskcache/core.py:478, in Cache.init(self, directory, timeout, disk, **settings) 476 for key, value in sorted(sets.items()): 477 if key.startswith('sqlite_'): --> 478 self.reset(key, value, update=False) 480 sql( 481 'CREATE TABLE IF NOT EXISTS Settings (' 482 ' key TEXT NOT NULL UNIQUE,' 483 ' value)' 484 ) 486 # Setup Disk object (must happen after settings initialized).

File /anaconda/envs/azureml_py310_sdkv2/lib/python3.10/site-packages/diskcache/core.py:2438, in Cache.reset(self, key, value, update) 2436 update = True 2437 if update: -> 2438 sql('PRAGMA %s = %s' % (pragma, value)).fetchall() 2439 break 2440 except sqlite3.OperationalError as exc:

OperationalError: database is locked

balakreshnan avatar Nov 14 '23 13:11 balakreshnan

@balakreshnan Can you provide more details about which sample code you are running, and how you prepared the virtual environment?

rickyloynd-microsoft avatar Nov 14 '23 18:11 rickyloynd-microsoft

autogen/notebook/agentchat_web_info.ipynb at main · microsoft/autogen (github.com)https://github.com/microsoft/autogen/blob/main/notebook/agentchat_web_info.ipynb

i am using Azure Machine learning compute instance with their default environment python 3 and python 3.10 with sdk v2

both has issues

thanks Bala


From: Ricky Loynd @.> Sent: Tuesday, November 14, 2023 12:54 PM To: microsoft/autogen @.> Cc: Mention @.>; Author @.> Subject: Re: [microsoft/autogen] Database is locked error (Issue #675)

@balakreshnanhttps://github.com/balakreshnan Can you provide more details about which sample code you are running, and how you prepared the virtual environment?

— Reply to this email directly, view it on GitHubhttps://github.com/microsoft/autogen/issues/675#issuecomment-1810960379 or unsubscribehttps://github.com/notifications/unsubscribe-auth/AF7FZBXWCUSH2G5XDCBYYQ3YEO475BFKMF2HI4TJMJ2XIZLTSOBKK5TBNR2WLJDUOJ2WLJDOMFWWLO3UNBZGKYLEL5YGC4TUNFRWS4DBNZ2F6YLDORUXM2LUPGBKK5TBNR2WLJDUOJ2WLJDOMFWWLLTXMF2GG2C7MFRXI2LWNF2HTAVFOZQWY5LFUVUXG43VMWSG4YLNMWVXI2DSMVQWIX3UPFYGLLDTOVRGUZLDORPXI6LQMWWES43TOVSUG33NNVSW45FGORXXA2LDOOJIFJDUPFYGLKTSMVYG643JORXXE6NFOZQWY5LFVE3DQMBRGIYDANZRQKSHI6LQMWSWS43TOVS2K5TBNR2WLKRRHE4TENZQGE3DSN5HORZGSZ3HMVZKMY3SMVQXIZI. You are receiving this email because you were mentioned.

Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

balakreshnan avatar Nov 14 '23 19:11 balakreshnan

@sonichi fyi

rickyloynd-microsoft avatar Nov 14 '23 19:11 rickyloynd-microsoft

@balakreshnan

For execution on AzureML Compute Instance I was able to run autogen using the local vm disk: https://github.com/microsoft/autogen/issues/79#issuecomment-1744086814

jakeatmsft avatar Nov 17 '23 16:11 jakeatmsft

I am having the same issues in AML compute Instance. For python scripts, I can execute in localfiles in AML compute instance, but notebooks are only executable in cloudifies folder ... Is there a way to resolve this ?

chengyuliu-msft avatar Mar 16 '24 17:03 chengyuliu-msft

@chengyuliu-msft instead of using file system based diskcache, use redis cache, or turn the cache off.

Alternatively, set the cache_root_path to a writable path.

See: https://microsoft.github.io/autogen/docs/topics/llm-caching

ekzhu avatar Mar 16 '24 17:03 ekzhu

Thanks @ekzhu. I moved the repo to localfiles and opened with VS code. I will try cache_root_path parameter a bit later.

chengyuliu-msft avatar Mar 18 '24 12:03 chengyuliu-msft

Hi @chengyuliu-msft , did it work for you? Could you close the issue if it's resolved? Thanks.

thinkall avatar Jun 18 '24 06:06 thinkall

I am having the same error with aml compute instance

nirmakpakis avatar Sep 18 '24 19:09 nirmakpakis

has a workaround and unlikely to be fixed further for 0.2. please reopen if you object and consider contributing either doc or a fix.

rysweet avatar Oct 12 '24 02:10 rysweet