Support Questions

Find answers, ask questions, and share your expertise
Announcements
Welcome to the upgraded Community! Read this blog to see What’s New!

NIFI Gettwitter HTTP_ERROR: HTTP/1.1 401 authorization Requiered. will attempt to reconnect. ?

avatar
New Contributor

I correctly configured the processor in NIFI with the consumer secrte, token ..... etc. from tiwtter apps that i've created.. and i'm connected to internet, Firewalls are down but i always have the error HTTP_ERROR: HTTP/1.1 401 authorization Requiered. will attempt to reconnect.

and i cant strem any data from twitter. Please help me to solve this issue.

Thanks

1 ACCEPTED SOLUTION

avatar
Mentor

1832-untitled.png

did you create a Twitter application as the guidelines of Twitter api request? You also need Access Token and Access Secret. link @Malek Ben Salem

View solution in original post

26 REPLIES 26

avatar
Mentor

1832-untitled.png

did you create a Twitter application as the guidelines of Twitter api request? You also need Access Token and Access Secret. link @Malek Ben Salem

avatar
Mentor

I reproduced the error and confirm my suspiscion, it has nothing to do with networking and everything to do with setting proper Twitter credentials. @Malek Ben Salem the only one thing I did was pick for property Twitter Endpoint called Firehose Endpoint and then you enter valid properties from the table above

1862-401.png

avatar
Explorer

Hi, I am having the same problem, and I tried regenerating the keys and token also deleting the Twitter App and re-creating it. Still getting same error. HTTP_ERROR: HTTP/1.1 401 authorization Required. will attempt to reconnect. ? After few attempts the processor stops running by final error as "STOPPED BY ERRORL Retries exhausted due to null. Will not attempt to reconnect"

Please helps

avatar
Mentor

@Akthar Abdulbari you need to copy and paste the four properties from the twitter app exactly, making sure you dont have any empty spaces or funny characters.

avatar
Explorer

Thanks @Artem Ervits, for the quick reach. I did tried coping pasting several times, making sure I dint miss out on anything. I even tried coping it to Notepad and then coping it back to Nifi. Still no luck.

avatar
Explorer

Here is the log that I got from nifi-app.log 2016-02-19 17:54:54,015 WARN [hosebird-client-io-thread-0] com.twitter.hbc.httpclient.ClientBase GetTwitter[id=ba6e756b-3f65-4fce-b551-8b2e7cef9864] Error connecting w/ status code - 401, reason - Authorization Required 2016-02-19 17:55:35,983 ERROR [Timer-Driven Process Thread-2] o.a.nifi.processors.twitter.GetTwitter GetTwitter[id=ba6e756b-3f65-4fce-b551-8b2e7cef9864] Received error HTTP_ERROR: HTTP/1.1 401 Authorization Required. Will attempt to reconnect

2016-02-19 17:55:36,225 INFO [NiFi Web Server-62] o.a.n.c.s.TimerDrivenSchedulingAgent Stopped scheduling GetTwitter[id=ba6e756b-3f65-4fce-b551-8b2e7cef9864] to run 2016-02-19 17:55:36,230 INFO [pool-26-thread-2] com.twitter.hbc.httpclient.ClientBase GetTwitter[id=ba6e756b-3f65-4fce-b551-8b2e7cef9864] exit event - Stopped by user: waiting for 5000 ms 2016-02-19 17:55:36,735 INFO [Flow Service Tasks Thread-2] o.a.nifi.controller.StandardFlowService Saved flow controller org.apache.nifi.controller.FlowController@11fcf772 // Another save pending = fals

avatar
Mentor

@Akthar Abdulbari regenerate your keys in your twitter app like the other person did

avatar
Explorer

@Akthar Abdulbari, did you manage to get past this issue? I'm having the same problem and regenerating the keys does not solve it. I've posted a reply above with a link to my experience.

avatar
Explorer

@Mustafa El-badry's reply about updating the clock in the sandbox solved my problem. Thanks.

avatar

If you are using the sandbox on virtualbox, you'll need to add the Nifi port for port forwarding. 2016-02-05-11-52-14.png

avatar
New Contributor

Nifi Port is already forwarded

avatar

@Malek Ben Salem was this resolved? If so, please either accept an answer or post the solution. Thanks!

avatar
Explorer

@Scott Shaw, while this appears it may have been resolved for some in this discussion, I have regenerated my keys, tokens, secrets multiple times and cannot get past this error. I'm working in an HDP 2.3 Sandbox, trying to complete the Single View Demo lab. Any other ideas would be greatly appreciated. You can observe my attempts in this short video.

I'm happy to provide logs, or perform any other small tests as directed.

Thanks.

- brian

avatar

avatar
New Contributor

Hi neeaj

Thank you for the link, it's the material that i use.

avatar

@Akthar Abdulbari

com.twitter.hbc.httpclient.ClientBase GetTwitter[id=ba6e756b-3f65-4fce-b551-8b2e7cef9864] Error connecting w/ status code - 401, reason - Authorization Required 2016-02-19 17:55:35,983 ERROR [Timer-Driven Process Thread-2] o.a.nifi.processors.twitter.GetTwitter GetTwitter[id=ba6e756b-3f65-4fce-b551-8b2e7cef9864] Received error HTTP_ERROR: HTTP/1.1 401 Authorization Required. Will attempt to reconnect

Follow the above article

avatar
New Contributor

Thank you very much

It worked, i think the problem was my twitter app, i regenerate the keys and token and reconfigured the Processor "GetTwitter" and now it's working.

Thank you all

avatar

@Malek Ben Salem nice !

Glad it worked out.

Search function is really good in HCC

avatar
Explorer

@Neeraj Sabharwal, I did follow the article above, and still got the same error.

2244-81j2t.png

Only change is I am using JAVA_HOME as export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk.x86_64/jre as to in the article it was export JAVA_HOME=/usr/jdk64/jdk1.8.0_60/jre/

anything else I am missing, please let me know.

avatar
Explorer

Thanks for your help, after regenerating both Consumer Key and Access Token and my Host PC date was 2 min off, updated that as well. After all the changes, nifi is working.

Thanks again @Neeraj Sabharwal and @Artem Ervits.

Labels