Getting random 520 errors

Domain is altersmoke.gr

Getting 520 errors randomly, if you refresh the page it works loads properly.

Server side logs do not show anything helpful to pinpoint the problem.

Here’s a cdn cgi trace:

fl=88f162 h=altersmoke.gr ip=94.66.66.239 ts=1701425438.571 visit_scheme=https uag=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0 colo=ATH sliver=010-ath01 http=http/2 loc=GR tls=TLSv1.3 sni=plaintext warp=off gateway=off rbi=off kex=X25519

I’ve enabled logflare app that might help determine were the problem is

* <mark>
Sat Dec 02 2023 12:12:35</mark> GET | 520 | https://altersmoke.gr/wp-content/uploads/2020/10/footer-altersmoke-logo-white-battery.jpg | 82f2cadb3da66f67 | 94.66.66.239 | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 | | 7169 | 7169 | text/html; charset=UTF-8 | keep-alive | Keep-Alive | private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0 | | | Thu, 01 Jan 1970 00:00:01 GMT | Accept-Encoding | cloudflare | | Sat, 02 Dec 2023 10:12:35 GMT [event body](https://logflare.app/sources/29921/search?querystring=m.response.status_code%3A%3E%3D500+c%3Acount%28*%29+c%3Agroup_by%28t%3A%3Aminute%29&tailing%3F=true#)
* <mark>Sat Dec 02 2023 12:04:42</mark> GET | 520 | https://altersmoke.gr/barcode/ | 82f2bf4b7b15ee98 | 94.66.66.239 | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0 | | 7169 | 7169 | text/html; charset=UTF-8 | keep-alive | Keep-Alive | private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0 | | | Thu, 01 Jan 1970 00:00:01 GMT | | cloudflare | | Sat, 02 Dec 2023 10:04:42 GMT [event body](https://logflare.app/sources/29921/search?querystring=m.response.status_code%3A%3E%3D500+c%3Acount%28*%29+c%3Agroup_by%28t%3A%3Aminute%29&tailing%3F=true#)
* <mark>Sat Dec 02 2023 11:54:09</mark> GET | 520 | https://altersmoke.gr/product/boosters/crystalnic-vg-pg-premium-nicotine-booster-10ml-20mg/ | 82f2afdc096538db | 2a02:1388:14e:3683:358:a1c6:e90c:d0b5 | Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.36 | | 7194 | 7194 | text/html; charset=UTF-8 | keep-alive | Keep-Alive | private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0 | | | Thu, 01 Jan 1970 00:00:01 GMT | | cloudflare | | Sat, 02 Dec 2023 09:54:09 GMT [event body](https://logflare.app/sources/29921/search?querystring=m.response.status_code%3A%3E%3D500+c%3Acount%28*%29+c%3Agroup_by%28t%3A%3Aminute%29&tailing%3F=true#)
* <mark>Sat Dec 02 2023 11:44:38</mark> GET | 500 | https://altersmoke.gr/wp-admin/edit.php?s=6970062940&post_status=all&post_type=shop_order&_wpnonce=1b63b55918&_wp_http_referer=%2Fwp-admin%2Fedit.php%3Fs%3D6970062940%26post_status%3Dall%26post_type%3Dshop_order%26action%3D-1%26m%3D0%26wwpp_fbwr%3Dall_order_types%26_customer_user%26filter_orders_by_meta_value%26paged%3D1%26action2%3D-1&action=trash&m=0&wwpp_fbwr=all_order_types&_customer_user=&filter_orders_by_meta_value=&paged=1&post%5B%5D=522590&action2=trash | 82f2a1e45e57eec4 | 94.66.66.239 | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0 | DYNAMIC | | | text/html; charset=UTF-8 | keep-alive | Keep-Alive | no-cache, must-revalidate, max-age=0, no-store, private | | | Wed, 11 Jan 1984 05:00:00 GMT | Accept-Encoding | cloudflare | | Sat, 02 Dec 2023 09:44:38 GMT [event body](https://logflare.app/sources/29921/search?querystring=m.response.status_code%3A%3E%3D500+c%3Acount%28*%29+c%3Agroup_by%28t%3A%3Aminute%29&tailing%3F=true#)

In my case, took forever to find it but I managed to fix it by turning off http2 to origin toggle on cloudflare under domain → speed → optimization if anyone needs it in the future.