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

unable to launch when installed from .deb in Ubuntu 24.04 #1102

Open
smcoll opened this issue Jan 27, 2025 · 3 comments
Open

unable to launch when installed from .deb in Ubuntu 24.04 #1102

smcoll opened this issue Jan 27, 2025 · 3 comments

Comments

@smcoll
Copy link

smcoll commented Jan 27, 2025

i was running version 0.20.0 from a .deb in Ubuntu 22.04, but now i can't run it in Ubuntu 24.04.

$ frappe-books 
LaunchProcess: failed to execvp:
/opt/Frappe
Trace/breakpoint trap (core dumped)

i also tried the 0.24.0 and 0.26.1 debs and got the same result.

@smcoll
Copy link
Author

smcoll commented Jan 28, 2025

i just noticed that there is no /opt/Frappe on my system - there is an /opt/Frappe Books. Could this be related to a space in the path?

@smcoll
Copy link
Author

smcoll commented Jan 28, 2025

OK, made a discovery. i tried running from yarn instead, and saw this output:

$ yarn dev
running Frappe Books in dev mode
root: /home/me/books
[28345:0128/131405.066574:FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /home/me/books/node_modules/electron/dist/chrome-sandbox is owned by root and has mode 4755.
/home/me/books/node_modules/electron/dist/electron exited with signal SIGTRAP

Here's what permissions/ownership for that file looks like:

$ ls -al /home/me/books/node_modules/electron/dist/chrome-sandbox 
-rwxr-xr-x 1 me me 52808 Jan 28 12:51 /home/me/books/node_modules/electron/dist/chrome-sandbox

Then i found this comment, which says:

The issue is with the AppArmor configuration in Ubuntu 24.04, not the AppImage. The change in the configuration is explained in the release notes of Ubuntu 24.04 (security reasons).

Because this problem is caused by the OS configuration, I'm not use what the Arduino IDE team can do, except for documenting the installation procedure.

You can disable the sandboxing restriction for all program with:

sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=1

or by adding to /etc/sysctl.d/local.conf:

kernel.apparmor_restrict_unprivileged_userns=0

But that defeats the purpose of the new AppArmor restriction in Ubuntu 24.04.

The comment goes on to show how to apply this exception to a single application

So i tried disabling the sandboxing restriction, and now the binary launches:

$ frappe-books 
Checking for beta autoupdate feature for deb/rpm distributions
Found package-type: deb
[34414:0128/133709.983686:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!

Fwiw, i can also launch from yarn now, but the window didn't render.

$ yarn dev
running Frappe Books in dev mode
root: /home/me/work/internal/projects/books
Debugger listening on ws://127.0.0.1:5858/5509f194-bf98-4465-9e4e-9407a9a522fb
For help, see: https://nodejs.org/en/docs/inspector

  VITE v4.5.5  ready in 784 ms

  ➜  Local:   http://127.0.0.1:6969/
  ➜  press h to show help

[...]

Related threads:

@smcoll
Copy link
Author

smcoll commented Jan 28, 2025

This is what i have done for the time being:

  1. Downloaded the AppImage, made it executable, and moved/renamed it to /usr/local/bin/frappe-books
  2. added a /etc/apparmor.d/frappe-books file with these contents:
    abi <abi/4.0>,
    include <tunables/global>
    
    profile frappe-books /usr/local/bin/frappe-books flags=(unconfined) {
      userns,
    
      # site-specific additions and overrides. 
      include if exists <local/frappe-books>
    }
    
  3. sudo service apparmor reload && frappe-books to load the profile and make sure it runs
  4. made a desktop launcher at ~/.local/share/applications/frappe-books.desktop (i should have found the one the .deb installed):
    [Desktop Entry]
    Name=Frappe Books
    Comment=Bookkeeping
    Exec=/usr/local/bin/frappe-books
    Icon=/usr/local/bin/frappe-books.png
    Terminal=false
    Type=Application
    Categories=Office;
    
  5. i think that has to be made executable
  6. copied https://github.com/frappe/books/tree/master/build/icon.png to /usr/local/bin/frappe-books.png

Now i can launch it.

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

No branches or pull requests

1 participant