paul-gauthier / aider

aider is AI pair programming in your terminal
https://aider.chat/
Apache License 2.0
18.82k stars 1.74k forks source link

Uncaught DatabaseError in core.py line 828 #1377

Closed lenohard closed 1 week ago

lenohard commented 2 weeks ago

Aider version: 0.54.12 Python version: 3.12.5 Platform: macOS-15.0-arm64-arm-64bit Python implementation: CPython Virtual environment: Yes OS: Darwin 24.0.0 (64bit) Git version: git version 2.39.5 (Apple Git-154)

An uncaught exception occurred:

Traceback (most recent call last):
  File "aider", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "main.py", line 682, in main
    coder.run()
  File "base_coder.py", line 730, in run
    self.run_one(user_message, preproc)
  File "base_coder.py", line 773, in run_one
    list(self.send_message(message))
  File "base_coder.py", line 1083, in send_message
    chunks = self.format_messages()
             ^^^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 1021, in format_messages
    chunks = self.format_chat_chunks()
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 971, in format_chat_chunks
    chunks.repo = self.get_repo_messages()
                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 627, in get_repo_messages
    repo_content = self.get_repo_map()
                   ^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 599, in get_repo_map
    repo_content = self.repo_map.get_repo_map(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "repomap.py", line 124, in get_repo_map
    files_listing = self.get_ranked_tags_map(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "repomap.py", line 466, in get_ranked_tags_map
    result = self.get_ranked_tags_map_uncached(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "repomap.py", line 497, in get_ranked_tags_map_uncached
    ranked_tags = self.get_ranked_tags(
                  ^^^^^^^^^^^^^^^^^^^^^
  File "repomap.py", line 331, in get_ranked_tags
    tags = list(self.get_tags(fname, rel_fname))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "repomap.py", line 196, in get_tags
    self.TAGS_CACHE[cache_key] = {"mtime": file_mtime, "data": data}
    ~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "core.py", line 823, in __setitem__
    self.set(key, value, retry=True)
  File "core.py", line 806, in set
    self._row_update(rowid, now, columns)
  File "core.py", line 828, in _row_update
    sql(
sqlite3.DatabaseError: database disk image is malformed
paul-gauthier commented 1 week ago

Thanks for trying aider and filing this issue.

The fix is available in the main branch. You can get it by installing the latest version from github:

aider --install-main-branch

# or...

python -m pip install --upgrade git+https://github.com/paul-gauthier/aider.git

If you have a chance to try it, let me know if it works better for you.