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

Uncaught exception reporting not available with Alpine based docker images #83

Closed
ahtik opened this issue Sep 25, 2018 · 7 comments
Closed

Comments

@ahtik
Copy link

ahtik commented Sep 25, 2018

After upgrading instana nodejs sensor to anything after 0.45, Alpine latest official Docker image fails to build the optional nodejs-sensor dependency "netlinkwrapper" and thereby Instana uncaught exception reporting feature gets disabled.

See the Dockerfiles below for a reference. Not sure if there's an easy fix to this build issue or should we assume the uncaught error reporting might stop with the 0.45+ upgrade. Latest sensor still builds good with the 8.x node-jessie image, but would be nice to keep using the Alpine image :)

###################################################
############ Dockerfile.8.12-alpine ###############
############ instana-nodejs-sensor@1.46.0 #########
###################################################
# Fails with:
# /node_modules/netlinkwrapper: ../netlink/core.h:64:28: fatal error: sys/unistd.h: No such file or directory
FROM node:8.12.0-alpine
RUN apk update && apk upgrade && apk --no-cache add bash && apk --no-cache --virtual .deps add \
    make gcc g++ python linux-headers && yarn global add node-gyp && yarn --pure-lockfile
RUN yarn add instana-nodejs-sensor@1.46.0
####################################################
############ Dockerfile.8.12-alpine-instana-1.45 ###
############ instana-nodejs-sensor@1.45.0 ##########
####################################################
# ALL OK
FROM node:8.12.0-alpine
RUN apk update && apk upgrade && apk --no-cache add bash && apk --no-cache --virtual .deps add \
    make gcc g++ python linux-headers && yarn global add node-gyp && yarn --pure-lockfile
RUN yarn add instana-nodejs-sensor@1.45.0
@basti1302
Copy link
Contributor

Hi ahtik,

the feature uncaught exception reporting was only introduced in 1.46, there was no such feature in versions < 1.46. So your question

should we assume the uncaught error reporting might stop with the 0.45+ upgrade.

is a bit misleading, there is no feature that will stop working in 1.46.

Btw, reporting uncaught exceptions is a disabled by default anyway for reasons outlined here:
https://github.com/instana/nodejs-sensor/blob/master/CONFIGURATION.md#reporting-uncaught-exceptions

So unless you have the very specific need to enable this feature, you should not worry about this.

If, on the other hand, this feature is relevant to you, you would need to find a Docker base image where the netlink library can be build on, or add a step to your Docker file that makes this possible.

The error you are seeing for the optional dependency is

fatal error: sys/unistd.h: No such file or directory

So it seems some standard C++ are missing in that Docker image.

Just a shot in the dark, but maybe add something like apk add linux-headers as a step to your Dockerfile. Maybe build-base is also required.

Kind regards

Bastian

@basti1302
Copy link
Contributor

Hi @ahtik

I dug a bit deeper, unfortunately, reporting uncaught exceptions will currently not work on Alpine, no matter which Alpine packages you add to the Dockerfile. The issue is that Alpine uses musl libc but netlink/netlinkwrapper currently only compiles with glibc, which is used by most other Linux distros. I might try to submit a patch to netlinkwrapper at some time so both glibc and musl libc are supported, but right now I can't make any promises when I get around to this or if this is possible at all.

Kind regards

Bastian

@ahtik
Copy link
Author

ahtik commented Sep 26, 2018

Hi @basti1302 Thank you very much for the fast feedback on this. This feature and build error is probably indeed less relevant today as it was recently introduced anyway.

The other build issue that was introduced with the upgrade to Node 10 and prevents cpu profiling (risingstack/v8-profiler) is possibly more relevant, I'm not yet sure how big of an effect this has on the global Instana feature-set or if it's something I could get fixed myself. I'm not opening a separate issue for this (slightly related was #19), but here are the Dockerfiles demonstrating that, maybe helps:

###################################################
############ NODE 10 ISSUE WITH JESSIE ############
###################################################

###################################################
############ Dockerfile.10.10-jessie ##############
###################################################
# risingstack/v8-profiler BUILD FAILS!
FROM node:10.10.0-jessie
RUN yarn global add node-gyp
RUN yarn add instana-nodejs-sensor@1.48.0

###################################################
############ Dockerfile.8.12-jessie ###############
###################################################
# ALL OK
FROM node:8.12.0-jessie
RUN yarn global add node-gyp
RUN yarn add instana-nodejs-sensor@1.48.0

@basti1302 basti1302 changed the title v0.45+ no longer supports uncaught exception reporting feature with Alpine Node 8.x docker image Uncaught exception reporting not available with Alpine based docker images Sep 26, 2018
@basti1302
Copy link
Contributor

Yes, I am aware of the issue around v8-profiler with Node 10. I'll look into that.

@basti1302
Copy link
Contributor

I changed the title of this one to better reflect the issue at hand.

@basti1302
Copy link
Contributor

Good news: Both CPU profiling for Node.js 10 and the uncaught exception reporting fix for Alpine were quick wins/relatively easy fixes. Version 1.49.0 has fixes for both.

@ahtik
Copy link
Author

ahtik commented Sep 27, 2018

Wonderful, thank you! Confirmed, both build issues fixed with the Node 10 Alpine, sensor v1.49.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants