Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

InvokeHTTP errors Name or Service not known

avatar
Contributor

I am trying to get census data from census.gov API's, and when I do a GET request using the configured url, I get Name or Service not known error. I am placing the zip code from previous updateAttribute processor in the url. Also, when I just do the same url in postman, I see the response in JSON, but it doesnt work in NIFI. Please help.

10 REPLIES 10

avatar
Master Guru
@Bharath Sudharsanam

Could you please add more details like processor configs screenshot's, Flow and Rest API URL that you are trying to get response from?

avatar
Contributor

I added the details as reply. Sorry. please take a look and let me know.

avatar
Contributor

86388-properties.png

This is my Properties of InvokeHTTP. The URL is https://api.census.gov/data/1994/zbp?get=ST&for=zipcode:&{zip}&key=mykey. The Zip attribute is coming from input file that is extracted using evaluateJSONpath and updateAttribute processor before InvokeHTTP. Hope this helps.

avatar
Contributor

@ Shu - I added the details as reply. Sorry. please take a look and let me know.

avatar
Master Guru
@Bharath Sudharsanam

TO get the value of attribute we need to use `${attribute_name}` in NiFi

I am having zip attribute to the flow file,I tried with below as Remote URL in Invoke Http processor and able to get the response back

https://api.census.gov/data/1994/zbp?get=ST&for=zipcode:${zip}

Example:

Flow:

85562-flow.png

Generateflowfile configs:

85564-gff.png

Output:

[["ST","zipcode"],
["48","77058"]]

I'm not sure about this &key=mykey parameters in your shared URL. If you are not using them just exclude them from the Remote URL and run again.

avatar
Contributor

Shu, I tried now removing the key and still it throws the same error.

avatar
Master Guru
@Bharath Sudharsanam

Sure,

Invoke HTTP configs:

86399-invokehttp.png\

Template for the flow:

Save/Upload the template to your nifi instance and test it out.

211811-invokehttp.xml

-

If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.

avatar
Contributor

@Shu - The config is same as what you have given and still I get the same result. Not sure where the mistake is.

avatar
Master Guru

@Bharath Sudharsanam

Hmm, If possible please share your flow template (or) all the processors that you are using and configs screenshots of them.