Skip to content

Vercel cannot reach the diary proxy for minutes at a time: four failing ticks in the first hour, and Squid never saw them #365

Open

Description

@lumenpearson

The self-check's diary_proxy check (#359) failed four times in the first hour and a quarter of production, and the owner got four real alerts: «🔴 Прокси дневника не отвечает» and «🟢 … снова работает» at 17:11/17:20 UTC (простой 8 мин) and 17:51/17:55 UTC (простой 4 мин), and the tick of 18:00:55 UTC failed again. Each failure reads «no answer through the proxy: TimeoutError» — the check's HEAD of the Petersburg diary through DIARY_PROXY_URL got nothing within five seconds.

What the VPS says (RUVDS, Korolyov; read over SSH on 6 October, 18:04–18:10 UTC):

  • Squid's access.log has a TCP_TUNNEL/200 for every tick that passed — 16:56, 17:00, 17:04, 17:08, 17:20, … 18:04, each tunnel in 330–394 ms — and no line at all for the ticks that failed (17:12, 17:16, ~17:52, 18:00). The failing connections never reached Squid.
  • Squid itself is healthy at those times: ten tunnels from the VPS through Squid to the diary took 0.14–0.20 s each; Squid's DNS is cached; load average 0.02; 166 MB of 366 MB available; no Squid error in cache.log.
  • The kernel counts TcpExtListenDrops 101 since boot, a day and two hours.

So the path from Vercel's fra1 (AWS Frankfurt) to the VPS's public address drops for minutes at a time. Nothing in this repository or in Squid's configuration is involved.

Failure scenario for a family: PetersburgClient connects with the same five-second budget (_TIMEOUT = httpx.Timeout(connect=5.0, …)), through the same proxy. A diary request made in one of those windows fails the same way and the phone shows «Дневник не отвечает». The alerts were the monitoring working: they describe what a parent would have seen.

Unknown:

  • whether the drops are on RUVDS's side, on a Russian filter in front of foreign traffic, or on the international link;
  • how often they happen across a day — this is one evening's first hour, the time of day the school diary is busiest;
  • whether a retry would help: the failures cluster in windows of four to twelve minutes, which a retry within one request does not span.

Options, the owner's to choose:

  1. Watch a day. The alerts are now the record; health_checks keeps only the last state, and Vercel keeps an hour of logs.
  2. Ask RUVDS whether inbound connections to the VPS from AWS Frankfurt are filtered or throttled.
  3. Try another Russian host, or a second proxy, if the drops continue.
  4. In code: a second attempt through the proxy in the diary client, and the check alerting only after two failing ticks in a row. Neither changes what a family sees in a window that lasts minutes.

Found by #359's own diary_proxy check, on its first evening.

Activity

  1. added this to lessons and removed this from lessonson Oct 6, 2026
  2. lumenpearson commented on Oct 6, 2026

    @lumenpearson
    OwnerAuthor

    More of the evening, read on the VPS (UTC). The failures are of two kinds.

    1. The connection never reaches the VPS. 17:12, 17:16, 17:52 and 18:00 have no line in Squid's access.log. It is not only Vercel's path: at 20:42 an SSH connection from the owner's home line in Russia timed out too, and worked again a minute later. That is the network in front of the VPS, which only RUVDS can explain.

    2. The tunnel opens and stalls for five seconds. 18:36:18 and 20:40:32 are logged as TCP_TUNNEL/200 lasting 5067 and 5065 ms; every passing tick takes 330–394 ms. The diary's A record has a TTL of 3600, so Squid resolves it again about once an hour. From the VPS, an A and an AAAA query sent back to back from one socket, as Squid's resolver sends them, lost the A answer 2 times in 25 against 8.8.8.8 and 0 in 25 against 9.9.9.9. Squid retries a lost query only after dns_retransmit_interval, 5 seconds by default, which is exactly the check's budget and PetersburgClient's connect timeout.

    Changed on the VPS at 20:44 UTC (the previous file is kept beside it, as squid.conf.before-dns-…):

    dns_retransmit_interval 1 seconds
    dns_nameservers 9.9.9.9 8.8.8.8
    

    squid -k parse accepted it, squid -k reconfigure applied it without a restart, and three tunnels through it took 0.15–0.19 s. This should end the second kind. The first kind is untouched, and it is still the owner's question for RUVDS, or a reason to move the proxy.

  3. lumenpearson commented on Oct 8, 2026

    @lumenpearson
    OwnerAuthor

    The owner's first choice of another host did not work, and the reason applies beyond one provider. Times are UTC, 8 October 2026.

    • A Selectel VDS in St Petersburg (zone ru-1c) was set up as the RUVDS one is: SSH by key only, Squid by the same script. From its address the diary drops every TCP connection, on 443 and on 80. A TCP traceroute reaches the diary's address in six hops, 3 ms away, and then nothing answers.
    • The same address cannot reach petersburgedu.ru, gov.spb.ru, gu.spb.ru, gosuslugi.ru, esia.gosuslugi.ru or kremlin.ru. It reaches mos.ru, nalog.gov.ru, ya.ru and vk.com.
    • Geolocation is not the cause. ipinfo, RIPE and MaxMind all place the address in Russia, St Petersburg, AS49505.
    • The cause is Selectel's own policy («Заблокированные порты и интернет-ресурсы»): access to e-government subnets is blocked from its infrastructure, and «Нельзя разблокировать доступ к подсетям электронного правительства для VDS серверов». Cloud and dedicated servers may ask by ticket, without a guarantee.
    • Other providers are reported to have the same problem. Press in September 2026 describes government portals filtering whole data-centre networks, and users report the same from Timeweb Cloud.

    The owner deleted the Selectel server. Production stays on RUVDS, which still reaches the diary (200 in 0.22 s from the VPS) with the inbound drops this issue describes. The owner's next step is the phone reading the diary itself, for both diaries, planned after sub-project 3 (the sub-project it belongs to is decided in its design).

  4. self-assigned this
    on Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

  • Status
    Now

Relationships

None yet

Development

No branches or pull requests

Issue actions