Hi everyone,
I have been trying to get the node.js agent (v4.3.6) to connect to our company's test SaaS controller from within an alpine linux (v3.4) docker container. I keep getting proxy errors (please see attached file).
Any ideas around how can I debug this issue?
Hi Sayak,
Could you please try adding libagent: true to your profile settings block and restart the process? If it still does not work, please send over the new logs.
Regards,
Kyle
Now the container crashes right after it starts:
/usr/src/app # npm start > ol-build@1.0.0 start /usr/src/app > node server.js Segmentation fault npm ERR! code ELIFECYCLE npm ERR! errno 139 npm ERR! ol-build@1.0.0 start: `node server.js` npm ERR! Exit status 139 npm ERR! npm ERR! Failed at the ol-build@1.0.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2017-10-05T16_08_45_307Z-debug.log /usr/src/app # cat /root/.npm/_logs/2017-10-05T16_08_45_307Z-debug.log 0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ] 2 info using npm@5.4.2 3 info using node@v8.6.0 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle ol-build@1.0.0~prestart: ol-build@1.0.0 6 info lifecycle ol-build@1.0.0~start: ol-build@1.0.0 7 verbose lifecycle ol-build@1.0.0~start: unsafe-perm in lifecycle true 8 verbose lifecycle ol-build@1.0.0~start: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/usr/src/app/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 9 verbose lifecycle ol-build@1.0.0~start: CWD: /usr/src/app 10 silly lifecycle ol-build@1.0.0~start: Args: [ '-c', 'node server.js' ] 11 silly lifecycle ol-build@1.0.0~start: Returned: code: 139 signal: null 12 info lifecycle ol-build@1.0.0~start: Failed to exec start script 13 verbose stack Error: ol-build@1.0.0 start: `node server.js` 13 verbose stack Exit status 139 13 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16) 13 verbose stack at emitTwo (events.js:125:13) 13 verbose stack at EventEmitter.emit (events.js:213:7) 13 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at emitTwo (events.js:125:13) 13 verbose stack at ChildProcess.emit (events.js:213:7) 13 verbose stack at maybeClose (internal/child_process.js:927:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) 14 verbose pkgid ol-build@1.0.0 15 verbose cwd /usr/src/app 16 verbose Linux 4.9.31-moby 17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start" 18 verbose node v8.6.0 19 verbose npm v5.4.2 20 error code ELIFECYCLE 21 error errno 139 22 error ol-build@1.0.0 start: `node server.js` 22 error Exit status 139 23 error Failed at the ol-build@1.0.0 start script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 139, true ]
Hi Sayak,
I was afraid of that. Unfortunately right now we don't have solid support for Alpine linux, due to their use of muslc instead of glibc. I would recommend trying out other options for your base container if possible. Others have had success with debian-slim.
Regards,
Kyle
My base image does have glibc:
apk --allow-untrusted add glibc-bin-2.25-r0.apk glibc-2.25-r0.apk
Is there a way I can perhaps, set this as the default library?
Hi Sayak,
Hmm, in that case let's try and get the non libagent mode working. The ENOENT errors typically mean there are permissions issues on the appdynamics files. If you run a chmod -R 755 node_modules/appdynamics that should clear it up. Remember to remove libagent:true and try again.
Regards,
Kyle
I still see the same error after running chmodding appdynamics* to 755.
Hi Sayak,
Could you provide the output of ls -l /usr/src/app/node_modules/appdynamics-proxy/proxy/runProxy run within the container?
Regards,
Kyle
Also, I don't know if this is the issue:
/usr/src/app # ldd --version musl libc (x86_64) Version 1.1.16 Dynamic Program Loader Usage: ldd [options] [--] pathname
Perhaps if i can set glibc as default, it may solve the problem?
-rwxr-xr-x 1 root root 6083 Aug 15 23:22 /usr/src/app/node_modules/appdynamics-proxy/proxy/runProxy
Hi Sayak,
Could you provide your Dockerfile so that I can try and reproduce this?
Regards,
Kyle
Hi Kyle,
Any luck with the issue? were you able to replicate it?
Hi Sayak,
I do apologize but I've had other committments. I will let you know as soon as I have more info to share.
Regards,
Kyle
Hi Sayak,
It looks like all this needs is the bash shell installed in the container. If you amend your Dockerfile changing this line:
apk --allow-untrusted add glibc-bin-2.25-r0.apk glibc-2.25-r0.apk curl && \
to this:
apk --allow-untrusted add glibc-bin-2.25-r0.apk glibc-2.25-r0.apk curl bash && \
All should work.
Please let me know how it goes.
Regards,
Kyle
Hi Kyle,
It still isn't able to connect to proxy. However, i am able to curl the saas controller from within the container.
Also, pl notice the crypto error in the stacktrace.
bash-4.3# node -v v8.6.0
bash-4.3# cat /tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/appd_node_agent_2017_10_18__19_01_56.log [2017-10-18 19:01:56.175] [INFO] default - NodeJS x64 runtime properties for PID 21 [2017-10-18 19:01:56.176] [INFO] default - Process command line [/usr/bin/node,/usr/src/app/server.js] [2017-10-18 19:01:56.176] [INFO] default - Full node executable path: /usr/bin/node [2017-10-18 19:01:56.177] [INFO] default - version: http_parser = 2.7.0 [2017-10-18 19:01:56.177] [INFO] default - version: node = 8.6.0 [2017-10-18 19:01:56.177] [INFO] default - version: v8 = 6.0.287.53 [2017-10-18 19:01:56.177] [INFO] default - version: uv = 1.14.1 [2017-10-18 19:01:56.177] [INFO] default - version: zlib = 1.2.11 [2017-10-18 19:01:56.177] [INFO] default - version: ares = 1.10.1-DEV [2017-10-18 19:01:56.177] [INFO] default - version: modules = 57 [2017-10-18 19:01:56.177] [INFO] default - version: nghttp2 = 1.25.0 [2017-10-18 19:01:56.177] [INFO] default - version: openssl = 1.0.2l [2017-10-18 19:01:56.177] [INFO] default - version: icu = 59.1 [2017-10-18 19:01:56.177] [INFO] default - version: unicode = 9.0 [2017-10-18 19:01:56.177] [INFO] default - version: cldr = 31.0.1 [2017-10-18 19:01:56.177] [INFO] default - version: tz = 2017b [2017-10-18 19:01:56.177] [INFO] default - feature: debug = false [2017-10-18 19:01:56.177] [INFO] default - feature: uv = true [2017-10-18 19:01:56.177] [INFO] default - feature: ipv6 = true [2017-10-18 19:01:56.177] [INFO] default - feature: tls_npn = true [2017-10-18 19:01:56.177] [INFO] default - feature: tls_alpn = true [2017-10-18 19:01:56.177] [INFO] default - feature: tls_sni = true [2017-10-18 19:01:56.177] [INFO] default - feature: tls_ocsp = true [2017-10-18 19:01:56.177] [INFO] default - feature: tls = true [2017-10-18 19:01:56.177] [INFO] default - release information: name = node [2017-10-18 19:01:56.177] [INFO] default - release information: sourceUrl = https://nodejs.org/download/release/v8.6.0/node-v8.6.0.tar.gz [2017-10-18 19:01:56.177] [INFO] default - release information: headersUrl = https://nodejs.org/download/release/v8.6.0/node-v8.6.0-headers.tar.gz [2017-10-18 19:01:56.177] [INFO] default - configuration target defaults: cflags = [2017-10-18 19:01:56.177] [INFO] default - configuration target defaults: default_configuration = Release [2017-10-18 19:01:56.177] [INFO] default - configuration target defaults: defines = [2017-10-18 19:01:56.177] [INFO] default - configuration target defaults: include_dirs = [2017-10-18 19:01:56.177] [INFO] default - configuration target defaults: libraries = [2017-10-18 19:01:56.178] [INFO] default - configuration variables: asan = 0 [2017-10-18 19:01:56.178] [INFO] default - configuration variables: coverage = false [2017-10-18 19:01:56.178] [INFO] default - configuration variables: debug_devtools = node [2017-10-18 19:01:56.178] [INFO] default - configuration variables: debug_http2 = false [2017-10-18 19:01:56.178] [INFO] default - configuration variables: debug_nghttp2 = false [2017-10-18 19:01:56.178] [INFO] default - configuration variables: force_dynamic_crt = 0 [2017-10-18 19:01:56.178] [INFO] default - configuration variables: gas_version = 2.28 [2017-10-18 19:01:56.178] [INFO] default - configuration variables: host_arch = x64 [2017-10-18 19:01:56.178] [INFO] default - configuration variables: icu_data_file = icudt59l.dat [2017-10-18 19:01:56.178] [INFO] default - configuration variables: icu_data_in = ../../deps/icu-small/source/data/in/icudt59l.dat [2017-10-18 19:01:56.178] [INFO] default - configuration variables: icu_endianness = l [2017-10-18 19:01:56.178] [INFO] default - configuration variables: icu_gyp_path = tools/icu/icu-generic.gyp [2017-10-18 19:01:56.178] [INFO] default - configuration variables: icu_locales = en,root [2017-10-18 19:01:56.178] [INFO] default - configuration variables: icu_path = deps/icu-small [2017-10-18 19:01:56.178] [INFO] default - configuration variables: icu_small = true [2017-10-18 19:01:56.178] [INFO] default - configuration variables: icu_ver_major = 59 [2017-10-18 19:01:56.178] [INFO] default - configuration variables: node_byteorder = little [2017-10-18 19:01:56.178] [INFO] default - configuration variables: node_enable_d8 = false [2017-10-18 19:01:56.178] [INFO] default - configuration variables: node_enable_v8_vtunejit = false [2017-10-18 19:01:56.178] [INFO] default - configuration variables: node_install_npm = true [2017-10-18 19:01:56.178] [INFO] default - configuration variables: node_module_version = 57 [2017-10-18 19:01:56.178] [INFO] default - configuration variables: node_no_browser_globals = false [2017-10-18 19:01:56.178] [INFO] default - configuration variables: node_prefix = /usr [2017-10-18 19:01:56.178] [INFO] default - configuration variables: node_release_urlbase = [2017-10-18 19:01:56.178] [INFO] default - configuration variables: node_shared = false [2017-10-18 19:01:56.178] [INFO] default - configuration variables: node_shared_cares = false [2017-10-18 19:01:56.178] [INFO] default - configuration variables: node_shared_http_parser = false [2017-10-18 19:01:56.178] [INFO] default - configuration variables: node_shared_libuv = false [2017-10-18 19:01:56.178] [INFO] default - configuration variables: node_shared_openssl = false [2017-10-18 19:01:56.178] [INFO] default - configuration variables: node_shared_zlib = false [2017-10-18 19:01:56.178] [INFO] default - configuration variables: node_tag = [2017-10-18 19:01:56.178] [INFO] default - configuration variables: node_use_bundled_v8 = true [2017-10-18 19:01:56.178] [INFO] default - configuration variables: node_use_dtrace = false [2017-10-18 19:01:56.179] [INFO] default - configuration variables: node_use_etw = false [2017-10-18 19:01:56.179] [INFO] default - configuration variables: node_use_lttng = false [2017-10-18 19:01:56.179] [INFO] default - configuration variables: node_use_openssl = true [2017-10-18 19:01:56.179] [INFO] default - configuration variables: node_use_perfctr = false [2017-10-18 19:01:56.179] [INFO] default - configuration variables: node_use_v8_platform = true [2017-10-18 19:01:56.180] [INFO] default - configuration variables: node_without_node_options = false [2017-10-18 19:01:56.180] [INFO] default - configuration variables: openssl_fips = [2017-10-18 19:01:56.180] [INFO] default - configuration variables: openssl_no_asm = 0 [2017-10-18 19:01:56.180] [INFO] default - configuration variables: shlib_suffix = so.57 [2017-10-18 19:01:56.180] [INFO] default - configuration variables: target_arch = x64 [2017-10-18 19:01:56.180] [INFO] default - configuration variables: uv_parent_path = /deps/uv/ [2017-10-18 19:01:56.180] [INFO] default - configuration variables: uv_use_dtrace = false [2017-10-18 19:01:56.180] [INFO] default - configuration variables: v8_enable_gdbjit = 0 [2017-10-18 19:01:56.180] [INFO] default - configuration variables: v8_enable_i18n_support = 1 [2017-10-18 19:01:56.180] [INFO] default - configuration variables: v8_enable_inspector = 1 [2017-10-18 19:01:56.180] [INFO] default - configuration variables: v8_no_strict_aliasing = 1 [2017-10-18 19:01:56.180] [INFO] default - configuration variables: v8_optimized_debug = 0 [2017-10-18 19:01:56.180] [INFO] default - configuration variables: v8_promise_internal_field_count = 1 [2017-10-18 19:01:56.180] [INFO] default - configuration variables: v8_random_seed = 0 [2017-10-18 19:01:56.180] [INFO] default - configuration variables: v8_trace_maps = 0 [2017-10-18 19:01:56.180] [INFO] default - configuration variables: v8_use_snapshot = true [2017-10-18 19:01:56.180] [INFO] default - configuration variables: want_separate_host_toolset = 0 [2017-10-18 19:01:56.181] [INFO] default - agent.proxyCtrlDir = "/tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/c" [2017-10-18 19:01:56.183] [DEBUG] default - Loaded native extention. [2017-10-18 19:01:56.192] [INFO] default - launching proxy from master node 0 [2017-10-18 19:01:56.200] [DEBUG] default - updating analytics config [2017-10-18 19:01:56.201] [INFO] default - ProcessScanner - maxSnapshotsPerPeriod: 2 [2017-10-18 19:01:56.201] [INFO] default - ProcessScanner - snapshotCountResetPeriodMS: 60000 [2017-10-18 19:01:56.201] [INFO] default - ProcessScanner - autoSnapshotDurationSeconds: 10 [2017-10-18 19:01:56.214] [DEBUG] default - found cluster module [2017-10-18 19:01:56.215] [DEBUG] default - found fs module [2017-10-18 19:01:56.216] [DEBUG] default - found http module [2017-10-18 19:01:56.216] [DEBUG] default - found https module [2017-10-18 19:01:56.217] [DEBUG] default - found net module [2017-10-18 19:01:56.422] [DEBUG] default - found aws-sdk module [2017-10-18 19:01:56.479] [ERROR] default - Uncaught exception:TypeError: The "digest" argument is required and must not be undefined [2017-10-18 19:01:56.479] [ERROR] default - uncaughtException: [2017-10-18 19:01:56.480] [ERROR] default - TypeError: The "digest" argument is required and must not be undefined at pbkdf2 (crypto.js:635:11) at Object.exports.pbkdf2Sync (crypto.js:628:10) at Object.<anonymous> (/usr/src/app/helper.js:10:18) at Module._compile (module.js:624:30) at Object.Module._extensions..js (module.js:635:10) at Module.load (module.js:545:32) at tryModuleLoad (module.js:508:12) at Function.Module._load (module.js:500:3) at Module.require (module.js:568:17) at Module.afterExecLogic (/usr/src/app/node_modules/appdynamics/lib/core/proxy.js:236:22) [2017-10-18 19:01:56.485] [INFO] default - proxyArgs = [ "-d", "/usr/src/app/node_modules/appdynamics-proxy/proxy", "-r", "/tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/r", "-j", "/usr/src/app/node_modules/appdynamics-jre/jre", "--", "/tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/c", "/tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/l", "-Dregister=false" ] [2017-10-18 19:01:56.485] [DEBUG] default - cmdLine = /usr/src/app/node_modules/appdynamics-proxy/proxy/runProxy -d /usr/src/app/node_modules/appdynamics-proxy/proxy -r /tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/r -j /usr/src/app/node_modules/appdynamics-jre/jre -- /tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/c /tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/l -Dregister=false [2017-10-18 19:01:56.488] [INFO] default - Proxy logging to: /tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/l [2017-10-18 19:01:56.488] [INFO] default - Proxy spawned! [2017-10-18 19:02:03.866] [DEBUG] default - starting control socket.. [2017-10-18 19:02:10.435] [DEBUG] default - { appName: 'MYAPP_DEV', tierName: 'myapp-ol', nodeName: 'exception-logger-0', controllerHost: 'mycompany-test.saas.appdynamics.com', controllerPort: 443, sslEnabled: true, accountName: 'mycompany-test', accountAccessKey: 'my_key', httpProxyHost: undefined, httpProxyPort: undefined, httpProxyUser: undefined, httpProxyPasswordFile: undefined, metadata: [ { name: 'Application name', value: undefined }, { name: 'Node Version', value: 'v8.6.0' }, { name: 'Exec Path', value: '/usr/bin/node' }, { name: 'NODE_ENV', value: undefined }, { name: 'Hostname', value: 'a9ae64d09f55' }, { name: 'OS type', value: 'Linux' }, { name: 'Platform', value: 'linux' }, { name: 'Architecture', value: 'x64' }, { name: 'CPU Model', value: 'Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz' }, { name: 'CPU Speed', value: 2394 }, { name: 'CPU Cores', value: 2 }, { name: 'Node arguments', value: '/usr/bin/node /usr/src/app/server.js' }, { name: 'Node PID', value: 21 }, { name: 'Module versions: http_parser', value: '2.7.0' }, { name: 'Module versions: node', value: '8.6.0' }, { name: 'Module versions: v8', value: '6.0.287.53' }, { name: 'Module versions: uv', value: '1.14.1' }, { name: 'Module versions: zlib', value: '1.2.11' }, { name: 'Module versions: ares', value: '1.10.1-DEV' }, { name: 'Module versions: modules', value: '57' }, { name: 'Module versions: nghttp2', value: '1.25.0' }, { name: 'Module versions: openssl', value: '1.0.2l' }, { name: 'Module versions: icu', value: '59.1' }, { name: 'Module versions: unicode', value: '9.0' }, { name: 'Module versions: cldr', value: '31.0.1' }, { name: 'Module versions: tz', value: '2017b' }, { name: 'AppDynamics version', value: '4.3.6.0' }, { name: 'AppDynamics options: controllerHostName', value: 'mycompany-test.saas.appdynamics.com' }, { name: 'AppDynamics options: controllerPort', value: 443 }, { name: 'AppDynamics options: controllerSslEnabled', value: true }, { name: 'AppDynamics options: accountName', value: 'mycompany-test' }, { name: 'AppDynamics options: applicationName', value: 'MYAPP_DEV' }, { name: 'AppDynamics options: tierName', value: 'myapp-ol' }, { name: 'AppDynamics options: nodeName', value: 'exception-logger' }, { name: 'AppDynamics options: debug', value: true }, { name: 'AppDynamics options: excludeAgentFromCallGraph', value: true } ] } [2017-10-18 19:02:16.243] [ERROR] default - no response on control socket [2017-10-18 19:02:17.041] [WARN] default - attempting to re-launch proxy... [2017-10-18 19:02:17.088] [INFO] default - launching proxy from master node 0 [2017-10-18 19:02:17.716] [INFO] default - proxyArgs = [ "-d", "/usr/src/app/node_modules/appdynamics-proxy/proxy", "-r", "/tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/r", "-j", "/usr/src/app/node_modules/appdynamics-jre/jre", "--", "/tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/c", "/tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/l", "-Dregister=false" ] [2017-10-18 19:02:17.718] [DEBUG] default - cmdLine = /usr/src/app/node_modules/appdynamics-proxy/proxy/runProxy -d /usr/src/app/node_modules/appdynamics-proxy/proxy -r /tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/r -j /usr/src/app/node_modules/appdynamics-jre/jre -- /tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/c /tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/l -Dregister=false [2017-10-18 19:02:19.951] [INFO] default - Proxy logging to: /tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/l [2017-10-18 19:02:20.161] [INFO] default - Proxy spawned! [2017-10-18 19:02:28.011] [ERROR] default - no response on control socket [2017-10-18 19:02:28.012] [WARN] default - attempting to re-launch proxy... [2017-10-18 19:02:28.012] [INFO] default - launching proxy from master node 0 [2017-10-18 19:02:28.021] [INFO] default - proxyArgs = [ "-d", "/usr/src/app/node_modules/appdynamics-proxy/proxy", "-r", "/tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/r", "-j", "/usr/src/app/node_modules/appdynamics-jre/jre", "--", "/tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/c", "/tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/l", "-Dregister=false" ] [2017-10-18 19:02:28.021] [DEBUG] default - cmdLine = /usr/src/app/node_modules/appdynamics-proxy/proxy/runProxy -d /usr/src/app/node_modules/appdynamics-proxy/proxy -r /tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/r -j /usr/src/app/node_modules/appdynamics-jre/jre -- /tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/c /tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/l -Dregister=false [2017-10-18 19:02:28.030] [INFO] default - Proxy logging to: /tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/l [2017-10-18 19:02:28.030] [INFO] default - Proxy spawned! [2017-10-18 19:02:39.428] [ERROR] default - no response on control socket [2017-10-18 19:02:40.552] [WARN] default - attempting to re-launch proxy... [2017-10-18 19:02:40.865] [INFO] default - launching proxy from master node 0 [2017-10-18 19:02:43.420] [INFO] default - proxyArgs = [ "-d", "/usr/src/app/node_modules/appdynamics-proxy/proxy", "-r", "/tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/r", "-j", "/usr/src/app/node_modules/appdynamics-jre/jre", "--", "/tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/c", "/tmp/appd/dc7181b4f7aacb644977e34c7a5920d3/proxy/l", "-Dregister=false" ] bash-4.3#