{"record":{"id":"4e2c9160ebd7c13b","repo":"zellij-org/zellij","slug":"failed-to-serialize-user-configuration","errorCode":null,"errorMessage":"Failed to serialize user configuration: {:?}","messagePattern":"Failed to serialize user configuration: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"zellij-server/src/plugins/plugin_loader.rs","lineNumber":226,"sourceCode":"        )));\n        self.plugin_map.insert(\n            self.plugin_id,\n            self.client_id,\n            plugin.clone(),\n            subscriptions,\n            workers,\n        );\n\n        start_function\n            .call(&mut plugin.lock().unwrap().store, ())\n            .with_context(err_context)?;\n\n        let protobuf_plugin_configuration: ProtobufPluginConfiguration = self\n            .plugin_config\n            .initial_userspace_configuration\n            .clone()\n            .try_into()\n            .map_err(|e| anyhow!(\"Failed to serialize user configuration: {:?}\", e))?;\n        let protobuf_bytes = protobuf_plugin_configuration.encode_to_vec();\n        wasi_write_object(plugin.lock().unwrap().store.data(), &protobuf_bytes)\n            .with_context(err_context)?;\n        load_function\n            .call(&mut plugin.lock().unwrap().store, ())\n            .with_context(err_context)?;\n\n        Ok(())\n    }\n    pub fn create_plugin_environment(\n        &self,\n        module: Module,\n    ) -> Result<(Store<PluginEnv>, Instance)> {\n        let err_context = || {\n            format!(\n                \"Failed to create instance, plugin env and subscriptions for plugin {}\",\n                self.plugin_id\n            )","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/zellij-org/zellij/blob/98a0837077492d53dd252ab30bc3e43e41e504f4/zellij-server/src/plugins/plugin_loader.rs#L208-L244","documentation":"Raised in load_plugin_instance when converting the plugin's initial_userspace_configuration into the protobuf representation sent over the WASI boundary. The TryInto<ProtobufPluginConfiguration> failed, so the plugin never receives its configuration and never gets its load() call.","triggerScenarios":"A `run_plugin` block in a layout or config supplies userspace config values whose types/contents cannot be represented in the protobuf schema (e.g. nested structures or key/value types not accepted by the conversion).","commonSituations":"Hand-edited layout KDL with custom plugin configuration; upgrading zellij where the protobuf config schema changed but the layout still carries old-style config; typos in config keys that produce unsupported value types.","solutions":["Inspect the {:?} payload in the log: it names the exact field that failed TryInto","Simplify the plugin's userspace configuration to primitive string/bool/number values and re-test","Match your plugin's expected configuration schema with the zellij version you compile/run against (rebuild plugin with the same zellij-tile version)","Validate the layout/config with `zellij setup --check` before launching"],"exampleFix":"```kdl\n// before - nested value the conversion rejects\nrun_plugin \"file:~/plugin.wasm\" {\n    config { theme { fg \"#fff\" } }\n}\n// after - flat primitive values\nrun_plugin \"file:~/plugin.wasm\" {\n    config { theme_fg \"#ffffff\" }\n}\n```","handlingStrategy":"validation","validationCode":"```bash\nzellij setup --check  # validates config/layout before launching\n```","typeGuard":null,"tryCatchPattern":"match plugin_config.initial_userspace_configuration.clone().try_into() {\n    Ok(proto) => { /* proceed */ },\n    Err(e) => log::warn!(\"unsupported plugin config value: {e:?}\"),\n}","preventionTips":["Keep plugin userspace config to flat string/bool/number values","Rebuild plugins with the zellij-tile version matching the running zellij"],"tags":["plugin","protobuf","configuration","layout"],"backgroundTag":null,"analyzedSha":"98a0837077492d53dd252ab30bc3e43e41e504f4","analyzedAt":"2026-08-16T13:02:01.396Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}