ERROR: HTTP request failed, Status: 401



I’m working on this app that is going fine on my cellphone, but is not on Android Studio’s Emulators.

After a while I start to receive this message from the API:

ERROR: HTTP request failed, Status: 401

The app starts working ok, and after some calling messages to twitter API (5 more or less), error 401 starts showing.

I’m using Android Studio with FABRIC

Could it be a problem with session? Expired maybe? Aplication works for only a minute or 2.

I am monitoring limits, and i’m far from extrapolate it, in some tests i have the error 401 with 897 X-Rate-Limit-Remaining.

Library and Fabric is updated.

I manually set the date on emulator to not have any time problems (i saw something like this on forums).

This problem is putting me crazy. I’m working for 3 months already on this app, and 2 days ago the problem started.

Please, if someone knows all about it, every tip will be blessed.



Hey @CrazyMindsGames,

Can you share the full error from Logcat that you’re seeing?



This is the stack returned from callback of one of the APIs i am using now:

W/System.err: HTTP request failed, Status: 401
W/System.err: at
W/System.err: at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$
W/System.err: at android.os.Handler.handleCallback(
W/System.err: at android.os.Handler.dispatchMessage(
W/System.err: at android.os.Looper.loop(
W/System.err: at
W/System.err: at java.lang.reflect.Method.invoke(Native Method)
W/System.err: at$
W/System.err: at

There is no other error but this.

Thank’s in advanced.


In this use case i am trying to list status from other user.

Here is the code I made the call:

    StatusesService ss = Twitter.getApiClient(Twitter.getSessionManager().getActiveSession()).getStatusesService();
    Call<List<Tweet>> callFollow = ss.userTimeline(id, null, 20 ,null,null, true,true,false,false );
    callFollow.enqueue(new Callback<List<Tweet>>()
        public void success(final Result<List<Tweet>> twits)

        public void failure(final TwitterException exception)
                    Log.d("AutomaticTwitActivity", " - StealingTwitFromTarget - ERROR: " + exception.toString()
                            + " Cause:" + exception.getCause()
                            + " LocalMessage:" + exception.getLocalizedMessage()
                            + " Message:" + exception.getMessage()
                            + " Stack:" + exception.getStackTrace().toString()
                            + " Supressed:" + exception.getSuppressed().toString()


“ss.userTimeline()” comes from StatusesService interface,;).


Thanks, I’ll try to reproduce this on Monday - much appreciated for the details!


it’s important to rebember the follow:

  • problem only occurring now on emulator;
  • is working on device;
  • problem occurs after a while;
  • no error, just 401 returns from server.

Thank you!


Hello Bonnell!

I spent the whole weekend without touching the project, i dont even ran it.
Unexpectedly it dawned on Monday working. What I mean is that my calls that were returning status 401 are no longer doing it.

Would my test account was on some kind of black list?


Hey @CrazyMindsGames,

It’s possible that you hit a rate limit, but I’m glad to hear you’re all set. I haven’t been able to reproduce this myself yet.


Hi Bonnell

I suspect too of the rate limit, but, the problem is, if it’s correct, it should give me another error. 429, right?


Yes, normally a rate limit would come through as a 429 and not a 401, so I’m a bit surprised by it.


I let my app running all the day and started to give me 401 error. With no error code explaining what happens.
Almost sure is a daily rate limit occurring here. Sadly i’m not receiving a 429 status.
Would it be a bug at twitter side?



Hey @CrazyMindsGames,

This happened on the emulator again? Also, when you mention that it was running all day - it was active and in the foreground? A 401, I did more digging, is definitely an authorization and not a rate limit issue. Can you share any Logcat output from when this happened?


Hi Bonnell,

Yesterday I had problem with the status 401 all day, on the device, the same on the emulator. With different twitter test accounts.

Today, i had no problem yet. With every account I used, and every platform(device/emulator).

it’s very wierd.


Hey @CrazyMindsGames,

I haven’t been able to reproduce this locally still? Do you have any more details to help track this down based on anything other then day?


Hi Bonnell,

This application automates small tasks. It does a kind of automatic things like pre-registered twit every 5 min (if they exist in the database), polls, likes in my updates, etc.
I suspect that at some point I set the wrong time for these small tasks, and the expected may have happened: Rate limits were crossed.

I did not find any kind of error in the logcat logs. And after a while the 401 status begins.


Hmm, I can take a look at your Twitter Consumer key and check it’s status if you email it into support(at)fabric(dot)io and reference this thread.