matryer/xbar · error
write plugin file %s
Error message
write plugin file %s
What it means
Returned by writePluginFiles when io.Copy fails while streaming the plugin file content from memory into the newly created file on disk. It wraps the write error with the plugin file path. On most local filesystems this is rare and points to an I/O-level problem (disk full, device error) or an issue with the writer being closed/unusable.
Source
Thrown at pkg/plugins/install.go:126
return errors.New("no plugin files")
}
if len(plugin.Files) > 1 {
return errors.Errorf("only one plugin file supported: found %d.", len(plugin.Files))
}
for _, f := range plugin.Files {
pluginFile := dstPath
dir := path.Dir(pluginFile)
if err := os.MkdirAll(dir, 0777); err != nil {
return errors.Wrapf(err, "create directory %s for plugin", dir)
}
writer, err := os.Create(pluginFile)
if err != nil {
return errors.Wrapf(err, "create plugin file %s", f.Path)
}
defer writer.Close()
reader := strings.NewReader(f.Content)
if _, err := io.Copy(writer, reader); err != nil {
return errors.Wrapf(err, "write plugin file %s", f.Path)
}
// If the Filename property of the current file matches the Filename
// property of the plugin, this is the entry point, so set it to be
// executable.
if f.Filename != plugin.Filename {
continue
}
if err := os.Chmod(pluginFile, 0755); err != nil {
return errors.Wrap(err, "set executable permission on plugin entry point")
}
// write the default variables
plugin, err := metadata.Parse(metadata.DebugfNoop, pluginFile, f.Content)
if err != nil {
log.Println("install plugin: unable to parse metadata:", err)
}
if len(plugin.Vars) > 0 {
defaultVars := make(map[string]interface{})
for _, pluginVar := range plugin.Vars {View on GitHub (pinned to d624239058)
Solutions
- Free disk space or increase quota (df -h, check du of the plugin dir).
- Check filesystem health (dmesg / smartctl) if errors persist.
- Retry the install after confirming the volume is writable.
Defensive patterns
Strategy: try-catch
Validate before calling
if st, err := os.Stat(filepath.Dir(dstPath)); err != nil || !st.IsDir() {
return fmt.Errorf("plugin dir not ready")
}
// also check free space via syscall.Statfs when on Linux Try / catch
err := installer.Install(plugin)
var pe *os.PathError
if errors.As(err, &pe) && errors.Is(pe.Err, syscall.ENOSPC) {
log.Fatalf("disk full while writing plugin file: %s", pe.Path)
}
return err Prevention
- Monitor free disk space on the volume hosting PluginDir.
- Avoid installing plugins on flaky network filesystems.
- Retry installs idempotently — writePluginFiles overwrites on retry.
- Keep plugin file content sizes reasonable.
When it happens
Trigger: Installer.Install -> writePluginFiles when the io.Copy(writer, strings.NewReader(f.Content)) write fails: no space left on device, I/O error on the underlying filesystem, or the file handle became invalid after os.Create.
Common situations: Disk filling up mid-install; failing hardware or network filesystem (NFS) drop; extremely large plugin content exceeding quota between create and write.
Related errors
- create directory %s for plugin
- create plugin file %s
- set executable permission on plugin entry point
- write default variables
- ReadAll
AI-assisted analysis of matryer/xbar@d624239058 (2026-09-02).
Data as JSON: /api/errors/7193880ad827a383.
Report an issue: GitHub.