I am unable to connect NodeJS with Mysql on my private cloud.

Not applicable

I am able to connect on the cloud version of Apigee, but I tried to download the same proxy and upload in the Private cloud but it is not working thier. The following error is received:

{"fault":{"faultstring":"Script execution failed: Cannot enqueue Handshake after fatal error.: at \/organization\/environment\/api\/logindatavalidation.js:16\n at domain.js:183\n at \/organization\/environment\/api\/node_modules\/mysql\/lib\/protocol\/sequences\/Sequence.js:96\n at \/organization\/environment\/api\/node_modules\/mysql\/lib\/protocol\/Protocol.js:226\n at _tickDomainCallback (trireme.js:491)\n at _tickFromSpinner (trireme.js:422)\n","detail":{"errorcode":"scripts.node.runtime.ScriptExecutionError"}}}

1 3 718
3 REPLIES 3

Former Community Member
Not applicable

Hi @Sonali Morey where is your MySQL DB hosted? Externally or within your DC? Just wondering if any network ports are blocked to reach out to the DB from your DC. Have you tried invoking the DB directly outside of Apigee Edge?

Hi Prithpal I tried to connect the DB from Java and its working. I am facing the problem while connecting through Node Js. Could it be some issue related to Node Js version or something?

@Sonali Morey,

Are you saying that if you try to connect to the same database using Java from within your private cloud setup, it works fine ?

I Would like to suggest you to do the following:

a) Add the following piece of code in the NodeJS script, where you try to do the connection with MySQL. This might give more information on what's the cause for the error.

  if (err.fatal) {
    console.trace('fatal error: ' + err.message);
  }

b) There exists a file nodejs.properties which contains properties specific to NodeJS proxies within Edge. Compare the nodejs.properties file in public cloud and private cloud setups and see if there are any differences. In private cloud, it exists under /opt/apigee4/conf/apigee/message-processor folder.

You may not have access to nodejs.properties in public cloud. Do let me know the cloud org name, I can do the comparison, if you can share your private cloud nodejs.properties file.

c) Check for the properties such as allowed ports, allowed IP ranges, timeout values in nodejs.properties if there's anything that needs to be modified to allow you to connect to the database IP/Port.

Regards,

Amar