zellij-org/zellij · error

Failed to serialize user configuration: {:?}

Error message

Failed to serialize user configuration: {:?}

What it means

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.

Source

Thrown at zellij-server/src/plugins/plugin_loader.rs:226

        )));
        self.plugin_map.insert(
            self.plugin_id,
            self.client_id,
            plugin.clone(),
            subscriptions,
            workers,
        );

        start_function
            .call(&mut plugin.lock().unwrap().store, ())
            .with_context(err_context)?;

        let protobuf_plugin_configuration: ProtobufPluginConfiguration = self
            .plugin_config
            .initial_userspace_configuration
            .clone()
            .try_into()
            .map_err(|e| anyhow!("Failed to serialize user configuration: {:?}", e))?;
        let protobuf_bytes = protobuf_plugin_configuration.encode_to_vec();
        wasi_write_object(plugin.lock().unwrap().store.data(), &protobuf_bytes)
            .with_context(err_context)?;
        load_function
            .call(&mut plugin.lock().unwrap().store, ())
            .with_context(err_context)?;

        Ok(())
    }
    pub fn create_plugin_environment(
        &self,
        module: Module,
    ) -> Result<(Store<PluginEnv>, Instance)> {
        let err_context = || {
            format!(
                "Failed to create instance, plugin env and subscriptions for plugin {}",
                self.plugin_id
            )

View on GitHub (pinned to 98a0837077)

Solutions

  1. Inspect the {:?} payload in the log: it names the exact field that failed TryInto
  2. Simplify the plugin's userspace configuration to primitive string/bool/number values and re-test
  3. Match your plugin's expected configuration schema with the zellij version you compile/run against (rebuild plugin with the same zellij-tile version)
  4. Validate the layout/config with `zellij setup --check` before launching

Example fix

```kdl
// before - nested value the conversion rejects
run_plugin "file:~/plugin.wasm" {
    config { theme { fg "#fff" } }
}
// after - flat primitive values
run_plugin "file:~/plugin.wasm" {
    config { theme_fg "#ffffff" }
}
```
Defensive patterns

Strategy: validation

Validate before calling

```bash
zellij setup --check  # validates config/layout before launching
```

Try / catch

match plugin_config.initial_userspace_configuration.clone().try_into() {
    Ok(proto) => { /* proceed */ },
    Err(e) => log::warn!("unsupported plugin config value: {e:?}"),
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of zellij-org/zellij@98a0837077 (2026-08-16). Data as JSON: /api/errors/4e2c9160ebd7c13b. Report an issue: GitHub.