{"record":{"id":"9cdb8fa60934758b","repo":"zellij-org/zellij","slug":"failed-to-parse-plugin-location","errorCode":null,"errorMessage":"Failed to parse plugin location: {}","messagePattern":"Failed to parse plugin location: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"zellij-server/src/plugins/zellij_exports.rs","lineNumber":3292,"sourceCode":"    let tab_id: FocusOrCreateTabResponse = result.and_then(|r| r.affected_tab_id);\n\n    let response = ProtobufFocusOrCreateTabResponse::from(tab_id);\n    wasi_write_object(env, &response.encode_to_vec()).non_fatal();\n}\n\nfn go_to_tab(env: &PluginEnv, tab_index: u32) {\n    let error_msg = || format!(\"failed to change tab focus in plugin {}\", env.name());\n    let action = Action::GoToTab {\n        index: tab_index + 1,\n    };\n    apply_action!(action, error_msg, env);\n}\n\nfn start_or_reload_plugin(env: &PluginEnv, url: &str) -> Result<()> {\n    let error_msg = || format!(\"failed to start or reload plugin in plugin {}\", env.name());\n    let cwd = std::env::current_dir().unwrap_or_else(|_| PathBuf::from(\".\"));\n    let run_plugin_or_alias = RunPluginOrAlias::from_url(url, &None, None, Some(cwd))\n        .map_err(|e| anyhow!(\"Failed to parse plugin location: {}\", e))?;\n    let action = Action::StartOrReloadPlugin {\n        plugin: run_plugin_or_alias,\n    };\n    apply_action!(action, error_msg, env);\n    Ok(())\n}\n\nfn close_terminal_pane(env: &PluginEnv, terminal_pane_id: u32) {\n    let error_msg = || format!(\"failed to change tab focus in plugin {}\", env.name());\n    let action = Action::CloseTerminalPane {\n        pane_id: terminal_pane_id,\n    };\n    apply_action!(action, error_msg, env);\n    env.senders\n        .send_to_pty(PtyInstruction::ClosePane(\n            PaneId::Terminal(terminal_pane_id),\n            None,\n        ))","sourceCodeStart":3274,"sourceCodeEnd":3310,"githubUrl":"https://github.com/zellij-org/zellij/blob/98a0837077492d53dd252ab30bc3e43e41e504f4/zellij-server/src/plugins/zellij_exports.rs#L3274-L3310","documentation":"start_or_reload_plugin converts a plugin URL string into a RunPluginOrAlias via RunPluginOrAlias::from_url, resolving file: paths, plugin aliases, and built-in plugin names against the cwd. This error means the URL could not be parsed or its target could not be resolved to an actual plugin artifact.","triggerScenarios":"Passing a URL with an unsupported scheme, a malformed path, a plugin alias that is not configured in the user's plugin aliases, or a file: path that does not exist / is not a .wasm file.","commonSituations":"Plugin marketplaces/managers calling start_or_reload_plugin with user-entered URLs; aliases defined in one machine's config but missing on another; relative paths resolved against a cwd that moved.","solutions":["Check the {} detail — it distinguishes unknown alias, bad scheme, and file-not-found","For file URLs use an absolute path: file:/home/user/plugin.wasm","If using an alias, make sure it is declared under plugin_aliases in the user config","Verify the file exists and is a valid .wasm built for WASI"],"exampleFix":"// before\nstart_or_reload_plugin(&env, \"file:./plugin.wasm\")?; // relative to server cwd, may miss\n\n// after\nstart_or_reload_plugin(&env, &format!(\"file:{}\", wasm_path.display()))?; // absolute path","handlingStrategy":"validation","validationCode":"fn resolvable_plugin_url(url: &str, aliases: &PluginAliases) -> bool {\n    url.starts_with(\"file:\") && std::path::Path::new(url.trim_start_matches(\"file:\")).exists()\n        || aliases.contains(url)\n        || BUILTIN_PLUGINS.contains(&url)\n}","typeGuard":null,"tryCatchPattern":"match RunPluginOrAlias::from_url(url, &None, None, Some(cwd.clone())) {\n    Ok(p) => apply_action!(Action::StartOrReloadPlugin { plugin: p }, error_msg, env),\n    Err(e) => log::warn!(\"bad plugin location {url}: {e}\"),\n}","preventionTips":["Use absolute file: paths for plugin URLs","Declare custom aliases in plugin_aliases config before referencing them"],"tags":["plugin","url","filesystem","alias","plugin-loader"],"backgroundTag":null,"analyzedSha":"98a0837077492d53dd252ab30bc3e43e41e504f4","analyzedAt":"2026-08-16T13:02:01.396Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}