Error getaddrinfo enotfound api postman

I'm trying to send a simple GET request to a subdomain of localhost and I'm getting an error in the Postman console that Error: getaddrinfo ENOTFOUND but the URL is definitely available. I&...

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account

Assignees

@codenirvana

Comments

@matthewsommer

I’m trying to send a simple GET request to a subdomain of localhost and I’m getting an error in the Postman console that Error: getaddrinfo ENOTFOUND but the URL is definitely available. I’ve tried different combinations of including the http protocol and not including it and it doesn’t work. Testing the same subdomain for the public site works fine.

Version/App Information:

  1. Postman Version: 4.9.3
  2. App (Chrome app or Mac app): Mac app
  3. OS details: 10.12.2
  4. Is the Interceptor on and enabled in the app: No
  5. Did you encounter this recently, or has this bug always been there: Just discovered
  6. Expected behaviour: Page should load but is not loading
  7. Console logs (http://blog.getpostman.com/2014/01/27/enabling-chrome-developer-tools-inside-postman/ for the Chrome App, View->Toggle Dev Tools for the Mac app): «Error:
    getaddrinfo ENOTFOUND subdomain.localhost subdomain.localhost:8080″
  8. Screenshots (if applicable)

Steps to reproduce the problem: Send GET to subdomain.localhost:8080, no response and console reports «Error:
getaddrinfo ENOTFOUND subdomain.localhost subdomain.localhost:8080″

@vegetableman

@matthewsommer

@vegetableman, My url is absolutely valid; http://subdomain.localhost:8080 is a valid URL. Modifying the hosts file does not make sense because the hosts file is what resolves the localhost hostname to the local IP loopback address 127.0.0.1. This is most certainly a bug as there are other bugs for Postman version 4 related to not being able to resolve localhost, the difference with this bug to those tickets is that this bug is for subdomains.

@vegetableman

@matthewsommer The url is valid but you would have to map the mentioned subdomain to the loopback address 127.0.0.1 in your hosts file (127.0.0.1 subdomain.localhost). Also, you could verify whether the mapping is valid by checking the output to ping subdomain.localhost on the terminal.

@matthewsommer

@vegetableman the issue is the web application I’m testing utilizes wildcard subdomain *.localhost.com so I might be testing many different subdomains. I’ve added this to the hosts file and verified that gives me a workaround, thanks! If you aren’t considering this a bug then shouldn’t it be at least a feature request? No modern browser could get away with not resolving subdomain.localhost and Postman definitely shouldn’t either IMO.

@matthewsommer

@vegetableman, also wouldn’t this be a fairly easy fix? Just resolve *.localhost to whatever IP localhost resolves to from the host file? I suppose that wouldn’t work though if *.localhost was mapped to a different IP in the local host file

@vegetableman

@matthewsommer 👍 Tagging this as a feature request. Will keep you posted on this thread.

@matthewsommer

@vegetableman thanks brother! I love Postman and continue to sing its praises :)

@jazoom

Have the same issue. URL works in Chrome but not in Postman.

auerbachb, joseph-kaainoa, hadimansouri, ihrimech, mattcrowe, jminardi, dbettini, congcoi123, mhdismail, arwin009, and 8 more reacted with thumbs up emoji

@abhijitkane

@jazoom @matthewsommer The Postman Chrome app doesn’t do any resolving of its own — it uses Chrome’s XHR API to send the request. Can you check our native apps (https://www.getpostman.com/apps) and see if those work for you? I’m able to hit *.localhost subdomains in my Postman instance.

@jazoom

This was a long time ago but I’m pretty sure I was using the native app then. I axed the Chrome app soon after the native app was in beta.

@abhijitkane

@jazoom The app’s proxy settings (Settings > Proxy) might help. Try toggling the system proxy setting — that might be interfering with the IP lookup.

@jazoom

I only occasionally use Postman so I might not be the best person to help you debug this issue. I don’t think I even have it installed at the moment.

@joaokamun

I’m having the same problem with macOS native app.
Change to chrome extension app worked for me.

@sdnts

@jazoom @joaokamun Do you use /etc/hosts somewhere? Our native apps do not support this at the moment, but we’re tracking this in #2369
Chrome app requests are made via the Chrome browser, which is why it works.

Do you think this might be happening to you as well?

@jazoom

@madebysid I don’t now but I might have at the time I first commented above.

@joaokamun

@madebysid My /etc/hosts is the default, never changed but I’m using Docker.

@czyzu01

Interesting thing we’ve found out in our environment, when using 6.0.10 on Windows 10 uses system proxy settings, and you’ve set ENV variable for http_proxy and https_proxy, that may cause problems. Setting them to null in batch script, solved problem for us.

@a85
a85

self-assigned this

Jun 29, 2018

@chitti-cc

@a85 @madebysid is this issue got fixed? I am facing the same problem, let me know if there is a workaround.

@shanjee

I have the latest version (v6.2.4) when I run the monitor I am getting the same error.

Error: getaddrinfo ENOTFOUND xxxx.com xxx:443, but the same collection works fine in post man when i run the run, any clue ?

@listenrightmeow

This is an active problem for developers that opt into managing local DNS management with dnsmasq. I struggled to find a solution for a couple days, read this article and modified my hosts file.

Web browsers & curl honor dnsmasq networking while Postman doesn’t.

@codenirvana

We’ve added support for *.localhost lookup in the latest version of the Postman app (v7.6.0).

@emimarz

I am experimenting this issue right now, Error: getaddrinfo ENOTFOUND
if I get the curl code by the application it works but inside the app all request give me that error
and I’m not using localhost, I’m using an url that is accessible via browser

@emimarz

I download the next version and it works but I don’t know why happen that

Содержание

  1. HTTP-запрос nodejs getaddrinfo Ошибка ENOTFOUND
  2. Error: getaddrinfo ENOTFOUND undefined undefined:5432 #1086
  3. Comments
  4. Error: getaddrinfo ENOTFOUND when trying to connect to a server #745
  5. Comments

HTTP-запрос nodejs getaddrinfo Ошибка ENOTFOUND

Я пробовал много способов сделать http-запрос, но всегда получал ошибку getaddrinfo ENOTFOUND .

Среда: nodejs Поставщик: Функции Firebase

Метод 1 — запрос npm:

Метод 2 — npm jquery:

Метод 3 — npm https:

Независимо от того, каким образом консоль всегда показывает ошибку getaddrinfo ENOTFOUND :443 .

У меня действительно заканчивается идея, посоветуйте, пожалуйста.

1) Я замаскировал URL-адрес и пароль из запроса о конфиденциальности и безопасности.

2) Я внедрил промежуточное ПО для проверки авторизации. Поэтому, если открыть URL-адрес в браузере, он скажет «неавторизованный», но если я использую Postman для отправки запроса GET с заголовком «Authorization»: «Basic password» , он покажет результат API, как и ожидалось.

3) код API и код HTTP-запроса находятся на одном сервере / проекте функций firebase.

4) nodejs импортировал следующий модуль, не уверен, что это вызывает какой-то конфликт: firebase-functions , firebase-admin , jsdom , request , https , express , body-parser , cors , jquery , nodemailer

Кажется, что целевой URL не имеет https , поэтому он выдает ошибку :443 , пожалуйста, убедитесь, что URL имеет https

Согласно документации https , похоже, что Method 3 — npm https не позволяет помещать «https» в url . Но URL-адрес, который я хочу вызвать, определенно использует https, потому что его облачная функция Google.

добавьте family: 4 в параметры для Method 3 и попробуйте с модулем https и http .

также вы можете сослаться на этот URL: https://github.com/nodejs/node/issues/5436#issuecomment-3730‌​02246

Если вы просто откроете URL-адрес https://us-central1-

.cloudfunctions.net/api/wakeUp в браузере, что он сделает?

Frank van Puffelen

@FrankvanPuffelen Я внедрил промежуточное ПО для проверки авторизации. Поэтому, если открыть URL-адрес в браузере, он скажет «неавторизованный», но если я использую Postman для отправки запроса GET с заголовком «Authorization»: «Basic password» , он покажет результат API, как и ожидалось.

@FrankvanPuffelen Дополнительная информация, код API и код HTTP-запроса находятся на одном сервере / проекте функций firebase.

Источник

Error: getaddrinfo ENOTFOUND undefined undefined:5432 #1086

Below is the error am getting

Also this link https://github.com/brianc/node-postgres doesn’t seem to be passing the host/hostname to the config param
NodeJS version is 4.4.2. PostgreSQL version is 9.5.2

Looking at the error message undefined:5432 it looks like it is not finding the DB host name.

The text was updated successfully, but these errors were encountered:

don’t pass a connectionString to the client, pass the same var config as you’re passing to the pool. You might want to log out the config before you pass it to the client too. My gut is telling me the variables in your config or your CONSTANT construct are undefined

Please ignore line 5,6&7. I have commented them.
Below is my constant file contents

And when I print the config object console.log(«config : «+JSON.stringify(config)); I see the desired output in the log.

Am assuming the property key host is the culprit. Or one of the key.
This is my guess based on the error messge Error: getaddrinfo ENOTFOUND **undefined undefined:5432**

That should work if you’re using pg>=6.0.0

I have PostgreSQL 9.5.2
When I saw your above code, I was sure that I would have the same error and I did get the same error message.
Reason being, the error is thrown when we are passing the config object to pg.Pool.
So I still get the same error message.

I’m pretty sure this is related to something in your environment and not node-postgres itself. I suggest you edit the pg module source code under node_modules/pg/lib/connection.js and log out the actual parameters passed to the socket being created in there in your environment. From there, trace back where the connection parameters are turning into undefined — I’m 100% sure pg connects to postgres no problemo for me, travis, etc. so. you’ll have to do some digging on this one your own. Please come back & let me know what you find out though!

Hi @brianc . Just a quick update. When I run the test.js as a standalone Node app. It runs fine without any issues.
I have structured my REST service project using express-generator which creates a project structure for me.
Below is the package.json

So when I naviagate to that project and say nodemon or npm start the ./bin/www script gets executed. Below is the www script file

Below is my app.js file

./routes/test is the file that I have posted initially.
Sorry for the long post but just trying to make sure that I give as much information as possible.

Источник

Error: getaddrinfo ENOTFOUND when trying to connect to a server #745

I’m having a big issue with connecting to a FTP server with remote-ftp.

It looks like this:
‘Remote FTP: Connection failed
Error: getaddrinfo ENOTFOUND ftp://ftp.lumeaadidasilor.ro ftp://ftp.lumeaadidasilor.ro:21″. I couln’t find anything related to this anywhere.

It’s only happening to one hosting provider ( I tried two different shared accounts from them, same issue ).
I tried discussing it with them, but not much help. They said «Eliminate the TLS from the configuration and try again». I don’t know how I could do that or if that’s the issue.

It’s definitely some particular server configuration they have and Atom can’t get around. I didn’t have that issue anywhere else (I’ve worked with Atom on tens of servers). Also, only Atom has a problem on this provider. Connection works with other ftp clients ( FileZilla, WinSCP, Dreamweaver, web ftp etc).

If you have the time, You canreplicate the issue with this temp FTP I created.
host: ftp.lumeaadidasilor.ro
u: testftp@lumeaadidasilor.ro
p:TestingPassword123!

I hope to get this fixed, otherwise I’m forced to work with something else than Atom ( which would really suck) or ditch the host altogether (would suck less, but still quite inconvenient).

The FTP config file looks like this:

<
«protocol»: «ftp»,
«host»: «ftp://ftp.lumeaadidasilor.ro»,
«port»: 21,
«user»: «testftp@lumeaadidasilor.ro»,
«pass»: «TestingPassword123!»,
«promptForPass»: false,
«remote»: «/»,
«local»: «»,
«secure»: false,
«secureOptions»: null,
«connTimeout»: 10000,
«pasvTimeout»: 10000,
«keepalive»: 10000,
«watch»: [],
«watchTimeout»: 500
>

Thank you very much!

The text was updated successfully, but these errors were encountered:

Источник

Your achievements

0% to

Tip
/

to gain points, level up, and earn exciting badges like the new

Expand my Community achievements bar.

When trying to request Token for OAuth in Postman got this error = ‘Error: getaddrinfo ENOTFOUND ims-na1.adobelogin.com’. Any idea how to resolve this error.

1 Accepted Solution

Hi there,

This error seems to be coming due to the client ID and credentials placed while retrieving the access token. You need to make sure of the below settings:

  • Go to Postman (preferably the latest version).
  • Under «Authorization» tab, select «OAuth 2.0» as the «Type». Click on «Get New Access Token».
  • Token Name: Enter any name
  • Grant Type: Authorization Code
  • Callback URL: https://www.getpostman.com/oauth2/callback
  • Auth URL: https://ims-na1.adobelogin.com/ims/authorize/v1
  • Access Token URL: https://ims-na1.adobelogin.com/ims/token/v1
  • Client ID: Enter the Client ID captured from Adobe I/O integration details
  • Client Secret: Enter the Client Secret captured from Adobe I/O integration details
  • Scope: openid AdobeID read_organizations additional_info.projectedProductContext additional_info.job_function
  • State: can be left blank; it’s optional
  • Client Authentication: Send client credentials in body
  • Click «Request Token». Experience Cloud login prompt will appear. Sign in using Adobe ID/Federated ID (the sign-in method should be identical to the one used to sign into Adobe I/O).
  • After successful sign-in, Access Token will be generated and appear in the pop-up window. Scroll down to the bottom of the page and click «Use Token».

If you still face errors, feel free to get in touch with the client care team(clientcare@adobe.com)


  • All forum topics


  • Previous Topic

  • Next Topic

5 Replies

Hi there,

This error seems to be coming due to the client ID and credentials placed while retrieving the access token. You need to make sure of the below settings:

  • Go to Postman (preferably the latest version).
  • Under «Authorization» tab, select «OAuth 2.0» as the «Type». Click on «Get New Access Token».
  • Token Name: Enter any name
  • Grant Type: Authorization Code
  • Callback URL: https://www.getpostman.com/oauth2/callback
  • Auth URL: https://ims-na1.adobelogin.com/ims/authorize/v1
  • Access Token URL: https://ims-na1.adobelogin.com/ims/token/v1
  • Client ID: Enter the Client ID captured from Adobe I/O integration details
  • Client Secret: Enter the Client Secret captured from Adobe I/O integration details
  • Scope: openid AdobeID read_organizations additional_info.projectedProductContext additional_info.job_function
  • State: can be left blank; it’s optional
  • Client Authentication: Send client credentials in body
  • Click «Request Token». Experience Cloud login prompt will appear. Sign in using Adobe ID/Federated ID (the sign-in method should be identical to the one used to sign into Adobe I/O).
  • After successful sign-in, Access Token will be generated and appear in the pop-up window. Scroll down to the bottom of the page and click «Use Token».

If you still face errors, feel free to get in touch with the client care team(clientcare@adobe.com)

I followed above steps after Click «Request Token». Experience Cloud login prompt has appeared. I have Signed in with adobe ID succesfull. But that signed in window not closed and there is no Token generated.

Sure. The reason for that is the oAuth integration created in Adobe I/O should have https://www.getpostman.com/oauth2/callback as the «Default redirect URI» and https://www\.getpostman\.com as the «Redirect URI pattern».

AAA — Authentication and Authorization (v4)


Submitted by bdieckman on 11 April 2019 — 9:58am

Using the URL: https://printos.hp.com/api/aaa/v4/organizations/devices

I’m getting the error: «Error: getaddrinfo ENOTFOUND printos.hp.com printos.hp.com:443» from Postman

When I attempt to reach that endpoint with a browser, I get: DNS_PROBE_FINISHED_NXDOMAIN

Is DNS set up properly for this endpoint?


URL was wrong. Getting a different error now, having to do with hash.

{
    "smsError": {
        "statusCode": 401,
        "message": "Hashed message does not match (-- Only part of my API key ---)",
        "subCode": 0
    }
}

I’m using Postman. To generate the hash, I’ve set up a Pre-request Script to put the hash (and timestamp) in an environment variable, then I’m using those variables in the header.

I used the JavaScript example from the API Authentication page to write this using Crypto-js (built in to Postman):

var CryptoJS = require('crypto-js');

var key = "-- my API key --";
var secret = "-- my API secret --";

var timestamp = (new Date()).toISOString();
var toSign = "GET" + " " + "/api/partner/folder" + timestamp;
var hash = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA1, secret);
hash.update(toSign);
var sig = '' + hash.finalize();

pm.environment.set("HMACsig", key + ":" + sig);
pm.environment.set("HMACts", timestamp);

I’m not sure what to put in the «/api/partner/folder» field, so I kept the value from the example.

(CryptoJS hash.finalize(); used in a string context returns HEX the same way Crypto hash.digest(«hex»);  does.)

Any thoughts?

bdieckman

It needs to be the API endpoint you are calling «/organizations/devices» in this case.

Here’s the pre-request script I use (Key/Secret are environment variables):

var key = postman.getEnvironmentVariable("key");
var secret = postman.getEnvironmentVariable("secret");
var endpoint = "/organizations/devices";
var headers = createHeaders ("GET", endpoint );

postman.setEnvironmentVariable("hmacHeader", headers[0]);
postman.setEnvironmentVariable("timestamp", headers[1]);

function createHeaders(method, path) {
    var timestamp = (new Date()).toISOString();
    
    var toSign = method.toUpperCase() + " " + path + timestamp;
    console.log('Creating hash with string ', toSign);
    var hash = CryptoJS.HmacSHA1(toSign, secret);
    var sig = CryptoJS.enc.Hex.stringify(hash);
    var headers = [
      key + ":" + sig,
      timestamp,
      "SHA1"
    ];
    return headers;
}

cstevens

Excellent. Thank you.

After I got this message I found the GitHub repository with the Postman Environment json.

I added a couple of variables (a new empty context and an endpoint variable) and now it’s working. My complete Pre-request Script looks like this now:

var key = postman.getEnvironmentVariable("key");
var secret = postman.getEnvironmentVariable("secret");
var context = postman.getEnvironmentVariable("context");
var endpoint = postman.getEnvironmentVariable("endpoint") + context;

var headers = createHeaders ("GET", endpoint );

postman.setEnvironmentVariable("hmacHeader", headers[0]);
postman.setEnvironmentVariable("timestamp", headers[1]);

function createHeaders(method, path) {
    var timestamp = (new Date()).toISOString();
    
    var toSign = method.toUpperCase() + " " + path + timestamp;
    console.log('Creating hash with string ', toSign);
    var hash = CryptoJS.HmacSHA1(toSign, secret);
    var sig = CryptoJS.enc.Hex.stringify(hash);
    var headers = [
      key + ":" + sig,
      timestamp,
      "SHA1"
    ];
    return headers;
}

This should accommodate the AAA and Jobs requests, assuming the correct variables are checked/unchecked in the environment.

Thanks for your help!

bdieckman

Glad you got it working.  Just remember that the AAA (/organization/devices) endpoint has a different base URL than the Jobs API  (www.printos.com vs printos.api.hp.com ).   Otherwise authentication is the same.

cstevens

  • Home
  • Forum
  • DataFlex
  • Web & Mobile Applications
  • POSTMAN: getaddrinfo ENOTFOUND localdisk

Threaded View

  1. Default POSTMAN: getaddrinfo ENOTFOUND localdisk

    Hi,

    I am testing an API with POSTMAN and get an error like in the title.
    Earlier I had an underscore (_) in my workspace, but have now renamned it with no special characters, after looking in the Google for some help.

    I have a similiar API that was written earlier and that works fine. I try to do this new one as like as possible.

    What can be wrong?

    Here is the console-text:

    Regards
    Anders Hyd�n
    ADAKO — Sweden



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
  • BB code is On
  • Smilies are On
  • [IMG] code is On
  • [VIDEO] code is On
  • HTML code is Off

Forum Rules

Понравилась статья? Поделить с друзьями:
  • Error get class hints
  • Error get alias что это
  • Error get alias тильда
  • Error get alias перевод
  • Error get alias tilda ошибка