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

IPFS Desktop - installing from source issue - Running as root without --no-sandbox is not supported #2090

Closed
wandyyd opened this issue Mar 31, 2022 · 6 comments
Labels
kind/bug A bug in existing code (including security flaws) need/author-input Needs input from the original author

Comments

@wandyyd
Copy link

wandyyd commented Mar 31, 2022

  • Linux 18.04.06 LTS
  • IPFS Desktop 0.20.4

Describe the bug
Hi there, I kinda new in linux world, so any suggestion is welcome. :)
Anyway, about the issue. I tried to follow these steps to install ipfs-desktop.
On early phase of installation, I got this kind of error

/root/ipfs-desktop/node_modules/electron/dist/electron: error while loading shared libraries: libasound.so.2: c annot open shared object file: No such file or directory

So, every error around that, I install it one by one (you can see on steps to reproduce below, no.4).
And at last, I tried npm start and it gives me another error, as written on steps to reproduce below, no.5

So, is there any issue about that?
I wonder if running it as root is an issue, but when I see, there's no documentation (or do I miss it?) around that, so I think it's okay if we run it as root.
Also, I'm not sure about packages / .so libraries that missing, so, is there any per-requisites before installing this other than installing node and npm itself?

And last, if we can't run it as root due some issue etc, do you think it needs to be added on documentation?

To Reproduce
Steps to reproduce the behavior:

  1. SSH login as root

  2. Following the same steps to install ipfs-desktop

  3. When reaching npm start, got some errors related .so packages, so I install some of it one-by-one depends of what it needs.
    To sum-up I did this
    sudo apt-get install libnss3 -y && sudo apt-get install libatk-bridge2.0-0 -y && sudo apt-get install libcups2 -y && sudo apt-get install libgtk-3-0 -y && sudo apt-get install libgbm -y && sudo apt-get install libasound2 -y

  4. Try to do npm start and it shows

> ipfs-desktop@0.20.4 start
> cross-env NODE_ENV=development electron .

[0331/023137.699363:FATAL:electron_main_delegate.cc(291)] Running as root without --no-sandbox is not supported . See https://crbug.com/638180.
/root/ipfs-desktop/node_modules/electron/dist/electron exited with signal SIGTRAP

Expected behavior
Not sure, but, ipfs-desktop should start without an issue(?).

Additional context
I did those above steps, as root. I tried to check around the solution, but I ended-up no idea of what it is or how to do that.
Here's one of the result when I tried to check around how to overcome this issue - link. But I really have no idea what it's, but I think I shouldn't need to tweak the code(?)

Thanks for your time! :)

@wandyyd wandyyd added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Mar 31, 2022
@welcome

This comment was marked as resolved.

@wandyyd
Copy link
Author

wandyyd commented Mar 31, 2022

*Additional info in-case if root really can't work

I already tried to add new user and do same installation steps as described, it also gives an error but different

> ipfs-desktop@0.20.4 start
> cross-env NODE_ENV=development electron .

2022-03-31T08:17:33.988Z info: [meta] logs can be found on /path/to/home/.config/IPFS Desktop
/path/to/home/ipfs-desktop/node_modules/electron/dist/electron exited with signal SIGTRAP

When I tried to check the "log", I couldn't found any useful thing. IPFS Desktop folder only containing:

config.json
SingletonCookie
SingletonLock
SingletonSocket

But, not a real error log or else. Kinda wonder if installation from source is really work or not for this version. 😕

@lidel
Copy link
Member

lidel commented Apr 4, 2022

In general, you should never run random code from the internet as root 🙈
NPM dependencies are full of dragons. Run as a regular user, you may even choose to create a dedicated one for developer work like this. Be safe.

My understanding is that you run Ubuntu 18.04.06 LTS.
Hard to say what is missing, it seems to be an older version. Do you have libudev?
You may run electron with gdb to figure out why it fails.

Other thing to check is to change package.json like this:

-    "start": "cross-env NODE_ENV=development electron .",
+    "start": "cross-env NODE_ENV=development electron -no-sandbox .",

and try npm start again.

Lmk if any of the above helped.

@lidel lidel added need/author-input Needs input from the original author and removed need/triage Needs initial labeling and prioritization labels Apr 4, 2022
@wandyyd
Copy link
Author

wandyyd commented Apr 5, 2022

Thanks a lot for your tips! Will take notes for it. 😄

And yes, I already create a regular user and use it to install ipfs-desktop as-per my second comment above, but the error shown as mentioned. 😕

Also, as per your suggestion to add -no-sandbox, I forgot to mention, that I already done that but same error as regular user still persist, exited with signal SIGTRAP.

Seems the error due old version(?) of Ubuntu.

Anyway, as for now, I'm using jsipfs, hopefully it achieve the same as ipfs-desktop.
And I kinda wonder, what's the required libraries (.so) for ipfs (or ipfs-desktop)?
As mentioned, initially, I keep got error about error while loading shared libraries: ...... So, I think, maybe because I miss something there, that causing the error(?).

@lidel
Copy link
Member

lidel commented Apr 11, 2022

  • electron-builder takes care of selecting all the necessary libraries for us – you could investigate .deb or .rpm packages and see which deps are listed in manifests there
  • sadly we have no bandwidth to support debugging your custom build from source – you can try asking for help at https://discuss.ipfs.io/c/help/13 – this repo is for bugs in ipfs-desktop itself, so I'm closing this issue.
  • fwiw we provide pre-built packages including AppImage – if you have no luck with custom build, I suggest using prebuilt version

@lidel lidel closed this as completed Apr 11, 2022
@wandyyd
Copy link
Author

wandyyd commented Apr 12, 2022

Thank you for your comments. I will take notes for it, for future references!
Cheers! 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/author-input Needs input from the original author
Projects
None yet
Development

No branches or pull requests

2 participants