From f880655e32793ce50fec5a63040d041c29b7d2dc Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 26 Jan 2026 15:15:48 +0000 Subject: [PATCH] fix: set 3.12 as python fallback if no version explicitely set --- backend/windmill-worker/src/python_executor.rs | 2 +- backend/windmill-worker/src/python_versions.rs | 13 +++++++++---- backend/windmill-worker/src/worker.rs | 13 +++++++++---- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/backend/windmill-worker/src/python_executor.rs b/backend/windmill-worker/src/python_executor.rs index 9cf4f7046d..6572568a1d 100644 --- a/backend/windmill-worker/src/python_executor.rs +++ b/backend/windmill-worker/src/python_executor.rs @@ -2396,7 +2396,7 @@ for line in sys.stdin: PyV::parse_from_requirements(&split_python_requirements(requirements.as_str())) } else { tracing::warn!(workspace_id = %w_id, "lockfile is empty for dedicated worker, thus python version cannot be inferred. Fallback to 3.11"); - PyVAlias::Py311.into() + PyVAlias::default().into() }; let python_path = py_version diff --git a/backend/windmill-worker/src/python_versions.rs b/backend/windmill-worker/src/python_versions.rs index 0b8d7da6ef..debe54ebf0 100644 --- a/backend/windmill-worker/src/python_versions.rs +++ b/backend/windmill-worker/src/python_versions.rs @@ -373,7 +373,7 @@ impl PyV { // If there is no assigned version in lockfile we automatically fallback to 3.11 // In this case we have dependencies or other metadata, but no associated python version // This is the case for old deployed scripts - PyVAlias::Py311.into(), + PyVAlias::default().into(), ) } @@ -449,6 +449,7 @@ impl PyV { } res } + async fn get_python_inner( &self, job_id: &Uuid, @@ -462,20 +463,24 @@ impl PyV { let py_path = self.find_python().await; // Runtime is not installed - if py_path.is_err() { + if let Err(py_err) = py_path { // Install it if let Err(err) = self .install_python(job_id, mem_peak, conn, worker_name, w_id, occupancy_metrics) .await { - tracing::error!("Cannot install python: {err}"); + tracing::error!( + "Cannot install python: {err}, after runtime wasn't found: {py_err}" + ); return Err(err); } else { // Try to find one more time let py_path = self.find_python().await; if let Err(err) = py_path { - tracing::error!("Cannot find python version {err}"); + tracing::error!( + "Cannot find python version {err} after runtime wasn't found: {py_err}" + ); return Err(err); } diff --git a/backend/windmill-worker/src/worker.rs b/backend/windmill-worker/src/worker.rs index 5cc4972c32..117c051266 100644 --- a/backend/windmill-worker/src/worker.rs +++ b/backend/windmill-worker/src/worker.rs @@ -637,7 +637,9 @@ pub async fn is_otel_tracing_proxy_enabled_for_lang(lang: &ScriptLang) -> bool { /// Get proxy environment variables for job execution for a specific language. /// When OTEL tracing proxy is enabled for this language, routes all traffic through the proxy. /// Otherwise, uses the standard HTTP_PROXY/HTTPS_PROXY from environment. -pub async fn get_proxy_envs_for_lang(lang: &ScriptLang) -> anyhow::Result> { +pub async fn get_proxy_envs_for_lang( + lang: &ScriptLang, +) -> anyhow::Result> { #[cfg(all(feature = "private", feature = "enterprise"))] if is_otel_tracing_proxy_enabled_for_lang(lang).await { return get_otel_tracing_proxy_envs().await; @@ -664,7 +666,10 @@ async fn get_otel_tracing_proxy_envs() -> anyhow::Result