Wednesday, 10 May 2017

rally node sdk giving back Error: getaddrinfo ENOTFOUND

I keep getting the following error response from node when trying to run a read call to rally:

Error: getaddrinfo ENOTFOUND rally1.rallydev.com rally1.rallydev.com:443

I am using the Rally Node SDK, and node v7. I am on a local machine. It is successfully reaching and logging the 'releaseoid' before the 'try'.

I feel like I am not specifying http (which I was before and now completely commented out the server, letting the SDK default it). But it is continuing to give back that error. I could not find (or possibly understand) other general Node guidance that may address this situation. I am not clear where port 443 is coming from as I am not specifying it. Is the SDK adding it?

I am new to Node and not sure if I am having a problem with Node or the Rally Node SDK.

Code below.

    var rally = require('rally');

var rallyApi = rally({
  apiKey: 'xx',
  apiVersion: 'v2.0',
  //server: 'rally1.rallydev.com',
  requestOptions: {
    headers: {
      'X-RallyIntegrationName' : 'Gather release information after webhook',
      'X-RallyIntegrationVendor' : 'XX',
      'X-RallyIntegrationVersion' : '0.9'
    }
  }
});


// exports.getReleaseDetails = function(releaseoid, result) {
//   console.log('get release details being successfully called');
//
//
//
// }

module.exports = {
  getReleaseDetails: async(releaseoid) => {
   console.log(releaseoid); 
    try {
      let res = await
      rallyApi.get({
        ref: 'release/' + releaseoid,
        fetch: [
          'Name',
          'Notes',
          'Release Date'
        ]
        //requestOptions: {}
      });
      res = await res;
      console.log(res);
    } catch(e) {
      console.error('something went wrong');
      console.log(e);
    }
  }
}



via Max

No comments:

Post a Comment