Negative friends_count returned from GET user calls


#1

Including the full response, but friends_count appears to be the only incorrect part. Note that this bug occurs on both /1.1/users/lookup.json and /1.1/users/show.json, so it probably occurs no matter what retrieve mechanism is used. I’ve only ever seen the bug for this one particular user. The bug does occur every time though.

GET /1.1/users/show.json?id=2649240325 HTTP/1.1

{“id”:2649240325,“id_str”:“2649240325”,“name”:“Batuhan KATIRCI”,“screen_name”:“batuhan_katirci”,“location”:“T\u00fcrkiye”,“profile_location”:null,“description”:“dev.”,“url”:“http://t.co/HafwY3ienA",“entities”:{“url”:{“urls”:[{“url”:“http://t.co/HafwY3ienA”,“expanded_url”:“http://batuhan.org”,“display_url”:“batuhan.org”,“indices”:[0,22]}]},“description”:{“urls”:[]}},“protected”:false,“followers_count”:63664,“friends_count”:-14129,“listed_count”:22,“created_at”:"Tue Jul 15 21:08:03 +0000 2014”,“favourites_count”:198,“utc_offset”:10800,“time_zone”:“Kyiv”,“geo_enabled”:false,“verified”:false,“statuses_count”:148,“lang”:“tr”,“status”:{“created_at”:“Thu Oct 16 19:25:15 +0000 2014”,“id”:522830651473412096,“id_str”:“522830651473412096”,“text”:“Clockwork \u00fczerinden vermi\u015f oldu\u011funuz adrese mail att\u0131m, geri d\u00f6n\u00fc\u015f\u00fcn\u00fcz\u00fc bekliyorum @SMOdulleri”,“source”:"\u003ca href=“http://twitter.com” rel=“nofollow”\u003eTwitter Web Client\u003c/a\u003e",“truncated”:false,“in_reply_to_status_id”:null,“in_reply_to_status_id_str”:null,“in_reply_to_user_id”:null,“in_reply_to_user_id_str”:null,“in_reply_to_screen_name”:null,“geo”:null,“coordinates”:null,“place”:null,“contributors”:null,“retweet_count”:0,“favorite_count”:3,“entities”:{“hashtags”:[],“symbols”:[],“urls”:[],“user_mentions”:[{“screen_name”:“SMOdulleri”,“name”:“SosyalMedya \u00d6d\u00fclleri”,“id”:290808259,“id_str”:“290808259”,“indices”:[83,94]}]},“favorited”:false,“retweeted”:false,“lang”:“tr”},“contributors_enabled”:false,“is_translator”:false,“is_translation_enabled”:false,“profile_background_color”:“171514”,“profile_background_image_url”:“http://abs.twimg.com/images/themes/theme1/bg.png",“profile_background_image_url_https”:“https://abs.twimg.com/images/themes/theme1/bg.png”,“profile_background_tile”:false,“profile_image_url”:“http://pbs.twimg.com/profile_images/507808373350203392/USPytN2A_normal.jpeg”,“profile_image_url_https”:“https://pbs.twimg.com/profile_images/507808373350203392/USPytN2A_normal.jpeg”,“profile_link_color”:“ABB8C2”,“profile_sidebar_border_color”:“FFFFFF”,“profile_sidebar_fill_color”:“DDEEF6”,“profile_text_color”:“333333”,“profile_use_background_image”:false,“default_profile”:false,“default_profile_image”:false,“following”:false,“follow_request_sent”:false,"notifications”:false}


#2

Also, if you log on to https://twitter.com/batuhan_katirci it currently says that user is not following anyone.

So you might think that the correct value for the API to return is 0.

HOWEVER… if you go to https://twitter.com/batuhan_katirci/following you will see a number of accounts listed. So maybe the correct value for the API to return is non-zero?

Looks like maybe the API bug extends to the main twitter website, or the main website has a similar bug.


#3

Thanks for the report! I’ll look into it.


#4

We’ve fixed the problem for this user in particular. We’re investigating the root cause and a handful of other affected users. Thanks again for raising the issue.


#5

Hmm. I don’t see any fix. The regular twitter webpage still shows the mismatch with 0 following on https://twitter.com/batuhan_katirci and many listed on https://twitter.com/batuhan_katirci/following

And the API is now returning -14133 for him. That’s a different number now, it’s 4 more negative than earlier today. Perhaps some change was made internally that will take a while to propagate or…?


#6

It might take a short while to reach all our datacenters. Even from outside of Twitter I’m currently seeing the correct info on the profile page, and a friends_count of 84 in the API.


#7

Thanks. Looks good now here, both through the API and the standard web page.


#8

I found/hit another user with this same problem. Screen name: “kouseishio”. About 2 hours ago the API returned -1383. However it appears to be fixed now with the API now returning a more correct-looking value of 755. The main website looks normal now. (I didn’t look in time to see whether the main website was broken 2 hours ago when the API returned the bad value.)


#9

Thanks. We’re looking at the root cause of these issues.


#10

@isaach After your manual patch on my account ( @batuhan_katirci ), my timeline went crazy ( https://twitter.com/batuhan_katirci/status/525280846681751553 )

Can you fix this :slight_smile:


#11

Just in case there’s any doubt - this bug still exists, and hasn’t gone away, or seemingly diminished at all. It only occurs for a fairly small percentage of users though.


#12

Bug still exists - no change noticed in frequency.


#13

Recently, roughly 1 in every 13,000 users has this bug.