Weird volley error Unexpected response code 200
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?).
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 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?
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.