Jules-WinnfieldX / CyberDropDownloader

Bulk Gallery Downloader for Cyberdrop.me and Other Sites
GNU General Public License v3.0
1.63k stars 185 forks source link

[BUG] Primary keys (?) error after updating to V5.1.92 #838

Closed asdf1151 closed 7 months ago

asdf1151 commented 7 months ago

After updating to python3.11 and V5.1.92, I was able to start up cyberdrop-dl but when I hit download, I run into "Fixing primary keys in the database: DO NOT EXIT THE PROGRAM" error and the last line of the traceback is "sqlite3.OperationalError: table media_copy has 8 columns but 7 values were supplied"

Is this an issue with my installation of python 3.11 or is there another problem?

Jules-WinnfieldX commented 7 months ago

5.1.93 going up now should fix that.

asdf1151 commented 7 months ago

Thanks for the quick response. I've updated to 5.1.93 just now via pip install but still getting an error. Final line from the traceback is a slight variation:

"sqlite3.OperationalError: 7 values for 8 columns"

Jules-WinnfieldX commented 7 months ago

can I see the full traceback?

asdf1151 commented 7 months ago

Of course, copied below

File "/Library/Frameworks/Python.framework/Versions/3.11/bin/cyberdrop-dl", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cyberdrop_dl/main.py", line 151, in main
    asyncio.run(director(manager))
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cyberdrop_dl/main.py", line 103, in director
    await manager.async_startup()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cyberdrop_dl/managers/manager.py", line 75, in async_startup
    await self.db_manager.startup()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cyberdrop_dl/managers/db_manager.py", line 38, in startup
    await self.history_table.startup()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cyberdrop_dl/utils/database/tables/history_table.py", line 45, in startup
    await self.fix_primary_keys()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cyberdrop_dl/utils/database/tables/history_table.py", line 169, in fix_primary_keys
    await self.db_conn.execute("""INSERT INTO media_copy (domain, url_path, referer, album_id, download_path, download_filename, original_filename, completed) SELECT * FROM media GROUP BY domain, url_path, original_filename;""")
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiosqlite/core.py", line 184, in execute
    cursor = await self._execute(self._conn.execute, sql, parameters)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiosqlite/core.py", line 129, in _execute
    return await future
           ^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiosqlite/core.py", line 102, in run
    result = function()
             ^^^^^^^^^^
sqlite3.OperationalError: 7 values for 8 columns
Jules-WinnfieldX commented 7 months ago

ahh. Oops. 5.1.94 should do it

asdf1151 commented 7 months ago

Great! I'll give it a shot later. Thanks again for the quick fixes!