whatsnowplaying / whats-now-playing

Titling software for streamers who use DJ software like Serato, Virtual DJ, and more.
MIT License
57 stars 11 forks source link

πŸ› Bug Report: app fails to start if Native Instruments dir exists with no Traktor config #692

Closed apreeel closed 1 year ago

apreeel commented 1 year ago

πŸ“œ Description

When open app at first time it asks to access Documents folder and also firewall triggers that it trying to access some host, but then it exit before even some gui appears. There is now app icon in dock or anything. When trying to run executable from .app contents it fails with [1466] Failed to execute script 'nppyi' due to unhandled exception! message, see full log. Both result for Intel and ARM version. Mac OS 13.2.1, M1 Pro.

tabacyclone@mbp14apreeel ~ % /Applications/NowPlaying.app/Contents/MacOS/NowPlaying ; exit;
Traceback (most recent call last):
  File "nppyi.py", line 14, in <module>
  File "nowplaying/__main__.py", line 77, in main
  File "nowplaying/__main__.py", line 63, in actualmain
  File "nowplaying/config.py", line 83, in __init__
  File "nowplaying/config.py", line 207, in defaults
  File "nowplaying/config.py", line 231, in _defaults_plugins
  File "nowplaying/inputs/traktor.py", line 177, in __init__
  File "nowplaying/inputs/icecast.py", line 154, in __init__
  File "nowplaying/inputs/__init__.py", line 18, in __init__
  File "nowplaying/inputs/traktor.py", line 204, in defaults
IndexError: list index out of range
[1466] Failed to execute script 'nppyi' due to unhandled exception!

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
Deleting expired sessions...       2 completed.

[Process completed]

πŸ‘Ÿ Reproduction steps

Run the app. Or run the NowPlaying executable from NowPlaying.app/Contents/MacOS/ for terminal log output.

πŸ‘ Expected behavior

I was expected to see some GUI.

πŸ‘Ž Actual Behavior

But it even won't start.

πŸ’» Operating system

MacOS

πŸ’» Chipset/CPU

Apple M1

πŸ’» Input source

Serato

🧱 Your Environment

No response

aw-was-here commented 1 year ago

Hmm. Weird. I actually run all the time on M1, so I wonder if it is something else. Thanks for the bug report! I'll take a look.

aw-was-here commented 1 year ago

By chance, do you have a Traktor directory on your system?

The stack trace points to https://github.com/whatsnowplaying/whats-now-playing/blob/cd5581d9400a4a8c1922ce740f3637c4c8251d0a/nowplaying/inputs/traktor.py#L204 which would definitely crash if Traktor was installed but never had anything added to it. Definitely a bug.

apreeel commented 1 year ago

No, Traktor was never installed, so I suppose there is no Traktor directory. I goggled where it should be and there is no any Traktor directories. But yes, there is Native Instruments directory (i have Massive X and Guitar Rig installed).

apreeel commented 1 year ago

After renaming NI directory app runs with next message: Configured source None is not supported. Reconfiguring. Then i got this: image Then it closes. Also it generates some log files: debug.log

After renaming NI directory back to it's original name behavior returns to what i described earlier. It fails to run and provide similar log output.

aw-was-here commented 1 year ago

Does it close or does it keep running in the menu bar? It should stay up in the menu bar.

apreeel commented 1 year ago

As I can see with Activity Monitor the process quits. There is tray icon while error messages is on screen, but I can't access setting from here. After clicking "OK" on "Basic configuration hopefully..." it quits.

aw-was-here commented 1 year ago

Chances are, if you relaunch without the NI directory again it will boot as normal now that it has a config. But that's obviously not ideal. Let me play around with a new install and see if I can duplicate. I have a hunch I know what the problem is but will need some time to verify.

Thanks for all the bug info!

aw-was-here commented 1 year ago

Actually, after Basic Configuration, you should be getting the Settings window popped up, but it might be hidden by other windows. Menu will be disabled during this initial install.

apreeel commented 1 year ago

I have tried a bunch of combinations of folder states and names, removed config, uninstall app using CleanMyMac and reinstalled it again (with renamed NI directory) but it still acting like before. What do you call "Basic Configuration"? I guess I've never seen anything like this. And as far as I can see there is definitely no Settings window. https://youtu.be/e0twz-cU3Rg

aw-was-here commented 1 year ago

OK, i've tracked down the issue. Very subtle bug!

The usual flow should be:

  1. Run binary.
  2. Software attempts to figure out what is running.
  3. Flashes up the 'Basic Configuration' window you got above.
  4. Pops up the Settings window so you can make adjustments

There's an unrelated crash in the middle of 3 and 4 due to a recent change where the UI code isn't fully loaded yet. It looks like another simple fix. Gotta love these x.0.0 releases. Sigh.

apreeel commented 1 year ago

OK, i've got it. Thank you for the answer.

aw-was-here commented 1 year ago

After a lot more digging, it is very clear that I broke fresh installs a few revs back and no one caught it. Sigh.

aw-was-here commented 1 year ago

Just published 4.0.1 which should fix all of the above issues. 🀞

apreeel commented 1 year ago

It runs successfully! Thank you so much. I'm gonna go figure out how it works for now. 🫢🏻

aw-was-here commented 1 year ago

Awesome! Thanks for sticking with it while we debugged. πŸ˜„ I'm going to close this one out. If something new pops up, feel free to file some issues.