Comments (12)
For anybody encountering the same issue: check your server time, if it's off by a couple of minutes the "unauthorized" message will appear. That fixed it for me.
from phirehose.
Had the same issue just now. I've regenerated the access token and restarted my VM (VirtualBox) and now it's working again. Not sure what it was..
from phirehose.
tamirvs - thanks for the reply... I regenerated my OAUTH_TOKEN and OAUTH_SECRET and I'm still not having any success.
from phirehose.
This can also happen if you try to log in with more than 1 account at once (eg: Development environment & production) or if you try to reconnect too fast (eg: bug in script that causes it to auto-reconnect).
Additionally, there's a small chance your account may be banned for some reason. If you can create a new account with new credentials and that works, then the banning would be your problem.
from phirehose.
fennb - Thanks very much for the reply. I do have another script that uses the same app account (ie. same OAUTH_TOKEN & OAUTH_SECRET) but it doesn't use phirehose and is only used when I manually take an action, so the other script is not connecting when I try to re-start my phirehose script which is continually unable to connect at this point.
The other script that uses the same account is working fine, so I don't think my account is banned, unless the account can get banned from using the services that phirehose connects to (ie streaming).
Just to be sure... I'll try making another app account and see if it solves the issue.
from phirehose.
I created a new developer app on apps.twitter.com.
From the "Keys and Access Tokens" tab I retrieved my "Consumer Key (API Key)" which I put in phirehose constant TWITTER_CONSUMER_KEY and my "Consumer Secret (API Secret)" which I put in the phirehose constant TWITTER_CONSUMER_SECRET.
Then I ran my login script to give the new app I created access to the twitter account I used to create the new app. I grabbed the oauth_token & oauth_token_secret stored from the login process and put them in the phirehose constants OAUTH_TOKEN & OAUTH_SECRET.
I'm still getting the same message as above. I even tried doing the login process with another separate twitter account and using the oauth_token & oauth_token_secret for that connection and still got the same error message above.
Any further thoughts?
from phirehose.
Hmmm, very strange indeed. There's a small chance your IP/whole account has been banned from the streaming API.
You should try connecting from a different IP address, or create an entirely new twitter account and connecting.
One of those two things theoretically should work, or the world has gone crazy :)
from phirehose.
here in the UK, the world has gone crazy :-/
PS. Using Phirehose to consume #referendum tweets, sitting at abt 70m
datapoints atm, and still going strong. All being stored on a little Dell
T110 running Turnkey Linux VM.
Next up - NLP ;-)
Too brief? Here's why! http://emailcharter.org
On 3 July 2016 at 08:06, Fenn Bailey [email protected] wrote:
Hmmm, very strange indeed. There's a small chance your IP/whole account
has been banned from the streaming API.You should try connecting from a different IP address, or create an
entirely new twitter account and connecting.One of those two things theoretically should work, or the world has gone
crazy :)—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#105 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AG0CMHoDOWJ9tPorlRhxawpm_tjAm_Ooks5qR19ZgaJpZM4JAYgO
.
from phirehose.
Well I tried another server (using the same api account) and its now working. So I guess they are blocking the IP of the server that can't connect for some reason.
Its strange though.. I'm getting responses (ie the "Unauthorized" mentioned above and shown again below) and the documentation (see far below) says that if I'm blocked I won't get any response at all. Does Phirehose output "Unauthorized" if it can't even connect to the server? It looks like the error below is the header of the response from the twitter api:
Here is the error again:
ERROR: HTTP failure 1 of 20 connecting to stream: HTTP ERROR 401: Authorization Required (<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>\n<title>Error 401 Unauthorized</title></head><body><h2>HTTP ERROR: 401</h2><p>Problem accessing '/1.1/statuses/filter.json'. Reason:<pre> Unauthorized</pre></body></html>). Sleeping for 10 seconds.
I don't know why I'd get banned. I just have the one phirehose script running and its a very simple filter for a couple keywords.
Really, I'm just banned from the streaming api... I tested and I can make calls to the REST api to do functions like retweet, favorite, tweet, etc.
Very Strange.
tc
From the https://dev.twitter.com/faq:
Being banned or blacklisted means the Twitter APIs will not respond to requests you make to them. You know if you have been blacklisted because the APIs will not respond to you at all. If this happens to you the first thing to do is stop any requests your application is making. Then see if you can reach other URLs using a command line tool like curl. If you can access other URLs but not Twitter, you should login to Twitter.com and then file a ticket with our support team. The support team will then be in contact about next steps. Twitter provides APIs for free and with no guarantees of service availability. This means we may take steps to ban or block any account, IP, or range of IPs that might be harming our ability to provide Twitter in a timely and reliable way. The best way to avoid being blacklisted is to pay attention to the remaining API requests you are allowed to make, and to handle errors appropriately. Handling errors appropriately means reducing your request frequency (throttling) or stopping requests until you can identify why the request failed. If you have sufficiently diagnosed your network connectivity and believe your IP may have been blacklisted, please post to the discussion forums.. Provide as much detail as possible about which steps you’ve taken to diagnose.
from phirehose.
Might be worth asking what's happening on the Twitter developers list.
Well, glad you worked it out!
from phirehose.
Thanks for your suggestions, which ended up helping. Here is my post over at twitter developer's forum: https://twittercommunity.com/t/being-blocked-with-unauthorized-but-only-from-one-ip/70072
Haven't received a response. Let me know if you know of a better place to post.
tc
from phirehose.
The solution mentioned by @emahieu worked for me. On centos for some reason ( yet to figure out ) clock was 5 minutes behind ( after never having that issue in years )
Running hwclock --debug ( hardware clock ) fixed the time mismatch and then twitter stream started working again.
from phirehose.
Related Issues (20)
- Why is Oauthphirehose labeled as internal? HOT 1
- Wiki Introduction missing 'level' parameter from log callback.
- fsockopen peer certificate did not match
- [Question] Can we get previous tweet using streaming API? HOT 2
- How to echo out the error response from the Twitter streaming API
- Still having issue with connections HOT 2
- Extended Tweets HOT 5
- update keywords (tags) while connected HOT 2
- count(): Parameter must be an array or an object that implements Countable HOT 1
- count(): Parameter must be an array or an object that implements Countable HOT 1
- Update Packagist? HOT 4
- Tag a new Release for PHP 7.2 support HOT 7
- Connection keeps failing once a day HOT 2
- The future of phirehose with the retiring of streaming APIs from twitter HOT 1
- Call to undefined function socket_last_error HOT 4
- Delay in stream?
- Following returns NULL
- Required parameter $params follows optional parameter $method
- api-v1 are no longer available in new apps.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phirehose.