-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Segmentation fault on Node 8 alpine (docker) #2031
Comments
Can you add the log to a Gist? I'm not seeing anything in the current output, besides that it failed around a Sass file, that indicates this is a node-sass issue. I'd also suggest just trying to reproduce it without webpack |
https://gist.github.com/ForsakenHarmony/3ddcfcab7e932a5a6a48094eda7854c7 I'm not quite sure what's going on, it only seems to happen in the docker build script, not if I run it inside the container may also be my code, because this doesn't crash FROM node:8-alpine
RUN mkdir -p /usr/app
WORKDIR /usr/app
RUN yarn add node-sass
ENV NODE_ENV production
RUN node -e "require('node-sass').renderSync({data: '* {height: 2px}'});" |
It does not seem to crash. Looks like a permission problem, people usually run as root inside a container, check our troubleshooting guide for info on unsafe permissions |
Segmentation fault is a type of crash to me |
I am sorry, didn't scroll that far right. Can you try to get the core file? |
Quick question, are project files copied from Debian? |
You'll need to delete your |
@saper the core file? |
probably your |
it also happens in ci |
Having exact same issue. Fails with Works fine when doing the same thing inside image from this Dockerfile (Node 6.11 + build essentials). |
Between 6 and 8, the node images changed from Alpine 3.4 to 3.6 so there may be some difference there. We did use their image to build our binaries though |
@mikestead can you run Also can you supply a minimal scss code sample the produces the segfault so we can investigate further? |
tried rebuilding in the Dockerfile, didn't change anything |
@ForsakenHarmony thanks. If a fresh local recompiled binary is still segfaulting I'm not sure what we can do. This could be an issue with Node 8 or Nan. |
FWIW I'm seeing something similar but nothing to do with I've had a node application running Anyway, something has changed and the app crashes with |
https://gist.github.com/ForsakenHarmony/7efb3659dac985a90598b869b07c7e46 this is the dockerfile I tested with, project is linked in the main post |
This was merged in August. I wonder when and where it landed? |
Different kind of fix could possibly be the following addition in your Dockerfiles. I had the same issue not using Sass. |
This has been worked around by increasing thread stack size in the libuv libary (libuv/libuv#1507) and became available in node 8. Therefore using anything older than node 8 with alpine is discouraged. |
In a nightcourse, we were asked to setup a node http server in docker. I looked up what was good for docker and found it was alpine linux so I installed that in a VM. Example 1: Example 2: I searched for a very long time and eventually I found this thread and saw the reply from @cw789 which helped. It did not explain what I should do but I pieced it together from looking at the solution and how some others patched their systems. The fix is for me to add this to my Dockerfile before npm gets called:
It also works if I add it just after: If this comment seems long and includes a lot of technical lines, it is meant to. If anyone else ends up googling the errors like I did, I hope this helps. |
Can anyone confirm whether this is still an issue with 4.8.3? |
@xzyfer I confirm, 4.8.3 cause |
* Change docker image for fixing this issue sass/node-sass#2031 * `clinet.connect()` only once * Use one variable `DATABSE_CONNECTION_STING` instead of 5 other variables * Use 3 different account to prevent [this type](qlaffont/fortnite-api#42) of error...
I still have this issue on 4.10, with node:11.1-alpine |
I get it too on node:11.2-alpine and node:11.2-slim |
using |
I was facing the same problem serving an express server. For some reason Using just |
Using |
This resolves our problem. |
Works with node 6 and on my host machine ( debian, node 8 )
this is my project, can also try to make a smaller testcase if required
https://github.com/ForsakenHarmony/portfolio
npm -v
):5.0.3
node -v
):v8.1.2
node -p process.versions
):{ http_parser: '2.7.0',
node: '8.1.2',
v8: '5.8.283.41',
uv: '1.12.0',
zlib: '1.2.11',
ares: '1.10.1-DEV',
modules: '57',
openssl: '1.0.2l',
icu: '59.1',
unicode: '9.0',
cldr: '31.0.1',
tz: '2017b' }
node -p process.platform
):linux
node -p process.arch
):x64
node -p "require('node-sass').info"
):node-sass 4.5.3 (Wrapper) [JavaScript]
libsass 3.5.0.beta.2 (Sass Compiler) [C/C++]
The text was updated successfully, but these errors were encountered: