Skip to content

Troubleshooting & FAQ

Kaicheng(Kevin) Yang edited this page Sep 30, 2021 · 14 revisions

Troubleshooting & FAQ

No module named 'tweepy.error'

If you encounter the following error

ModuleNotFoundError: No module named 'tweepy.error'

it probably means you installed Tweepy v4.0.0 or above and it's not back compatible.

To fix the issue, please downgrade Tweepy to earlier versions such as v3.10.0.

Rate limit issues

If you have trouble querying more than 17,280 accounts per day with the Ultra plan, it might be because you are using the default user authentication. Please refer to https://github.com/IUNetSci/botometer-python#authentication for instruction on how to switch to app authentication.

Script Errors

AttributeError: module 'botometer' has no attribute 'Botometer'

Your script is probably named botometer.py and it's importing itself instead of the botometer module. Give your script a different name and try again.

Account Errors

If you are scanning screen names from a list and storing the results, you should also have a way of handling and storing these errors.

NoTimelineError

Botometer raises this error when attempting to classify an account with no tweets in its timeline. The backend Botometer service won't return bot scores without any tweets in the timeline -- there's too little data to make a judgement.

401 Not Authorized or 404 Not Found

These errors are raised when an account sets their profile to private, or if the account has been deleted or suspended.

HTTP Errors

403 Client Error

If you are having the following error message:

requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://botometer-pro.p.rapidapi.com/2/check_account.

It probably means you haven't subscribe to the Botometer-Pro API yet. Rapid API visually allows you to see your rapidAPI key without subscribing to any of the Botometer plans (from the "Endpoints" page), users can copy and paste their rapid API key into their own code attempting to utilize the botometer-python package (likely based on the "Quick Start" instructions) prior to subscribing. However, if you have not yet subscribed to any plan, you will trigger the 403 error.

The solution is to go to the Endpoints page (after creating a RapidAPI account), clicking Subscribe to Test, and then selecting whatever plan the user prefers.

429 Too Many Requests

Twitter's REST API limits users to 180 requests per 15-minute window; Botometer uses this rate limit as well. As with Twitter's REST API, responses from Botometer include the X-Rate-Limit-Limit, X-Rate-Limit-Remaining, and X-Rate-Limit-Reset headers.

Meanwhile, we have a 1 request/second limit on the BASIC plan on RapidAPI. So you may also experiencing 429 errors by exceeding this limit. To fix it, please add a 1s delay between your requests.

If you would like Botometer access without rate limits, contact us about our commercial offerings. You must have access to Twitter data beyond the public REST API in order for increasted BoN rate limits to be useful.

500 Internal Server Error

9 times out of 10 this error happens because you're missing something the backend code is looking for in the request body. Make sure the following are true:

  1. The body of your POST request is a JSON string and not form-data
  2. The content field of the request object is an array of tweet objects, each of which contain their user objects (this is how they usually come from Twitter)
  3. The user_id and screen_name are provided in the meta object and they refer to the user whose timeline is being analyzed

502 Bad Gateway

This is often due to an issue at the ISP level. We've seen this with requests coming from certain countries; if possible, try the request with a server or proxy located in the US and see if it works.

503 Service Unavailable

This error happens when our web server is not forwarding requests to the Botometer service. This error most often occurs when we are pushing an update to the backend code, but sometimes happens when the service is over capacity. In either case, wait 60 seconds and try again. Updates may take up to 5 minutes to complete, so be patient if you see this error.

504 Gateway Timeout

This seems to happen on the rare occasion that Mashape is having issues and is timing out. Not much can be done here besides retrying the request.

Other Errors

tweepy.error.TweepError: 'Bad Authentication data.'

As discussed in an issue, this is due to an issue with your Twitter API keys (not Mashape). Check carefully for typos introduced by copy-pasting. You can troubleshoot your Twitter API connection with the Tweepy API object property: bom.twitter_api. Try something like bom.twitter_api.verify_credentials().

Clone this wiki locally