orbitdb-archive / orbit

A distributed, serverless, peer-to-peer chat application on IPFS
MIT License
1.64k stars 117 forks source link

Runtime Error #202

Closed rsynnest closed 7 years ago

rsynnest commented 7 years ago

On a fresh install today I am unable to get past the login screen (when I hit Enter to login the app crashes and throws npm errors)

Debian 3.16.0-4-amd64 ipfs 0.4.5-dev (built from go-ipfs master, ipfs daemon --enable-pubsub-experiment works fine when run from command line) npm@3.10.9 node@v7.2.0 (also tried v6.9.2 and v6.0.0)

Here's my npm debug log: npm-debug.txt I thought maybe the errors were due to using node v7, so I downgraded to node v6.9.2 but got the same errors: npm-debug_v6.9.2.txt It appears to be failing on the call to npm run electron

Probably unrelated, but I also received the following warnings during npm install: npm WARN deprecated lodash.contains@2.4.3: This package is discontinued. Use lodash.includes@^4.0.0. npm WARN deprecated node-uuid@1.4.7: use uuid module instead npm WARN prefer global coffee-script@1.10.0 should be installed with -g

theobat commented 7 years ago

EDIT: My bad, , I forgot to reinstall the dependencies ... :face_with_head_bandage: completely unrelated, just me being stupid...

haadcode commented 7 years ago

Thanks for reporting this @rsynnest. Not sure what's going on here, the logs don't tell much. Could you run it with LOG=debug npm run electron and drop the output here?

[ERROR] orbit-electron: TypeError: IpfsDaemon is not a constructor

@theobat This sounds like dependency conflict. The interface for IpfsDaemon was indeed changed, see https://github.com/haadcode/ipfs-daemon. So what I take from this report is that there's an old version of ipfs-daemon there and it's trying to use that.

rsynnest commented 7 years ago

I've pasted stdout logs below after running LOG=debug npm run electron (npm-debug.log was unchanged). The core issue seems to be the following on starting the ipfs daemon:

Inconsistency detected by ld.so: dl-close.c: 762: _dl_close: Assertion `map->l_init_called' failed!

So, looks like an error in glibc dynamic linking? My glibc version is glibc 2.19-18+deb8u6 , not sure if this is an issue in go-ipfs implementation or machine specific issue while building go-ipfs? Full stdout error logs below:

> orbit@3.2.0 electron /home/rsynnest/src/orbit
> LOG=debug IPFS_FD_MAX=4096 $(npm bin)/electron .

2016-12-07T17:48:09.107Z [DEBUG] orbit-electron: Run index.js in 'debug' mode
2016-12-07T17:48:09.924Z [DEBUG] orbit-electron: Received 'disconnected' event from renderer process
2016-12-07T17:48:23.466Z [DEBUG] orbit-electron: Received 'ipfs-daemon-start' event from renderer process
2016-12-07T17:48:23.470Z [DEBUG] ipfs-daemon: Initializing IPFS daemon
2016-12-07T17:48:23.470Z [DEBUG] ipfs-daemon: Using IPFS repo at '/home/rsynnest/.config/orbit'
2016-12-07T17:48:24.065Z [DEBUG] ipfs-daemon: Starting IPFS daemon
Inconsistency detected by ld.so: dl-close.c: 762: _dl_close: Assertion `map->l_init_called' failed!

npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "/home/rsynnest/.nvm/versions/node/v7.2.1/bin/node" "/home/rsynnest/.nvm/versions/node/v7.2.1/bin/npm" "run" "electron"
npm ERR! node v7.2.1
npm ERR! npm  v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! orbit@3.2.0 electron: `LOG=debug IPFS_FD_MAX=4096 $(npm bin)/electron .`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the orbit@3.2.0 electron script 'LOG=debug IPFS_FD_MAX=4096 $(npm bin)/electron .'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the orbit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     LOG=debug IPFS_FD_MAX=4096 $(npm bin)/electron .
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs orbit
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls orbit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/rsynnest/src/orbit/npm-debug.log
haadcode commented 7 years ago

Thank you @rsynnest, this helps a lot! :)

That said, I have no idea what this is about. Seems like it happens when starting the IPFS daemon. I see you're using node 7, could you give it a try with 6 and see if it occurs with that too?

Inconsistency detected by ld.so: dl-close.c: 762: _dl_close: Assertion `map->l_init_called' failed!

@whyrusleeping does that tell you anything? @dignifiedquire could this be related to compiling crypto on Linux?

rsynnest commented 7 years ago

@haadcode Both node 6.0.0 and node 6.9.2 give the exact same errors as pasted above. I'm also able to reproduce this on another machine that is also running Debian 8 Jessie (kernel version 3.16.0-4-amd64.

haadcode commented 7 years ago

ok. thanks for trying that. will need to investigate.

rsynnest commented 7 years ago

Small update: I am able to install and run Orbit on Arch Linux. I installed everything using the exact same methods (installed go-ipfs from source). Here are some version numbers for various tools that might affect build:

Arch go 1.7.4 gcc 6.2.1 glibc 2.24 ipfs 0.4.5-pre1

Debian go 1.7.4 gcc 4.9.2 glibc 2.19 ipfs v0.4.5-dev

Regarding the ipfs version, I'm unsure if this is just a different name for the same version or if there is some minor version difference even though I installed from the same source. Even if I install using ipfs-update install v0.4.5-pre1 on Debian, the resulting ipfs version is still listed as v0.4.5-dev.

rsynnest commented 7 years ago

Ok, so I installed gcc-6 on Debian Jessie using the Debian Stretch repositories, and then reinstalled Orbit (a simple npm install) and Orbit now runs without erroring out. I'm not sure if the rebuild is necessary or if it's just needed at runtime, but either way it seems users will need a minimum non-standard gcc as part of the Orbit build process. I haven't dived too far into the npm dependency rabbit hole, but my best guess is the ipfs-daemon package is the one that needs gcc since that appears to be what was calling runtime libraries and failing when built using gcc 4.9.

Newer gcc versions will be standard on most modern distros soon, and Orbit/IPFS are ahead of the curve so shooting for future release makes sense.

Standard gcc versions listed below. Debian Jessie: gcc 4.9 RHEL7: gcc 4.8 Ubuntu 16.04 LTS: gcc 5.3+ Debian Stretch: gcc 6.2.1 OSX (listed because it seems lots of people use it): Uses Clang not gcc. Unsure of the Clang equivalent to gcc 6.

Steps to reproduce: try installing orbit on Debian Jessie (which comes with gcc 4.9.2 by default) Fix: Install gcc-6 (lower version may work, I suspect gcc 5.3+ will work but haven't tested) Recommended action: add a minimum gcc version dependency to documentation ?

haadcode commented 7 years ago

Thank you @rsynnest for the excellent work on figuring this out! We should absolutely add it to the README. Would you like to PR it?

I suspect this is related to ipfs that ipfs-daemon pulls in, and most likely the new crypto and its build process. @dignifiedquire @diasdavid we should try to reproduce this with js-ipfs or js-ipfs-api and see if it's the same result, and if so, we should make the same notes in the READMEs regarding the required gcc version.

haadcode commented 7 years ago

This was fixed by adding the gcc versions to the readme in orbit-web: https://github.com/orbitdb/orbit-electron/pull/2.