{"id":129,"date":"2018-01-20T21:28:47","date_gmt":"2018-01-20T19:28:47","guid":{"rendered":"http:\/\/mattyb.co.za\/?p=129"},"modified":"2018-01-20T21:28:47","modified_gmt":"2018-01-20T19:28:47","slug":"cpanel-nginx-hack-mirror-sometimes-breaks","status":"publish","type":"post","link":"https:\/\/mattyb.co.za\/index.php\/2018\/01\/20\/cpanel-nginx-hack-mirror-sometimes-breaks\/","title":{"rendered":"CPanel NGINX hack-mirror, sometimes breaks"},"content":{"rendered":"<p>We had a few clients complaining about corrupted downloads from our mirror when trying to run upcp CPanel update, so I checked it out.<\/p>\n<p>It looks like the NGINX Proxy Cache had corruption, and it had a file &#8220;http:\/\/cpproxy.afrixx.com\/cpanelsync\/11.68.0.26\/binaries\/linux-c7-x86_64\/bin\/setsiteip.xz&#8221; that was invalid, and corrupted based on the expected checksum.<\/p>\n<p>I&#8217;ve double checked the health of the cpproxy, and it seems okay, although it was rebooted recently, I am not sure if I was not the first one to look at the issue.<br \/>\nI can see from the logs, we served him a cached &#8220;HIT&#8221; to the clients box.<\/p>\n<p>15x.0.165.4 &#8211; &#8211; [18\/Jan\/2018:00:52:27 +0200] &#8220;GET \/cpanelsync\/11.68.0.26\/binaries\/linux-c7-x86_64\/bin\/setsiteip.xz HTTP\/1.1&#8221; 200 1026207 &#8220;-&#8221; &#8220;HTTP-Tiny\/0.068&#8221; &#8220;-&#8221; &#8220;Cache-Status:HIT&#8221;<br \/>\nThere were 10 attempts from his box, as well as some others from other boxes at the time.<\/p>\n<p>We last &#8220;missed&#8221; an attempt to get this file at the following date:<br \/>\naccess.log-20180116.gz:15x.0.160.155 &#8211; &#8211; [16\/Jan\/2018:01:32:08 +0200] &#8220;GET \/cpanelsync\/11.66.0.34\/binaries\/linux-c7-x86_64\/bin\/setsiteip.xz HTTP\/1.1&#8221; 200 2122005 &#8220;-&#8221; &#8220;HTTP-Tiny\/0.068&#8221; &#8220;-&#8221; &#8220;Cache-Status:MISS&#8221;<\/p>\n<p>At this point we could assume it was cached on this MISS.<br \/>\nThis means anyone wanting to do an UPCP though the proxy since this date would be sad.<\/p>\n<p>I have taken the exact file the client complained about, and checked if the cache has expired and redownloaded the file.<\/p>\n<p>I downloaded our cache&#8217;s file to &#8220;CACHE&#8221;:<br \/>\nroot@alyx:~\/cp# wget -O CACHE http:\/\/cpproxy.afrixx.com\/cpanelsync\/11.68.0.26\/binaries\/linux-c7-x86_64\/bin\/setsiteip.xz<br \/>\n&#8211;2018-01-18 22:42:32&#8211; http:\/\/cpproxy.afrixx.com\/cpanelsync\/11.68.0.26\/binaries\/linux-c7-x86_64\/bin\/setsiteip.xz<br \/>\nResolving cpproxy.afrixx.com (cpproxy.afrixx.com)&#8230; 1xx.242.144.85<br \/>\nConnecting to cpproxy.afrixx.com (cpproxy.afrixx.com)|1xx.242.144.85|:80&#8230; connected.<br \/>\nHTTP request sent, awaiting response&#8230; 200 OK<br \/>\nLength: unspecified [application\/x-xz]<br \/>\nSaving to: \u2018CACHE\u2019<\/p>\n<p>CACHE [ &lt;=&gt; ] 1.32M &#8211;.-KB\/s in 0.07s<\/p>\n<p>2018-01-18 22:42:32 (19.1 MB\/s) &#8211; \u2018CACHE\u2019 saved [1383264]<\/p>\n<p>And I downloaded the CPANEL Mirror&#8217;s version to NON-CACHE:<\/p>\n<p>root@alyx:~\/cp# wget -O NON-CACHE http:\/\/httpupdate.cpanel.net\/cpanelsync\/11.68.0.26\/binaries\/linux-c7-x86_64\/bin\/setsiteip.xz<br \/>\n&#8211;2018-01-18 22:42:52&#8211; http:\/\/httpupdate.cpanel.net\/cpanelsync\/11.68.0.26\/binaries\/linux-c7-x86_64\/bin\/setsiteip.xz<br \/>\nResolving httpupdate.cpanel.net (httpupdate.cpanel.net)&#8230; 67.159.2.2, 67.205.110.4, 208.109.109.239, &#8230;<br \/>\nConnecting to httpupdate.cpanel.net (httpupdate.cpanel.net)|67.159.2.2|:80&#8230; connected.<br \/>\nHTTP request sent, awaiting response&#8230; 200 OK<br \/>\nLength: unspecified [application\/x-xz]<br \/>\nSaving to: \u2018NON-CACHE\u2019<\/p>\n<p>NON-CACHE [ &lt;=&gt; ] 1.32M 871KB\/s in 1.6s<\/p>\n<p>2018-01-18 22:42:54 (871 KB\/s) &#8211; \u2018NON-CACHE\u2019 saved [1383264]<\/p>\n<p>When we compare the files md5 checksum, I can see the files are the same:<\/p>\n<p>root@alyx:~\/cp# md5sum NON-CACHE<br \/>\n401dbed2bd9075e2896e596738163437 NON-CACHE<br \/>\nroot@alyx:~\/cp# md5sum CACHE<br \/>\n401dbed2bd9075e2896e596738163437 CACHE<\/p>\n<p>I&#8217;ve also run an upcp on a different box that is pointing to our cache, and it seems to be fine.<\/p>\n<p>I&#8217;ll assume the cache expired and the file rotated, clearing the error condition.<\/p>\n<p>Mew<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We had a few clients complaining about corrupted downloads from our mirror when trying to run upcp CPanel update, so I checked it out. It looks like the NGINX Proxy Cache had corruption, and it had a file &#8220;http:\/\/cpproxy.afrixx.com\/cpanelsync\/11.68.0.26\/binaries\/linux-c7-x86_64\/bin\/setsiteip.xz&#8221; that was invalid, and corrupted based on the expected checksum. I&#8217;ve double checked the health of &hellip; <a href=\"https:\/\/mattyb.co.za\/index.php\/2018\/01\/20\/cpanel-nginx-hack-mirror-sometimes-breaks\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">CPanel NGINX hack-mirror, sometimes breaks<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[1],"tags":[],"class_list":["post-129","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p71fL2-25","jetpack-related-posts":[{"id":6,"url":"https:\/\/mattyb.co.za\/index.php\/2015\/09\/26\/rage-lan-2015\/","url_meta":{"origin":129,"position":0},"title":"rAge LAN 2015 Post 1","author":"admin","date":"September 26, 2015","format":false,"excerpt":"So I am a part of building the NAG LAN at the biggest Gaming Expo in South Africa. rAge My main purpose at the event will be to set-up the the LAN cache, as done here by Multiplay. I have 2 x the below to work with: 2 x Intel\u2026","rel":"","context":"In &quot;rAge 2015&quot;","block_context":{"text":"rAge 2015","link":"https:\/\/mattyb.co.za\/index.php\/category\/rage-2015\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":137,"url":"https:\/\/mattyb.co.za\/index.php\/2019\/05\/30\/fakeraid-linux-and-r1soft\/","url_meta":{"origin":129,"position":1},"title":"FakeRAID, Linux, and R1Soft","author":"admin","date":"May 30, 2019","format":false,"excerpt":"FakeRAID and Linux aren't really friends. What is fakeRAID? In the last few years, a number of hardware products have come onto the market claiming to be IDE or SATA RAID controllers. These have shown up in a number of desktop\/workstation motherboards and lower-end servers. Virtually none of these are\u2026","rel":"","context":"In \"backups\"","block_context":{"text":"backups","link":"https:\/\/mattyb.co.za\/index.php\/tag\/backups\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mattyb.co.za\/wp-content\/uploads\/2019\/05\/Screenshot-2019-05-30-at-16.34.22.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/mattyb.co.za\/wp-content\/uploads\/2019\/05\/Screenshot-2019-05-30-at-16.34.22.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/mattyb.co.za\/wp-content\/uploads\/2019\/05\/Screenshot-2019-05-30-at-16.34.22.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/mattyb.co.za\/wp-content\/uploads\/2019\/05\/Screenshot-2019-05-30-at-16.34.22.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/mattyb.co.za\/wp-content\/uploads\/2019\/05\/Screenshot-2019-05-30-at-16.34.22.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":21,"url":"https:\/\/mattyb.co.za\/index.php\/2015\/10\/13\/rage-2015-the-stats\/","url_meta":{"origin":129,"position":2},"title":"rAge 2015 &#8211; The stats","author":"admin","date":"October 13, 2015","format":false,"excerpt":"So, stats from the SteamCache at rAge 2015 16.4TB was recieced through the internet IP, and 51.1TB was sent out by the cache's Steam IP. The highest peak of traffic to the cache from the LAN bond, was 10.07Gbps, on Friday morning. The max tracked connections to the cache was\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"system1z.1day","src":"https:\/\/i0.wp.com\/mattyb.co.za\/wp-content\/uploads\/2015\/10\/system1z.1day.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/mattyb.co.za\/wp-content\/uploads\/2015\/10\/system1z.1day.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/mattyb.co.za\/wp-content\/uploads\/2015\/10\/system1z.1day.png?resize=700%2C400 2x"},"classes":[]},{"id":147,"url":"https:\/\/mattyb.co.za\/index.php\/2020\/08\/12\/routers-are-secure-right-asus-lyra-hacked\/","url_meta":{"origin":129,"position":3},"title":"Routers are secure, right? Asus Lyra hacked.","author":"admin","date":"August 12, 2020","format":false,"excerpt":"We take the small things for granted in life. Like, say breathing. Or, the security on our embedded network devices... As our devices become more and more complicated and sophisticated, we use them in the hope that so are their security features become more advanced at the same time. Sure,\u2026","rel":"","context":"In \"asus\"","block_context":{"text":"asus","link":"https:\/\/mattyb.co.za\/index.php\/tag\/asus\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mattyb.co.za\/wp-content\/uploads\/2020\/08\/image.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/mattyb.co.za\/wp-content\/uploads\/2020\/08\/image.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/mattyb.co.za\/wp-content\/uploads\/2020\/08\/image.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":78,"url":"https:\/\/mattyb.co.za\/index.php\/2015\/11\/29\/wait\/","url_meta":{"origin":129,"position":4},"title":"WAIT!","author":"admin","date":"November 29, 2015","format":false,"excerpt":"Who wants to wait around for other people\/things? Defiantly not your cache server, and if it is waiting around, then there could be a problem somewhere. See my case below: The server has only 4 CPUs, and its load average is almost double that. Wow, why is there so much\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"system1z.1day","src":"https:\/\/i0.wp.com\/mattyb.co.za\/wp-content\/uploads\/2015\/11\/system1z.1day.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/mattyb.co.za\/wp-content\/uploads\/2015\/11\/system1z.1day.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/mattyb.co.za\/wp-content\/uploads\/2015\/11\/system1z.1day.png?resize=700%2C400 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/mattyb.co.za\/index.php\/wp-json\/wp\/v2\/posts\/129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mattyb.co.za\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mattyb.co.za\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mattyb.co.za\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mattyb.co.za\/index.php\/wp-json\/wp\/v2\/comments?post=129"}],"version-history":[{"count":1,"href":"https:\/\/mattyb.co.za\/index.php\/wp-json\/wp\/v2\/posts\/129\/revisions"}],"predecessor-version":[{"id":130,"href":"https:\/\/mattyb.co.za\/index.php\/wp-json\/wp\/v2\/posts\/129\/revisions\/130"}],"wp:attachment":[{"href":"https:\/\/mattyb.co.za\/index.php\/wp-json\/wp\/v2\/media?parent=129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mattyb.co.za\/index.php\/wp-json\/wp\/v2\/categories?post=129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mattyb.co.za\/index.php\/wp-json\/wp\/v2\/tags?post=129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}