5afe / safe-react

Deprecated! New repo – https://github.com/safe-global/web-core
MIT License
332 stars 363 forks source link

Can't connect Ledger on Linux Safe desktop version #1862

Closed tschubotz closed 3 years ago

tschubotz commented 3 years ago

For 2.21.0: Let's check this out but timebox it.

Title/Description

Can't connect Ledger on Linux

Environment

Steps to reproduce

  1. Download 2.17.2 of the desktop app
  2. Connect wallet
  3. Unlock ledger

Expected result

Ledger connects

Obtained result

Error

Screenshots

image.png

Misc

It works on previous versions.

mmv08 commented 3 years ago

@tschubotz I recently installed Linux and had some problems with connecting the ledger too. It turns out that on Linux you have to run some commands to be able to connect, see here under "Linux" expandable: https://support.ledger.com/hc/en-us/articles/115005165269-Fix-connection-issues

tschubotz commented 3 years ago

Yea, Dani explained to me already. That was indeed the issue. Ledger Live also didn't work. Thanks! https://gnosisinc.slack.com/archives/C63LQTGNB/p1612535476129500?thread_ts=1612491003.123000&cid=C63LQTGNB

mmv08 commented 3 years ago

hehe, I was actually about to write that I tested it and it doesn't work, so these rules are not the issue in this case

tschubotz commented 3 years ago

so these rules are not the issue in this case

You mean Add the udev rules was not the reason? That fixed it for me though 🤔

mmv08 commented 3 years ago

I couldn't connect with leader on a pc with Linux with udev rules applied

tschubotz commented 3 years ago

hm ok, opening this one up again then. Seems like Auryn's issue also wasn't resolved 🤔 https://gnosisinc.slack.com/archives/C63LQTGNB/p1612545472133000?thread_ts=1612491003.123000&cid=C63LQTGNB

tschubotz commented 3 years ago

@mikheevm which version did you use? 2.17.2? Could you try with a local build of the latest code base, to see if the issue persists, please?

Also reminder for myself @tschubotz test again with latest build.

tschubotz commented 3 years ago

I just tried this again with the latest code base and running yarn electron-dev, still unable to connect. I'm on Ubuntu 20.04. I did everyhting from https://support.ledger.com/hc/en-us/articles/115005165269-Fix-connection-issues.

Ledger Live also doesn't work though.

@nicosampler you said this works for you ,right? What Linux are you on?

nicosampler commented 3 years ago

if Live does not work, the safe won't work either. I'm using Ubuntu 20.04.1 LTS and for me, Live and Safe are working. Tested with Nano S and Nano X

tschubotz commented 3 years ago

@nicosampler what version of Ledger live are you on?

nicosampler commented 3 years ago

2.19.0 but I also used three or four previous versions without a problem.

tschubotz commented 3 years ago

Yea, I also don't have any issues with old Safe desktop versions. Hence I'm thinking this is perhaps related to some electron issue.

Could you please try the latest Ledger Live 2.21.3? https://github.com/LedgerHQ/ledger-live-desktop/releases

matextrem commented 3 years ago

@tschubotz the reason why ledger is not working when you use yarn electron-dev is related to the app not being ran over https and ledger only works behind a secure domain

tschubotz commented 3 years ago

@matextrem ah ok, thanks. How do I create a local build of the latest codebase to test this then?

nicosampler commented 3 years ago

Could you please try the latest Ledger Live 2.21.3?

yes, it also works for me

matextrem commented 3 years ago

@tschubotz You could run yarn electron-build (you can change line 25 in package.json to leave only linux flag). It will create a dist folder with a productive version for linux (.AppImage executable)

tschubotz commented 3 years ago

I am unable to properly create the build. I've tried to fix it, seems that something related to node-hid and fsevents cannot be installed on my MacOS.

Could someone provide an up to date .AppImage for Linux? I'm happy to test, otherwise I can't support currently.

  ⨯ cannot build native dependency  reason=prebuild-install failed with error and build from sources not possible because platform or arch not compatible
                                    cause=exit status 1
                                    errorOut=prebuild-install info begin Prebuild-install version 5.3.6
    prebuild-install info looking for cached prebuild @ /Users/tobias/.npm/_prebuilds/90cf8b-node-hid-v2.1.1-electron-v80-linux-x64.tar.gz
    prebuild-install http request GET https://github.com/node-hid/node-hid/releases/download/v2.1.1/node-hid-v2.1.1-electron-v80-linux-x64.tar.gz
    prebuild-install http 404 https://github.com/node-hid/node-hid/releases/download/v2.1.1/node-hid-v2.1.1-electron-v80-linux-x64.tar.gz
    prebuild-install WARN install No prebuilt binaries found (target=9.4.3 runtime=electron arch=x64 libc= platform=linux)

                                    command=/usr/local/Cellar/node/15.6.0/bin/node /Users/tobias/gnosis/safe-react/node_modules/prebuild-install/bin.js --platform=linux --arch=x64 --target=9.4.3 --runtime=electron --verbose --force
                                    workingDir=/Users/tobias/gnosis/safe-react/node_modules/node-hid
error Command failed with exit code 1.
matextrem commented 3 years ago

Yeah, you cannot build for Linux on a MacOS env. @dasanra could you get a Linux executable version for Tobi to test? Otherwise, I would try to get one.

matextrem commented 3 years ago

@tschubotz here you have an executable version for Linux https://drive.google.com/file/d/1UEZbyn4U2H1X4pEqPxnMVfRO8iRjLY3W/view?usp=sharing

tschubotz commented 3 years ago

hm, doesn't seem to fix the issue. Seems like this is not Ledger related also, since Trezor doesn't work for me either. Could totally be my VM, but we had @mikheevm and @auryn-macmillan experience the same issue, so perhaps it makes sense to continue debugging this on a native linux instead.

mmv08 commented 3 years ago

I got tired of fighting with driver bugs on Linux and decided to switch to mac completely, so can't help with debugging :) I used elementaryOS 5.1.6 before, ledger + metamask duo was working perfectly

dasanra commented 3 years ago

From what I understood in this thread, Linux issues could be related to using ElementaryOS in particular, as @auryn-macmillan and @mikheevm are having problems and both are using this distribution.

I tested on ArchLinux and @nicosampler tested on Ubuntu 20 Will take a look on elementaryOs

dasanra commented 3 years ago

Found the issue while working in v3.1.3 release of the desktop app

We were using Ubuntu v20 to build the desktop app. It seems that one of the libraries used to compile the electron app glibc is not working properly if you compile with a recent version and expect to use it in an older one. You have to do it the other way round.

Elementary OS has an older version of glibc, so is not able to open the selector menu for Ledger, and that's breaking the account selection step.

Solution is to use an older Ubuntu version for building the desktop app.