-
Notifications
You must be signed in to change notification settings - Fork 4
'No route to host?' with active Internet connection #2746
Comments
Thank you for reporting this. We haven't heard of this being an issue for anyone else but nevertheless we are currently investigating it. |
"Lenovo Vibe K5 Plus A6020a46 with Android 5.1.1. That is not case with Android 5.1." I took a look into the link you provided, and i I understand correctly the addition that was made was that you can provide c_ares with a list of search locations that it should look through for the resolv.conf file. This has since been adapted into c_ares, but it seems strange that the default implementation cannot find the resolve file. Could you look into the file system on those devices and see if the /etc/resolv.conf file exists? and possibly if you have read access to it and what its content is. Edit: The resolv.conf file isn't used on Android. From the c-ares code: /* Use the Android connectivity manager to get a list
|
This case is 100% reproducible on Sony Xperia M5 5603 and on Lenovo Vibe K5 Plus A6020a46 from our QA devices bank. Both with Android 5.1 but on other devices with Android 5.1 this error is not reproducible. I have no information about similar issue on iOS. |
I was able to run into a few issues with tpacketcapture app. It does fail on android 8+ devices 100% of the time, but only occasionally on the 5.1 devices:
So for now, until we can patch the DNS case, could you switch your request from https to http and see if it works better? Obviously not ideal, but consider it a workaround for now. I'll see if I can send you a WIP engine that you guys can try out this week. |
We made fallback to IP as temporary solution. |
I think the better solution of no DNS servers problem is property in game.project [network] section with comma separated list of DNS servers used as default servers if no DNS servers found on system. And default value for this property should be 8.8.8.8. This solution make no problems with China distribution. |
I have a PR that sets DNS servers to 8.8.8.8 and 8.8.4.4 (and similar IPV6 variants) if ares didn't find anything from the device configuration, so if you want I could send you that version so you can test it and see if it resolves your issue. I have tested it on a device with android 8 and the tpacketcapture app running and there are no more DNS issues. If the solution works, then maybe we could add something similar to the game.project, but it needs a round of discussions internally first. |
Ok. I'm ready to test. |
Test failed but without "No route to host?" error. local function check_http(url, method)
http.request(url, method, function(self, id, response)
print(method .. " " .. url .. " : " .. response.status)
end, nil, "")
end
local function run_batch_http(method)
check_http("https://example.com", method)
check_http("https://graph.facebook.com/me", method)
check_http("[Some server]", method)
end
local function run_test()
print("------------------------ run test -------------------------")
run_batch_http("GET")
run_batch_http("POST")
end Output from Windows and from Android):
|
Will investigate. |
Surprisingly the https request to graph.facebook.com/me fails with a socket error. The -78 is MBEDTLS_ERR_NET_SEND_FAILED. Doing the same with curl gives a response:
We must be missing something in our config or in the way we set up timeouts |
Correction and some additional observations: The socket error doesn't show up 100% of the time (more like 50%). The test provided in the example makes both GET and POST requests at the same time. If I only do GET requests the problem never happens. If I do only a POST request the problem happens. |
Isolating the problem further:
Sometime results in:
Aaaand it never happens if the request actually contains POST data:
This makes sense from one point of view, but I guess a POST request should contain data. |
We will include a fix for 0 content length POSTs on SSL connections in 1.2.165. |
@Filazapovich The fix was included in 1.2.164. Can you please confirm that you no longer have any problems with HTTP(S) requests? |
We will update Defold to 1.2.164+ only at January. |
Part of people (looks like ~10%) whose download our game is affected by strange error with active and stable Internet connection:
Native gethostbyname works fine and resolves host IP. Logcat from device:
Thinks about than:
http.request
uses c-ares lib to resolve host IP. Looks like case with that lib? No DNS Search Domain support in C-Ares calls nodejs/node#17850Our QA have 2 devices with that error: Sony Xperia M5 5603 with Android 5.1 and Lenovo Vibe K5 Plus A6020a46 with Android 5.1.1. That is not case with Android 5.1.
Reproducible with defold 161, 159 and earlier.
The text was updated successfully, but these errors were encountered: