{"record":{"id":"1df5f2c51f5db651","repo":"influxdata/influxdb","slug":"failed-to-list-packages-0","errorCode":null,"errorMessage":"Failed to list packages: {0}","messagePattern":"Failed to list packages: (.+?)","errorType":"exception","errorClass":"PluginEnvironmentError","httpStatus":null,"severity":"warning","filePath":"influxdb3_processing_engine/src/environment.rs","lineNumber":25,"sourceCode":"use 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(\n        &self,\n        plugin_dir: Option<&Path>,\n        virtual_env_location: Option<&PathBuf>,\n    ) -> Result<(), PluginEnvironmentError>;\n    fn install_packages(&self, packages: Vec<String>) -> Result<(), PluginEnvironmentError>;\n\n    fn install_requirements(&self, requirements_path: String)\n    -> Result<(), PluginEnvironmentError>;","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_processing_engine/src/environment.rs#L7-L43","documentation":"PluginEnvironmentError::PackageListFailed is thrown when the environment manager fails to list installed packages in a plugin's Python environment (e.g. output of pip list could not be obtained or parsed). It carries a String describing the failure.","triggerScenarios":"Calling the environment manager's package-listing operation for a plugin venv where the listing command fails to run or returns unusable output.","commonSituations":"pip missing or broken inside the venv; venv deleted or corrupted after creation; pip output format changed by a pip version upgrade breaking parsing; low disk or permissions causing pip to fail.","solutions":["Check the String detail to see whether the listing command failed or its output was unparseable","Recreate the plugin's virtual environment (delete and re-run environment setup)","Ensure pip is installed and functional inside the venv (python -m ensurepip --upgrade)","Pin a pip version whose `pip list` output format the manager supports"],"exampleFix":"# before: listing fails due to missing pip\npython3 -m venv /path/venv\n# after\npython3 -m venv /path/venv && /path/venv/bin/python -m ensurepip --upgrade\n/path/venv/bin/pip list","handlingStrategy":"retry","validationCode":"# ensure pip works in the plugin venv before listing packages\n\"$VENV/bin/python\" -m pip --version >/dev/null 2>&1 \\\n  || { echo 'pip unavailable in venv'; \"$VENV/bin/python\" -m ensurepip --upgrade; }","typeGuard":null,"tryCatchPattern":"match env_manager.list_packages(plugin).await {\n    Err(PluginEnvironmentError::PackageListFailed(detail)) => {\n        eprintln!(\"package listing failed: {detail}; recreating venv\");\n        recreate_venv(plugin).await?;\n        env_manager.list_packages(plugin).await\n    }\n    ok => ok,\n}","preventionTips":["Ensure pip is installed and healthy inside each plugin venv","Recreate venvs that were interrupted mid-creation","Pin pip versions known to work with the environment manager's parser","Monitor venv directory integrity and disk space"],"tags":["rust","pip","plugin-environment","python"],"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"}