{"action":"created","issue":{"url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/issues/2254","labels_url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/issues/2254/labels{/name}","comments_url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/issues/2254/comments","events_url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/issues/2254/events","html_url":"https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2254","id":63528348,"number":2254,"title":"wkhtmltopdf hangs on network errors","user":{"login":"AnthonyAkentiev","id":1623033,"avatar_url":"https://avatars.githubusercontent.com/u/1623033?v=3","gravatar_id":"","url":"https://api.github.com/users/AnthonyAkentiev","html_url":"https://github.com/AnthonyAkentiev","followers_url":"https://api.github.com/users/AnthonyAkentiev/followers","following_url":"https://api.github.com/users/AnthonyAkentiev/following{/other_user}","gists_url":"https://api.github.com/users/AnthonyAkentiev/gists{/gist_id}","starred_url":"https://api.github.com/users/AnthonyAkentiev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnthonyAkentiev/subscriptions","organizations_url":"https://api.github.com/users/AnthonyAkentiev/orgs","repos_url":"https://api.github.com/users/AnthonyAkentiev/repos","events_url":"https://api.github.com/users/AnthonyAkentiev/events{/privacy}","received_events_url":"https://api.github.com/users/AnthonyAkentiev/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/labels/Verified","name":"Verified","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/milestones/6","html_url":"https://github.com/wkhtmltopdf/wkhtmltopdf/milestones/0.12.3","labels_url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/milestones/6/labels","id":989260,"number":6,"title":"0.12.3","description":"","creator":{"login":"ashkulz","id":854352,"avatar_url":"https://avatars.githubusercontent.com/u/854352?v=3","gravatar_id":"","url":"https://api.github.com/users/ashkulz","html_url":"https://github.com/ashkulz","followers_url":"https://api.github.com/users/ashkulz/followers","following_url":"https://api.github.com/users/ashkulz/following{/other_user}","gists_url":"https://api.github.com/users/ashkulz/gists{/gist_id}","starred_url":"https://api.github.com/users/ashkulz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashkulz/subscriptions","organizations_url":"https://api.github.com/users/ashkulz/orgs","repos_url":"https://api.github.com/users/ashkulz/repos","events_url":"https://api.github.com/users/ashkulz/events{/privacy}","received_events_url":"https://api.github.com/users/ashkulz/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":15,"state":"open","created_at":"2015-02-21T09:00:58Z","updated_at":"2015-07-09T03:26:44Z","due_on":null,"closed_at":null},"comments":41,"created_at":"2015-03-22T12:38:05Z","updated_at":"2015-07-22T11:33:17Z","closed_at":null,"body":"Version: 0.12.2.1 (with patched qt), same with 0.12.1\r\nOS: Ubuntu 3.13.0-44-generic #73-Ubuntu SMP Tue Dec 16 00:22:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux\r\n\r\n![screen shot 2015-03-22 at 15 34 39](https://cloud.githubusercontent.com/assets/1623033/6769383/e59a25e0-d0a9-11e4-834a-6f64ef8e0403.png)\r\n\r\n1) OS is a completely clean new \"install\".\r\n2) sudo apt-get install gdebi\r\n3) sudo gdebi wkhtmltox-0.12.2.1_linux-jessie-amd64-2.deb \r\n4) Then i just\r\n\r\nwkhtmltopdf \"http://lenta.ru\" lenta.pdf\r\n\r\nlenta.ru is a news web site, so the content is updated frequently. So to be sure contents is\r\n\r\n not changed - you can check my web page -\r\n\r\nwkhtmltopdf \"http://www.adaperio.ru/engine.html#/search/%D0%BD030%D1%80%D0%BD98\" sample.pdf\r\n\r\nOutput:\r\n\r\nUnable to load library icui18n \"Cannot load library icui18n: (icui18n: cannot open shared object file: No such file or directory)\" \r\nLoading pages (1/6)\r\nFontconfig warning: ignoring UTF-8: not a valid region tag   ] 50%\r\n[======================================================>     ] 90%\r\n\r\nAnd it freezes (for 2-5 hours easily). Sometimes it is OK and process finishes normally with good PDF file. Please run several times.\r\n \r\nThe end of \"strace -f -e trace=network -s 10000 wkhtmltopdf \"http://lenta.ru\" lenta.pdf\" output is:\r\n[pid  1301] setsockopt(29, SOL_SOCKET, SO_OOBINLINE, [1], 4) = 0\r\n[pid  1301] connect(29, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr(\"54.243.146.98\")}, 16) = -1 EINPROGRESS (Operation now in progress)\r\n[pid  1301] connect(29, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr(\"54.243.146.98\")}, 16) = 0\r\n[pid  1301] getsockname(29, {sa_family=AF_INET, sin_port=htons(59900), sin_addr=inet_addr(\"172.31.5.30\")}, [16]) = 0\r\n[pid  1301] getpeername(29, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr(\"54.243.146.98\")}, [16]) = 0\r\n[pid  1301] getsockopt(29, SOL_SOCKET, SO_TYPE, [1], [4]) = 0\r\n[pid  1301] setsockopt(29, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0\r\n...and then freezes... \r\n\r\n*** \r\nOn my MAC OS X the same worked fine 10/10 times. Output:\r\n\"Loading pages (1/6)\r\nCounting pages (2/6)                                               \r\nResolving links (4/6)                                                       \r\nLoading headers and footers (5/6)                                           \r\nPrinting pages (6/6)\r\nDone                                                                      \r\nExit with code 1 due to network error: HostNotFoundError\" (but its ok and PDF is generated)\r\n\r\n*** \r\nPlease help. Thank you!"},"comment":{"url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/issues/comments/123681801","html_url":"https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2254#issuecomment-123681801","issue_url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/issues/2254","id":123681801,"user":{"login":"ashkulz","id":854352,"avatar_url":"https://avatars.githubusercontent.com/u/854352?v=3","gravatar_id":"","url":"https://api.github.com/users/ashkulz","html_url":"https://github.com/ashkulz","followers_url":"https://api.github.com/users/ashkulz/followers","following_url":"https://api.github.com/users/ashkulz/following{/other_user}","gists_url":"https://api.github.com/users/ashkulz/gists{/gist_id}","starred_url":"https://api.github.com/users/ashkulz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashkulz/subscriptions","organizations_url":"https://api.github.com/users/ashkulz/orgs","repos_url":"https://api.github.com/users/ashkulz/repos","events_url":"https://api.github.com/users/ashkulz/events{/privacy}","received_events_url":"https://api.github.com/users/ashkulz/received_events","type":"User","site_admin":false},"created_at":"2015-07-22T11:33:17Z","updated_at":"2015-07-22T11:33:17Z","body":"I was not able to reproduce the error with the test case given by @Indigo. I tried the method given by @DanielCeregatti (killing the webserver while it is loading the page) -- created a 300kB file with just `<br><hr>` and used a rate limit of 1kB/sec with [extended_http_server.py](https://github.com/bboe/extended_http_server). For me, it just gave:\r\n```\r\nLoading pages (1/6)\r\nWarning: SSL error ignored                                        \r\nError: Failed loading page https://localhost:8000/test.html (sometimes it will work just to ignore this error with --load-error-handling ignore)\r\nExit with code 1 due to network error: RemoteHostClosedError\r\n```\r\nSo, I'm stumped. I can kind of understand the error path, but without being able to reproduce the error I can't really fix it inside Qt and/or WebKit (which is where it should ideally be fixed)."}}