WordPress-FluxC-Android icon indicating copy to clipboard operation
WordPress-FluxC-Android copied to clipboard

Weird volley error Unexpected response code 200

Open maxme opened this issue 8 years ago • 3 comments

When running the test ReleaseStack_MediaTestXMLRPC#testFetchMediaList, sometimes I get a weird Unexpected response code 200. This probably hides another problem issue.

org.wordpress.android.fluxc.example E/Volley: [814] BasicNetwork.performRequest: Unexpected response code 200 for http://xxx/xmlrpc.php

This might be related to the gzipped response, needs some investigation.

Things to check:

  • OkHttp Interceptors (Stetho).
  • OkHttp-Volley bridge: OkHttpStack.
  • Request and response Headers (httpd misconfigured?).

maxme avatar Apr 25 '17 16:04 maxme

Note: I can reproduce this issue with the volley HurlStack.

After some time spent debugging Volley, I've found the underlying issue is actually:

java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)

I don't know yet why this happens, but the InputStream is closed while volley is doing this loop, this leads to a IOException that generates this Unexpected response code 200 later here.

maxme avatar Apr 26 '17 08:04 maxme

@maxme I guess this means that the error is happening during the wp.uploadFile part of the test, and not the wp.getMediaLibrary part - is that right?

aforcier avatar Apr 27 '17 11:04 aforcier

I guess this means that the error is happening during the wp.uploadFile part of the test, and not the wp.getMediaLibrary part - is that right?

Nope, I can repro by calling wp.getMediaLibrary only and I can also repro in the example app by using the "Fetch first page" button.

maxme avatar Apr 27 '17 12:04 maxme