{"id":1056,"date":"2023-06-22T21:42:00","date_gmt":"2023-06-23T01:42:00","guid":{"rendered":"https:\/\/jasonralph.org\/?p=1056"},"modified":"2023-06-22T21:43:43","modified_gmt":"2023-06-23T01:43:43","slug":"httpsconnectionpoolhostfiles-pythonhosted-org-port443-read-timed-out","status":"publish","type":"post","link":"https:\/\/jasonralph.org\/?p=1056","title":{"rendered":"HTTPSConnectionPool(host=&#8217;files.pythonhosted.org&#8217;, port=443): Read timed out"},"content":{"rendered":"<p>I recently had an issue where one of our EMR clusters failed to bootstrap the python modules via PIP.  I checked the logs and saw that we ran into the following error:<\/p>\n<pre class=\"theme:solarized-dark lang:default decode:true \" >\r\nHTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out\r\n<\/pre>\n<p>I wanted to have PIP not die if it timed out, I also wanted it to retry on failure. By adding the following to my bootstrap.sh I was able to have the PIP socket timeout at a longer interval, also bump up the retries to 10.  I have not seen the issue since I applied the new settings.  <\/p>\n<pre class=\"theme:solarized-dark lang:default decode:true \" >\r\nsudo python3 -m pip --timeout 100 --retries 10 install --upgrade pip\r\nsudo python3 -m pip --timeout 100 --retries 10 install\r\n<\/pre>\n<p>From the PIP help page:<\/p>\n<pre class=\"theme:solarized-dark lang:default decode:true \" >\r\n  --retries <retries>         Maximum number of retries each connection should attempt (default 5 times).\r\n  --timeout <sec>             Set the socket timeout (default 15 seconds).\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I recently had an issue where one of our EMR clusters failed to bootstrap the python modules via PIP. I checked the logs and saw that we ran into the following error: HTTPSConnectionPool(host=&#8217;files.pythonhosted.org&#8217;, port=443): Read timed out I wanted to have PIP not die if it timed out, I also wanted it to retry on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38,4],"tags":[102,101,12,106,127,129,128,59],"class_list":["post-1056","post","type-post","status-publish","format-standard","hentry","category-coding-thoughts","category-python","tag-bootstrap","tag-emr","tag-linux","tag-pip","tag-pip3","tag-retries","tag-retry","tag-timeout"],"_links":{"self":[{"href":"https:\/\/jasonralph.org\/index.php?rest_route=\/wp\/v2\/posts\/1056","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jasonralph.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jasonralph.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jasonralph.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jasonralph.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1056"}],"version-history":[{"count":3,"href":"https:\/\/jasonralph.org\/index.php?rest_route=\/wp\/v2\/posts\/1056\/revisions"}],"predecessor-version":[{"id":1059,"href":"https:\/\/jasonralph.org\/index.php?rest_route=\/wp\/v2\/posts\/1056\/revisions\/1059"}],"wp:attachment":[{"href":"https:\/\/jasonralph.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jasonralph.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1056"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jasonralph.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}