From 1f3fb6e89eef605b4ee1a1775026a42c515e281f Mon Sep 17 00:00:00 2001 From: Toutsu Date: Tue, 9 Jun 2026 12:20:32 +0300 Subject: [PATCH] fix(bot): install libgssapi-krb5-2 in runtime image Telegram bot's long-polling hangs after the first GetUpdates request because libgssapi-krb5.so.2 is missing from the runtime-deps:10.0-noble final image. .NET runtime attempts dlopen() of libgssapi during the HTTPS handshake; without the library the HttpClient connection pool enters an unrecoverable state and TelegramBotService never receives new updates, even though SessionSchedulerService keeps sending outgoing messages successfully. Symptom (Loki, container gmrelaybot-bot-1): Telegram bot polling started Polling error, retrying in 5s Telegram.Bot.Exceptions.RequestException: Bot API Service Failure Cannot load library libgssapi_krb5.so.2 After the single Polling error, no Error handling update, no further Polling error, and getUpdates from outside returns [] forever. Fix: install libgssapi-krb5-2 alongside wget in the final stage of src/GmRelay.Bot/Dockerfile. This also future-proofs Npgsql GSS/SSPI Kerberos authentication for PostgreSQL. Closes #129. Bump version 3.9.5 -> 3.9.6 --- .gitea/workflows/deploy.yml | 2 +- Directory.Build.props | 2 +- compose.yaml | 6 +++--- src/GmRelay.Bot/Dockerfile | 6 ++++-- src/GmRelay.Web/Components/Layout/NavMenu.razor | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 4ddf91e..a30a680 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -6,7 +6,7 @@ on: - main env: - VERSION: 3.9.5 + VERSION: 3.9.6 jobs: # ЧАСТЬ 1: Собираем образы и кладем в Gitea (чтобы делиться с ребятами) diff --git a/Directory.Build.props b/Directory.Build.props index 2139fad..02dc18a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 3.9.5 + 3.9.6 net10.0 preview enable diff --git a/compose.yaml b/compose.yaml index 465b800..b8cecdd 100644 --- a/compose.yaml +++ b/compose.yaml @@ -49,7 +49,7 @@ services: crond -f bot: - image: git.codeanddice.ru/toutsu/gmrelay-bot:3.9.5 + image: git.codeanddice.ru/toutsu/gmrelay-bot:3.9.6 restart: always depends_on: db: @@ -67,7 +67,7 @@ services: retries: 3 discord: - image: git.codeanddice.ru/toutsu/gmrelay-discord-bot:3.9.5 + image: git.codeanddice.ru/toutsu/gmrelay-discord-bot:3.9.6 restart: always depends_on: db: @@ -86,7 +86,7 @@ services: retries: 3 web: - image: git.codeanddice.ru/toutsu/gmrelay-web:3.9.5 + image: git.codeanddice.ru/toutsu/gmrelay-web:3.9.6 restart: always depends_on: db: diff --git a/src/GmRelay.Bot/Dockerfile b/src/GmRelay.Bot/Dockerfile index d6a6ca0..9f37004 100644 --- a/src/GmRelay.Bot/Dockerfile +++ b/src/GmRelay.Bot/Dockerfile @@ -30,8 +30,10 @@ RUN dotnet publish "GmRelay.Bot.csproj" -c Release -a $TARGETARCH -o /app/publis FROM mcr.microsoft.com/dotnet/runtime-deps:10.0-noble AS final WORKDIR /app -# Устанавливаем wget для healthcheck -RUN apt-get update && apt-get install -y --no-install-recommends wget \ +# Устанавливаем wget для healthcheck и libgssapi-krb5-2 для Npgsql GSS/SSPI +# и HTTPS-handshake Telegram.Bot (без неё long-polling падает на первом запросе). +RUN apt-get update && apt-get install -y --no-install-recommends \ + wget libgssapi-krb5-2 \ && rm -rf /var/lib/apt/lists/* # Копируем только AOT-результаты из билда diff --git a/src/GmRelay.Web/Components/Layout/NavMenu.razor b/src/GmRelay.Web/Components/Layout/NavMenu.razor index 776b179..d765c6c 100644 --- a/src/GmRelay.Web/Components/Layout/NavMenu.razor +++ b/src/GmRelay.Web/Components/Layout/NavMenu.razor @@ -82,7 +82,7 @@ - +