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

Bug sqlite3.IntegrityError: UNIQUE constraint failed: bookmark.id #19

Open
m21-cerutti opened this issue Sep 10, 2024 · 1 comment
Open

Comments

@m21-cerutti
Copy link

m21-cerutti commented Sep 10, 2024

Hello, seems the minimal example don't work on Windows 11 with Python 3.10.8 and Firefox 130.0.

C:/Users/user/AppData/Local/Programs/Python/Python310/python.exe c:/Work/Current/BookmarkRuler/BookMarkRulerFirefox.py
Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\peewee.py", line 3322, in execute_sql
    cursor.execute(sql, params or ())
sqlite3.IntegrityError: UNIQUE constraint failed: bookmark.id

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Work\Current\BookmarkRuler\BookMarkRulerFirefox.py", line 6, in <module>
    fb.connect(criterion=ProfileCriterion.LARGEST)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\firefox_bookmarks\__init__.py", line 394, in connect
    self._load()
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\firefox_bookmarks\__init__.py", line 434, in _load
    ).execute()
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\peewee.py", line 2036, in inner
    return method(self, database, *args, **kwargs)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\peewee.py", line 2107, in execute
    return self._execute(database)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\peewee.py", line 2912, in _execute
    return super(Insert, self)._execute(database)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\peewee.py", line 2625, in _execute
    cursor = database.execute(self)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\peewee.py", line 3330, in execute
    return self.execute_sql(sql, params)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\peewee.py", line 3320, in execute_sql
    with __exception_wrapper__:
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\peewee.py", line 3088, in __exit__
    reraise(new_type, new_type(exc_value, *exc_args), traceback)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\peewee.py", line 196, in reraise
    raise value.with_traceback(tb)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\peewee.py", line 3322, in execute_sql
    cursor.execute(sql, params or ())
peewee.IntegrityError: UNIQUE constraint failed: bookmark.id
@m21-cerutti m21-cerutti changed the title Bug sqlite3.IntegrityError: UNIQUE constraint failed: bookmark.id Bug sqlite3.IntegrityError: UNIQUE constraint failed: bookmark.id Sep 10, 2024
@BURG3R5
Copy link
Owner

BURG3R5 commented Sep 11, 2024

Was this on a clean run? This error often happens when I forget to use the "clean up" methods before trying to connect again. The temporary DB file needs to be deleted using the provided functions, or else peewee/sqlite3 will throw this error.

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

No branches or pull requests

2 participants