Level / level

Universal abstract-level database for Node.js and browsers.
MIT License
1.55k stars 106 forks source link

docker node alpine image exited with code 139 (arm32v7) #205

Closed wouterds closed 2 years ago

wouterds commented 3 years ago

Hi

I'm trying out leveldb for the first time in a project, works great on my local machine but in my docker image on my Raspberry Pi the process exits with code 139 (using arm32v7/node:14-alpine). The same code runs fine locally using node:14-alpine.

Are there any native dependencies you need to install manually first? I couldn't find much about that right away from looking through the docs and existing issues.

I've made an example repo to illustrate the problem: https://github.com/wouterds/leveldb-bug-example (just run docker-compose up to replicate)

Screenshot 2021-08-29 at 09 17 32

Update: I just noticed there's an 80MB core dump generated on the Raspberry Pi, not sure if that's any helpful → core dump

vweevers commented 3 years ago

I'm not familiar with this armv7/alpine combo. Is it using musl?

You might want to try npm i --build-from-source (in the docker container, not its host) so that the leveldown native dependency is compiled from source.

phi1ipp commented 1 year ago

Got a similar issue. I'm on apple silicon and when running locally all is good. But when I try to deploy into a docker, getting 139.

I used the approach you suggested with --build-from-source and it worked. But I wonder, is it b/c there are some libs in the dependencies which are compiled/linked against x86-64 architecture?

Thx!

vweevers commented 1 year ago

@phi1ipp Depends on the version of level (and classic-level or leveldown) that you have.

phi1ipp commented 1 year ago

@vweevers , well, when I discovered the issue with my project, which I haven't touched for half a year (last time I worked on it, it's been on MBP on Intel) I tried to bump level to the latest. That didn't help honestly. If I understand correctly, Level will be the latest (ver 8+)

But anyway, the issue is resolved with your recipe. Just wanted to let you know, what causes it to appear