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

[Update: culprit found] Crashed after adding a new anime from the search function, now it refuses to launch #744

Open
Yasand123 opened this issue Jan 1, 2025 · 6 comments

Comments

@Yasand123
Copy link

Yasand123 commented Jan 1, 2025

It worked fine before, but once I tried to add a new anime using the built in search functionality it crashed and now it refuses to open.

Here's the terminal logs:

❯ trackma-qt
Trackma-qt v0.8.6
QFont::fromString: Invalid description 'Segoe UI,9,-1,5,400,0,0,0,0,0,0,0,0,0,0,1'
QFont::fromString: Invalid description 'Consolas,9,-1,5,400,0,0,0,0,0,0,0,0,0,0,1'
QFont::fromString: Invalid description 'Segoe UI,9,-1,5,400,0,0,0,0,0,0,0,0,0,0,1'
QFont::fromString: Invalid description 'Segoe UI,9,-1,5,400,0,0,0,0,0,0,0,0,0,0,1'
Engine: Trackma v0.8.6 - using account psyronicity(mal).
Engine: Reading config files...
Data: Initializing...
libmal: Initializing...
Data: Using libmal (anime)
Engine: Parsing redirection file...
Engine: Scanning local library...
Tracker (pyinotify): Initializing...
Tracker (pyinotify): Using pyinotify.
Traceback (most recent call last):
  File "/usr/lib/python3.13/site-packages/trackma/ui/qt/mainwindow.py", line 1435, in r_engine_loaded
    self._recalculate_counts()
    ~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/site-packages/trackma/ui/qt/mainwindow.py", line 713, in _recalculate_counts
    self.counts[show['my_status']] += 1
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 1
zsh: IOT instruction (core dumped)  trackma-qt

I tried deleting my ~/.conf/trackma directory as if I'm starting from scratch but it still gives me the same error, which is bizarre. Does it store cache somewhere else? Maybe I can try removing the cache. ~/.cache/trackma only stores thumbnails/cover art.


Edit; some new information. I think I found the culprit.

I opened trackma-gtk this time, instead of the qt version, and it ran fine. However when I looked at the logs I found the following:

Engine: Unloading...
Data: Processing queue...
libmal: Adding item anime_name...
Data warning: Can't process anime_name, will leave unsynced.
Tracker (user_name): Unloading...
Engine: Unloading user hooks...

I replaced the anime name with anime_name and my account with user_name for privacy reasons. Anyway, the way I fixed this is that I went to the MAL website and added the anime from there and hit ctrl+s in the gtk version to sync/download the change. Then I reopened the qt version and it opened fine and I was no longer getting the error in the gtk version either.

So, from this, the culprit for the crashes is confirmed to be the inability to upload the change, the new anime added from within the client. As to why it cannot upload the change is still unknown, but regardless, the Qt version should not crash. It should log the error message just like the gtk version. It's the only way I could tell what was causing the crash.

Until this is fixed, users must avoid adding new anime using the Trackma client. Just use the website instead. Everything else works fine.

@Yasand123 Yasand123 changed the title Crashed after adding a new anime from the search function, now it refuses to launch [Update: culprit found] Crashed after adding a new anime from the search function, now it refuses to launch Jan 1, 2025
@z411 z411 self-assigned this Jan 18, 2025
@z411
Copy link
Owner

z411 commented Jan 22, 2025

I can't seem to reproduce this. I tried adding several shows using MyAnimeList on the Qt interface. Could you provide us with the exact steps you're following to reproduce this?

@Yasand123
Copy link
Author

Ok, I did some testing and I could not reproduce it at first. Then I thought, maybe it's a connection issue. Since I sometimes have that but not always. And I was able to reproduce it by simulating it.

  1. Open trackma (QT)
  2. Search for an anime to add
  3. Select it, but don't hit OK just yet, don't close the Add Anime window
  4. Disconnect from the Internet
  5. Hit add now (while offline)
  6. trackma QT will crash

After that you can re-connect. Trackma QT will still crash, it's broken permanently because it failed to add it the first time. Now open trackma GTK using the terminal and close it and see the output in the terminal which should help you see the error messages since the GTK version doesn't crash outright.

The only way to fix trackma QT now is to:

  1. Manually add the anime it failed to add the first time (by manually I mean using the MAL website)
  2. Open trackma GTK (since it doesn't crash)
  3. Hit Ctrl+S to sync/download the new anime

That should fix trackma QT and it will not crash anymore.

@RadCraftplay
Copy link

RadCraftplay commented Jan 26, 2025

For me it also breaks from time to time. Sometimes after adding new anime, sometimes after updating an episode. Today Trackma broke on "Data: Reading cache..." step, after updating an episode (that failed to sync in a previous session). Trackma-qt just hanged, but trackma-cli crashed. Your workarround worked for me. Thank you very much!

Sadly I forget to save the stack trace.

@z411
Copy link
Owner

z411 commented Jan 26, 2025

This happens when there's data missing in the local database for several reasons. It's a bug and it shouldn't happen, and even if it happens, it shouldn't cause a crash but a warning for debugging. I would appreciate it if you keep reporting whenever it happens and how to reproduce it if possible.

@z411
Copy link
Owner

z411 commented Jan 26, 2025

@Yasand123 Thank you for the feedback. Sadly I tried your steps and Trackma-qt doesn't crash when adding an anime, in fact it adds it just fine to the local list. I can open it again too and it doesn't crash.

What website are you using, and what are your settings related to sync intervals? Did you set it to send immediately after a change?

@FichteFoll
Copy link
Collaborator

FichteFoll commented Jan 27, 2025

Also, please run trackma-qt -d via a terminal for a debug log. If it crashes, we'll have more info to work with. Of course, feel free to redact any potentially sensitive information before sharing the debug log or only include the traceback (if it is different from the one in OP).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants