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

cancel
Showing results for 
Search instead for 
Did you mean: 

Node JS Agent :: Module did not self register error

Node JS Agent :: Module did not self register error

Environment::

AppDynamics Controller version 4.3.1

Node js agent 4.2.15 (latest)

 

 

first issue i had was 403 when i try to install appdynamics i have followed this article

https://community.appdynamics.com/t5/Archive/403-on-npm-install/m-p/21222 to download and install appDynamics npm package. 

 

 

my npm version is 7.6. and i have spoofed 

user-agent=npm/3.7.3 node/v0.10.41 linux x64 to bypass appdynamics restriction per the article outlined.

 

now after adding code with parameters specific to our environment in server.js

require("appdynamics").profile({
  controllerHostName: '<controller host name>',
  controllerPort: <controller port number>, 
  controllerSslEnabled: false,  // Set to true if controllerPort is SSL
  accountName: '<AppDynamics_account_name>',
  accountAccessKey: '<AppDynamics_account_key>', //required
  applicationName: 'your_app_name',
  tierName: 'choose_a_tier_name', 
  nodeName: 'choose_a_node_name', 
 }); 

 now i receive below error, 

module.js:598

   return process.dlopen(module, path._makeLong(filename));

                  ^

 

Error: Module did not self-register.

     at Object.Module._extensions..node (module.js:598:18)

     at Module.load (module.js:503:32)

     at tryModuleLoad (module.js:466:12)

     at Function.Module._load (module.js:458:3)

     at Module.require (module.js:513:17)

     at require (internal/module.js:11:18)

     at requireProtobufBinding (/usr/src/app/api/node_modules/appdynamics-protobuf/index.js:29:11)

     at Object.<anonymous> (/usr/src/app/api/node_modules/appdynamics-protobuf/index.js:33:18)

     at Module._compile (module.js:569:30)

     at Object.Module._extensions..js (module.js:580:10)

 

 

 

Tags (2)
Node JS Agent :: Module did not self register error
9 REPLIES 9
Employee

Re: Node JS Agent :: Module did not self register error

Hi Shivakumar,

 

AppDynamics Node.JS agent has native dependencies, hence, spoofing the user agent to get appdynamics will not suffice the agent installation. 

 

As per your spoofed user agent, ou downloaded the appdynamics package for Node.JS 0.10.41, hence its not working.

 

Since you have a 4.3 controller, could you try installing by using the appdynamics package by the command 

 

npm install appdynamics@4.3

 

Please revert to the original useragent before installing. Please also make sure to have the appdynamics profile block to be the first line in the script.

 

Thanks

Ayush

 

Re: Node JS Agent :: Module did not self register error

ok great! it installed after resetting node agent... 

now when i start my app i receive below error...

 

invalid ELF header

 

fsi-express-api_1     | module.js:598

fsi-express-api_1     |   return process.dlopen(module, path._makeLong(filename));

fsi-express-api_1     |                  ^

fsi-express-api_1     |

fsi-express-api_1     | Error: /usr/src/app/api/node_modules/appdynamics-protobuf/build/Release/protobuf_for_node.node: invalid ELF header

fsi-express-api_1     |     at Object.Module._extensions..node (module.js:598:18)

fsi-express-api_1     |     at Module.load (module.js:503:32)

fsi-express-api_1     |     at tryModuleLoad (module.js:466:12)

fsi-express-api_1     |     at Function.Module._load (module.js:458:3)

fsi-express-api_1     |     at Module.require (module.js:513:17)

fsi-express-api_1     |     at require (internal/module.js:11:18)

fsi-express-api_1     |     at tryRequire (/usr/src/app/api/node_modules/appdynamics-protobuf/index.js:15:11)

fsi-express-api_1     |     at requireProtobufBinding (/usr/src/app/api/node_modules/appdynamics-protobuf/index.js:23:18)

fsi-express-api_1     |     at Object.<anonymous> (/usr/src/app/api/node_modules/appdynamics-protobuf/index.js:33:18)

fsi-express-api_1     |     at Module._compile (module.js:569:30)

Re: Node JS Agent :: Module did not self register error

actually for node v 8.1.3 the same step is not working,

i was using a older version of Node. (7.6) sorry for not doing this upfront

 

 

9801a79322d3:api snc003$ npm install appdynamics@4.3

npm ERR! code E403

npm ERR! 403 Forbidden: appdynamics-zmq@http://packages.appdynamics.com/nodejs/4.3.4.0/appdynamics-zmq.tgz

 

tried with 4.3.1

9801a79322d3:api snc003$ npm install appdynamics@4.3.1

npm ERR! code E403

npm ERR! 403 Forbidden: appdynamics-zmq@http://packages.appdynamics.com/nodejs/4.3.1.1/appdynamics-zmq.tgz

Employee

Re: Node JS Agent :: Module did not self register error

Hi Shiva,

 

Right now Node.JS version 8.x is not supported. It should be out in coming weeks. 

 

Rightnow you can use the agent for any Node.JS version 7.x.

 

Thanks

Ayush

Highlighted

Re: Node JS Agent :: Module did not self register error

Thanks for the feedback, i am gonna downgrade to 7.10 and use Node js agent

Employee

Re: Node JS Agent :: Module did not self register error

HI Shiva,

 

Please let us know if you still face issue.

 

Thanks

Ayush

Re: Node JS Agent :: Module did not self register error

i was able to resolve the issue in local Mac and local Docker file(Development Environment -Alpine with glibc), but i receive 403 forbidden in (AWS)Deployed environmet (Docker - (Node 7.10.1 -Alpine Linux with glibc)...

the command appdynamics@4.3.4 works in local Mac and local Docker file but does not in AWS Deployed environment ..

Host machine is RHEL EC2 instance

 i have downloaded appdynamics npm modules from Local Docker file and using that as a workaround to get going in deployed environment

Employee

Re: Node JS Agent :: Module did not self register error

Hi Shiva,

 

As we have discussed in earlier tickets, that the Node.JS agent has native dependencies thus when installed it gets the compatible package from our repository.

 

It seems that your Node.JS environment in AWS is different from the one in local. Otherwise the agent download/install should work seamlessly.

 

Could you please confirm the same by checking the npm user agent config from both the local docker & the one running in AWS.

 

Here is the command to check the same.

 

 

npm config get user-agent

 

Thanks

Ayush

Re: Node JS Agent :: Module did not self register error

Thank you for your quick reply! It does help me a lot!

____________

JSON Formatter