Dynamic Languages (Node.JS, Python, PHP, C/C++, Webserver Agent)

cancel
Showing results for 
Search instead for 
Did you mean: 

Node.js agent wont connect to controller

Explorer

Node.js agent wont connect to controller

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?

 

Node.js agent wont connect to controller
17 REPLIES 17
AppDynamics Team

Re: Node.js agent wont connect to controller

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

Thanks,
Kyle Furlong, Technical Lead (C++ and Dynamic Languages)




Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.
Explorer

Re: Node.js agent wont connect to controller

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 ]
AppDynamics Team

Re: Node.js agent wont connect to controller

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

Thanks,
Kyle Furlong, Technical Lead (C++ and Dynamic Languages)




Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.
Highlighted
Explorer

Re: Node.js agent wont connect to controller

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?

AppDynamics Team

Re: Node.js agent wont connect to controller

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

Thanks,
Kyle Furlong, Technical Lead (C++ and Dynamic Languages)




Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.
Explorer

Re: Node.js agent wont connect to controller

I still see the same error after running chmodding appdynamics* to 755.

AppDynamics Team

Re: Node.js agent wont connect to controller

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

Thanks,
Kyle Furlong, Technical Lead (C++ and Dynamic Languages)




Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.
Explorer

Re: Node.js agent wont connect to controller

-rwxr-xr-x    1 root     root          6083 Aug 15 23:22 /usr/src/app/node_modules/appdynamics-proxy/proxy/runProxy
Explorer

Re: Node.js agent wont connect to controller

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?