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

fix missing 1 required positional argument bug & sqlite3.operationalerror: database is locked issue #78

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Trinity-SYT-SECURITY
Copy link

image

@Trinity-SYT-SECURITY Trinity-SYT-SECURITY changed the title fix missing 1 required positional argument bug fix missing 1 required positional argument bug & sqlite3.operationalerror: database is locked issue Aug 6, 2024

def perform_round(self, turn:int) -> bool:
got_root : bool = False
def perform_round(self, turn: int) -> bool:##fix code
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the comment

self.log_db.add_log_query(self._run_id, turn, cmd, result, answer)
self._sliding_history.add_command(cmd, result)
self.console.print(Panel(result, title=f"[bold cyan]{cmd}"))
#self.log_db.add_log_query(self._run_id, cmd, result, answer)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks wrong, wouldn't this only call test_credentials and not execute_command anymore?

def connect(self):
self.db = sqlite3.connect(self.connection_string)
# self.db = sqlite3.connect(self.connection_string, timeout=10) # Set timeout to 10 seconds
self.db = sqlite3.connect(self.connection_string, check_same_thread=False, timeout=10)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is weird. I am trying to understand the error case. Are you running two instances of hackingBuddyGPT in parallel? This would not be supported by the sqlite3 database (that we are currently using). I think the clean solution would rather be to use a separate sqlite database per run (using the log_db parameter) or using a database such as postgres/mysql that supports concurrent access

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

Successfully merging this pull request may close these issues.

2 participants