{"record":{"id":"541c10408424fa9b","repo":"zellij-org/zellij","slug":"found-no-sender-to-send-plugin-instruction-to","errorCode":null,"errorMessage":"found no sender to send plugin instruction to","messagePattern":"found no sender to send plugin instruction to","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"zellij-server/src/plugins/zellij_exports.rs","lineNumber":3998,"sourceCode":"                    let send_plugin_instructions = env.senders.to_plugin.clone();\n                    let update_target = Some(env.plugin_id);\n                    let client_id = env.client_id;\n                    thread::spawn({\n                        move || {\n                            let mut paths_in_folder = vec![];\n                            for entry in reading_folder {\n                                if let Ok(entry) = entry {\n                                    let entry_metadata = entry.metadata().ok().map(|m| m.into());\n                                    paths_in_folder.push((\n                                        PathBuf::from(\"/host\").join(\n                                            entry.path().strip_prefix(&plugin_host_folder).unwrap(),\n                                        ),\n                                        entry_metadata.into(),\n                                    ));\n                                }\n                            }\n                            let _ = send_plugin_instructions\n                                .ok_or(anyhow!(\"found no sender to send plugin instruction to\"))\n                                .map(|sender| {\n                                    let _ = sender.send(PluginInstruction::Update(vec![(\n                                        update_target,\n                                        Some(client_id),\n                                        Event::FileSystemUpdate(paths_in_folder),\n                                    )]));\n                                })\n                                .non_fatal();\n                        }\n                    });\n                },\n                Err(e) => {\n                    log::error!(\"Failed to read folder {}: {e}\", folder_to_scan.display());\n                },\n            }\n        },\n        Err(e) => {\n            log::error!(","sourceCodeStart":3980,"sourceCodeEnd":4016,"githubUrl":"https://github.com/zellij-org/zellij/blob/98a0837077492d53dd252ab30bc3e43e41e504f4/zellij-server/src/plugins/zellij_exports.rs#L3980-L4016","documentation":"The filesystem-watch thread (spawned per watch request) needs the plugin-instruction sender to deliver Event::FileSystemUpdate. This non-fatal error logs when senders.to_plugin is None at delivery time — the sender channel was never present or was dropped, most commonly because the session is shutting down while the watcher thread is still running.","triggerScenarios":"A plugin subscribes to filesystem watching and the session exits (or the plugin is unloaded, dropping the senders) before the watcher thread emits its next update; running in a context where the plugin bus sender was never wired.","commonSituations":"Quitting zellij while a filesystem-watching plugin is active; plugin pane closed while its watch thread is mid-read; test harnesses that build PluginEnv without a real sender.","solutions":["No action needed for users — it is non-fatal and expected during shutdown races","Unsubscribe/stop watching in the plugin's cleanup path to terminate watcher threads earlier","If developing zellij, consider swapping the ok_or/map chain for a plain if-let so shutdown does not log an error"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// treat missing sender as shutdown, not error\nif let Some(sender) = send_plugin_instructions {\n    let _ = sender.send(PluginInstruction::Update(vec![(update_target, Some(client_id), Event::FileSystemUpdate(paths))]));\n}","preventionTips":["Stop filesystem watchers in plugin cleanup so threads exit before senders drop","Ignore this message when it coincides with session exit"],"tags":["filesystem","watch","shutdown","race","non-fatal"],"backgroundTag":null,"analyzedSha":"98a0837077492d53dd252ab30bc3e43e41e504f4","analyzedAt":"2026-08-16T13:02:01.396Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}