Response with Status 0 running on Android

Hey all,

I get this status occasionally when I run from my Android device. Sometimes it works sometimes it does not. It works every time (so far) with Ionic Serve. Running NodeJS with CORS enabled on my backend. Both Ionic Serve and my device are on separate networks from my webserver running the app.


Did you remote debug the problem on the device already? Follow these instructions here to debug the problem in Chrome dev tools: Look at the console and network tabs for errors.

Ya I just had someone in Slack recommend that. I’ll give that a shot in a few hours and post the results.

1 Like

Looks like i’m getting net::ERR_CONTENT_LENGTH_MISMATCH

I would expect the server logs to have more detailed information.

Currently running off a node server that isnt throwing any errors as far as i can tell. It seems to be sending the response back properly. Also if it helps this only became an issue after i started including base64 encoded strings in my response for image data i am returning to the client.

The primary cause of this error is when the server says that it’s going to deliver X bytes (in the Content-Length header) and closes the connection before sending that much. That could happen if the server encountered some problem reading a local resource (disk read error, for example). If you don’t see any errors on the server side, all I can think of is that packets got irreparably lost somehow in transmission.

ya the weird thing though is it works no problem using Ionic serve or postman so that is where i cant help but feel like it is device side.

Are you sure the method of the request is identical on Android as to browser/Postman? Maybe it is a CORS request (OPTIONS instead of POST for example).

sorry total newby here. how would i verify that? i am using the same method/route/headers and everything. but i guess i dont know if there is some sort of difference just based on one is being made from the browser (so it would be a CORS request which i have enabled on the backend with express) and another from the device

In the dev tools, network tab, you can show the “method” column. It should be whatever you are simulating in Postman (POST or GET probably)

It’s a get request. also for reference I am receiving image data in base64 string as part of this get request and this is all running from my node server. So i dont know if node just struggles with image data.