{"record":{"id":"9dc8f79217c9d60e","repo":"influxdata/influxdb","slug":"external-call-failed-0","errorCode":null,"errorMessage":"External call failed: {0}","messagePattern":"External call failed: (.+?)","errorType":"exception","errorClass":"PluginEnvironmentError","httpStatus":null,"severity":"error","filePath":"influxdb3_processing_engine/src/environment.rs","lineNumber":17,"sourceCode":"use crate::environment::PluginEnvironmentError::PluginEnvironmentDisabled;\n\nuse crate::virtualenv::{VenvError, find_python, initialize_venv};\nuse observability_deps::tracing::debug;\nuse pyo3::prelude::PyAnyMethods;\nuse pyo3::{PyResult, Python};\nuse std::fmt::Debug;\nuse std::path::{Path, PathBuf};\nuse std::process::Command;\nuse std::sync::{Arc, OnceLock};\nuse thiserror::Error;\n\n#[derive(Error, Debug)]\npub enum PluginEnvironmentError {\n    #[error(\"Package manager not available: {0}\")]\n    PackageManagerNotFound(String),\n    #[error(\"External call failed: {0}\")]\n    InstallationFailed(#[from] std::io::Error),\n    #[error(\"Plugin environment management is disabled\")]\n    PluginEnvironmentDisabled,\n\n    #[error(\"Virtual environment error: {0}\")]\n    VenvError(#[from] VenvError),\n\n    #[error(\"Failed to list packages: {0}\")]\n    PackageListFailed(String),\n\n    #[error(\n        \"Package installation has been disabled. Contact your administrator for more information.\"\n    )]\n    PackageInstallationDisabled,\n}\n\npub trait PythonEnvironmentManager: Debug + Send + Sync + 'static {\n    fn init_pyenv(","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_processing_engine/src/environment.rs#L1-L35","documentation":"PluginEnvironmentError::InstallationFailed wraps a std::io::Error (via #[from]) raised when an external process call (package manager or shell command) made by the plugin environment manager fails. The message carries the io::Error details (e.g. command spawn failure or non-zero-exit representation).","triggerScenarios":"Plugin environment setup runs Command::new(...) for venv creation or package installation and the process fails to spawn (binary missing, permission denied) or the call returns an io error (broken pipe, interrupted).","commonSituations":"python3 not executable by the influxdb3 user; EACCES on package manager; network-less install commands failing at the OS layer; container lacks /tmp exec permissions breaking venv creation.","solutions":["Inspect the wrapped std::io::Error in the message for the failing command and errno","Ensure the binaries invoked (python3, package manager) exist and are executable by the influxdb3 user","Run with sufficient filesystem permissions (writable plugin env directory, exec on /tmp)","Retry the plugin environment setup after fixing the environment; check OS-level limits"],"exampleFix":"// before\n// InvocationFailed(io::Error): No such file or directory (os error 2)\n// after: ensure the binary exists before setup\nif which(\"python3\").is_err() {\n    install_python3()?;\n}\nenv_manager.setup(plugin).await?;","handlingStrategy":"try-catch","validationCode":"# pre-check the external command before env setup\ntest -x \"$(command -v python3)\" || { echo 'python3 not executable'; exit 1; }\ntest -w /var/lib/influxdb3/plugins || { echo 'plugin dir not writable'; exit 1; }","typeGuard":"fn is_installation_failed(e: &PluginEnvironmentError) -> Option<&std::io::Error> {\n    if let PluginEnvironmentError::InstallationFailed(io) = e { Some(io) } else { None }\n}","tryCatchPattern":"match env_manager.setup(plugin).await {\n    Err(PluginEnvironmentError::InstallationFailed(io)) => {\n        eprintln!(\"external call failed: {io}; check binaries and permissions\");\n        Err(io.into())\n    }\n    other => other,\n}","preventionTips":["Verify all external binaries exist and are executable before setup","Grant the influxdb3 user write access to the plugin env directory","Ensure /tmp is executable in containers","Check ulimits and SELinux/AppArmor policies"],"tags":["rust","io-error","plugin-environment","process"],"backgroundTag":"command-not-found","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}