Calling LDAP server in GAE Flex Node throws 'getaddrinfo ENOTFOUND at GetAddrInfoReqWrap.onlookup' error

Viewed 4288

I am using ldapjs package for ldap authentication in my nodejs application which is deployed on google cloud app engine flexible environment.

The code is working fine when I run in my local machine. But it is failing on GCP.

var ldap = require('ldapjs');

var client = ldap.createClient({
    url: 'ldap://ldap.abc.com'
});

var opts = {
    filter: '(alias='+username+')',
    scope: 'sub'
};

This code is working when I run in my local machine. This application is deployed on GCP App Engine using flex environment. I am getting the below error when I run this code from google cloud environment.

Error: getaddrinfo ENOTFOUND ldap.abc.com ldap.abc.com:389 at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26)
0 Answers
Related