From cb458b93f5f4748c76736d3a0069f8e236a0366e Mon Sep 17 00:00:00 2001 From: Sam Heinz Date: Sun, 2 Aug 2026 17:46:02 +1000 Subject: [PATCH] add retry for uv - same as immich (#16203) --- ct/authentik.sh | 11 ++++++++++- install/authentik-install.sh | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ct/authentik.sh b/ct/authentik.sh index 034e9d4f7..95a97e1a1 100644 --- a/ct/authentik.sh +++ b/ct/authentik.sh @@ -118,10 +118,19 @@ function update_script() { export UV_COMPILE_BYTECODE="1" export UV_LINK_MODE="copy" export UV_NATIVE_TLS="1" + export UV_HTTP_TIMEOUT="300" export RUSTUP_PERMIT_COPY_RENAME="true" export UV_PYTHON_INSTALL_DIR="/usr/local/bin" cd /opt/authentik - $STD uv sync --frozen --no-install-project --no-dev + for attempt in 1 2 3; do + if [[ $attempt -eq 3 ]]; then + $STD uv sync --frozen --no-install-project --no-dev + break + fi + $STD uv sync --frozen --no-install-project --no-dev && break + msg_warn "uv sync attempt $attempt failed, retrying..." + sleep $((attempt * 15)) + done chown -R authentik:authentik /opt/authentik msg_ok "Updated python server" diff --git a/install/authentik-install.sh b/install/authentik-install.sh index 90e9f6d26..885d77dd8 100644 --- a/install/authentik-install.sh +++ b/install/authentik-install.sh @@ -122,9 +122,18 @@ export UV_NO_BINARY_PACKAGE="cryptography lxml python-kadmin-rs xmlsec" export UV_COMPILE_BYTECODE="1" export UV_LINK_MODE="copy" export UV_NATIVE_TLS="1" +export UV_HTTP_TIMEOUT="300" export UV_PYTHON_INSTALL_DIR="/usr/local/bin" cd /opt/authentik -$STD uv sync --frozen --no-install-project --no-dev +for attempt in 1 2 3; do + if [[ $attempt -eq 3 ]]; then + $STD uv sync --frozen --no-install-project --no-dev + break + fi + $STD uv sync --frozen --no-install-project --no-dev && break + msg_warn "uv sync attempt $attempt failed, retrying..." + sleep $((attempt * 15)) +done cp /opt/authentik/authentik/sources/kerberos/krb5.conf /etc/krb5.conf msg_ok "Setup python server"