[Bug]: Crash on start (Ubuntu 24.04) #2007
Labels
No labels
awaiting-reply
breaking changes
bug
cannot-reproduce
dependencies
documentation
duplicate
electron-issue
enhancement
fix-available
good first issue
help wanted
invalid
javascript
need more information
need rebase
official-youtube-music-issue
plugin request
question
release
security
stale
Status: blocked
typo
wontfix
ytmd-issue
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: YTMD/youtube-music#2007
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Preflight Checklist
YouTube Music (Application) Version
3.3.6
Checklists
What operating system are you using?
Ubuntu
Operating System Version
Ubuntu 24.04
What CPU architecture are you using?
x64
Last Known Working YouTube Music (Application) version
No response
Reproduction steps
$ youtube-music
Expected Behavior
Open
Actual Behavior
Crash at start
Enabled plugins
None
Additional Information
LaunchProcess: failed to execvp:
/opt/YouTube
[5924:0425/165253.026537:FATAL:zygote_host_impl_linux.cc(202)] Check failed: . : Argumento inválido (22)
«trap» para punto de parada/seguimiento (`core' generado)
looks like a path or shortcut issue but doesn't make much sense (Maybe this info will be more helpful to someone who knows Linux better then me). If I go to "/opt/YouTube Music" in the files app and double click on the executable youtube-music it will launch the app. This is strange because the "/usr/share/applications/youtube-music.desktop" points directly to that same file. I also tried running "/usr/bin/youtube-music" or changing the desktop file to that location and still get the same error. Unsure why I can go directly to the app in files and run it but not as a shortcut, so very strange. I can run it from files app directly but not from the terminal. So very strange.
Maybe the desktop file is configured for Wayland and you are in x11?
Can you share ur desktop file?
The initial setup was on wayland, now i've change to x11. Same error.
[Desktop Entry]
Name=YouTube Music
Exec="/opt/YouTube Music/youtube-music" %U
Terminal=false
Type=Application
Icon=youtube-music
StartupWMClass=YouTube Music
Comment=YouTube Music Desktop App - including custom plugins
Categories=AudioVideo
I also receive the error if I try to run it directly from terminal
"/opt/YouTube Music/youtube-music"
on Wayland and x11. The only way I can get it to run is to use files to go directly to /opt/YouTube Music/youtube-music and double click on it.strace -o trace.log "/opt/YouTube Music/youtube-music"
The reason is, that in Ubuntu 24.04 we have restricted user namespaces (which affects electron being able to spawn a sandbox)
See https://github.com/electron/electron/issues/41066
See https://ubuntu.com/blog/ubuntu-23-10-restricted-unprivileged-user-namespaces
and https://discourse.ubuntu.com/t/noble-numbat-release-notes/39890#unprivileged-user-namespace-restrictions-15
See here for some fixes regarding bwrap, (which we could use similar fixes, I am currently testing that)
Solutions
There are two possible solutions fro this problem in Ubuntu 24.04:
Solution 1 :
Add a apparmor profile for youtube-music, so that it can use user namespaces (userns)
To do this this, create this file
/etc/apparmor.d/youtube-music
and add this content to itand than run
Taken from here and modified accordingly.
Tested locally, it works.
Solution 2:
disable this restriction ( might also help for other apps, that crash otherwise)
And then you have to reboot.
this disables the restriction against unprivileged user namespaces.
This app should ship the
/etc/apparmor.d/youtube-music
with the correct content in it in the debs, rpms etc, as some other popular electron applications do (like e.g. vscode). I am investigating where this should be done (in electron-vite, electron-builder or in this repo)Edit:
My investigations resulted in the following:
It is not possible to add a file to
/etc/apparmor.d/youtube-music
withelectron-builder
. I looked into some packages, that have a profile that includesuserns
flags in the profile, and they are shipped via the apparmor deb of ubuntu 24.04 (filelist).So none of the debs (e.g. vscode) ships it itself. Since we are certainly not able, to add "our"youtube-music
file into that deb package, we have to do it ourselves. So eitherelectron-builder
needs to support that, or we add this file via some "magic" in the postinstall and remove it via rm in the postrm shell scripts 🤷🏼♂️The first option is a better option, but for that we need to do submit a PR doing that to
electron-builder
(for which I currently don't have the time to 😓 ) . So if someone sees this and has the time to do so, feel free to do it ❤️guy, just update your kernel to version 6.9.12 and everything fix
Fixed at
electron-builder@26.0.0-alpha.9