axcore / tartube

A GUI front-end for youtube-dl, partly based on youtube-dl-gui and written in Python 3 / Gtk 3
GNU Lesser General Public License v2.1
2.12k stars 112 forks source link

KeyError on Startup #558

Closed ceonelson closed 12 months ago

ceonelson commented 1 year ago

I noticed this with the previous version and just updated and it is still happening. DB check passes.

$ ./tartube_mswin.sh
Error in sys.excepthook:
Traceback (most recent call last):
  File "C:\Users\Owner\Documents\___Apps\Tartube\msys64\home\user\tartube\tartube\tartube", line 158, in handle_uncaught_exception
    raise type(value)
KeyError

Original exception was:
Traceback (most recent call last):
  File "C:/Users\Owner\Documents\___Apps\Tartube\msys64\home\user\tartube\tartube/mainapp.py", line 3465, in do_activate
    self.start()
  File "C:/Users\Owner\Documents\___Apps\Tartube\msys64\home\user\tartube\tartube/mainapp.py", line 3710, in start
    self.start_continue(new_config_flag)
  File "C:/Users\Owner\Documents\___Apps\Tartube\msys64\home\user\tartube\tartube/mainapp.py", line 3886, in start_continue
    self.load_db()
  File "C:/Users\Owner\Documents\___Apps\Tartube\msys64\home\user\tartube\tartube/mainapp.py", line 6600, in load_db
    self.main_win_obj.switch_profile(self.last_profile)
  File "C:/Users\Owner\Documents\___Apps\Tartube\msys64\home\user\tartube\tartube/mainwin.py", line 5463, in switch_profile
    self.video_index_reset_marker(dbid)
  File "C:/Users\Owner\Documents\___Apps\Tartube\msys64\home\user\tartube\tartube/mainwin.py", line 10574, in video_index_reset_marker
    tree_ref = self.video_index_row_dict[dbid]
KeyError: 1

I noticed on launch that the folders under my profile were no longer being checked, so I tried to switch to my daily profile and got this error:

Error in sys.excepthook:
Traceback (most recent call last):
  File "C:\Users\Owner\Documents\___Apps\Tartube\msys64\home\user\tartube\tartube\tartube", line 158, in handle_uncaught_exception
    raise type(value)
KeyError

Original exception was:
Traceback (most recent call last):
  File "C:/Users\Owner\Documents\___Apps\Tartube\msys64\home\user\tartube\tartube/mainwin.py", line 22317, in on_switch_profile_menu_select
    self.switch_profile(profile_name)
  File "C:/Users\Owner\Documents\___Apps\Tartube\msys64\home\user\tartube\tartube/mainwin.py", line 5463, in switch_profile
    self.video_index_reset_marker(dbid)
  File "C:/Users\Owner\Documents\___Apps\Tartube\msys64\home\user\tartube\tartube/mainwin.py", line 10574, in video_index_reset_marker
    tree_ref = self.video_index_row_dict[dbid]
KeyError: 1

Let me know if there's anything I can do to debug, thanks Axcore!

ceonelson commented 1 year ago

So I selected a bunch of folders to download, hit the download marked items button and got:

Tartube Error # 111 Cannot start the download operation because Tartube failed to finish loading a database (which seems to be broken)

Closed tartube, relaunched, did a db check and it said no errors.

Checked some folders, download marked items, same error...

Closed, relaunched, checked db, tried to right click on a channel and download, same error...

Something is completely broken now :( Going to see if reverting to the previous version fixes it, otherwise will try a db backup.

axcore commented 1 year ago

I can't reproduce your error or guess the cause, but I have tweaked the code to stop the crash. Instead you'll see a message in the Errors/Warnings tab (and everything else should work as normal). You can test and let me know the results.

I noticed that the "Create profile" option in Tartube's menu was completely broken, so I fixed that as well.

Update as described here, you know the drill :)

ceonelson commented 1 year ago

Thanks Axcore!

On start up it now shows the selected profile so that's working great!

Got this in the log:

image

For some reason the copy selected button didn't work :(

But the download selected items is working well again so that's fixed, thank you!

axcore commented 1 year ago

I can make the new Tartube error go away completely, but it would be even better to find the cause.

I suggest creating a new database, one you don't mind sending to me, add a few channels and playlists, and mark some of them for download. As soon as you see the error, then that's the database I would like to examine :)

For some reason the copy selected button didn't work :(

Can you be more specific? Can you select one or more lines, click the button, switch to a text editor, then press CTRL + V? Also, have you enabled drag and drop globally (in Edit > System preferences... > Windows > Drag)?

ceonelson commented 1 year ago

I already have a test db that I use for trying out new command lines or ytdl versions and that one at least doesn't have an error. I'll try making a new db and doing some downloads to see if I can get it happening.

Correct, I just got a new error and selected the line, clicked the copy button and then tried to paste it in here and nothing happens. Drag and drop is globally enabled, but has never worked for me on windows.

I'll try running tartube after starting msys starting from an admin powershell to see if that helps.

axcore commented 1 year ago

I tested the new copy button on Windows 10, seems to be working as expected (at least for me)

  1. Generated some errors
  2. Select every line in the error list (press CTRL + A)
  3. Press the Copy selected button
  4. In Notepad, right-click and select Paste

copypaste

Once again, make sure that at least some of the options in Edit > System preferences... > Windows > Drag are enabled, because they also control the behaviour of the new Copy button.

copypaste2