mickael-kerjean/filestash · error
Filestash needs to be able to create and edit its configurat
Error message
Filestash needs to be able to create and edit its configuration, but it currently cannot. Change the permissions to allow writing to `%s`
What it means
Returned by SaveConfig when os.OpenFile on config.json (with O_WRONLY|O_CREATE|O_TRUNC, mode 0660) fails — typically EACCES/EPERM because the Filestash process user cannot write to its configuration directory, or the path is read-only. Config changes cannot be persisted until the write permission is fixed.
Source
Thrown at server/pkg/config/config_state.go:78
break
}
Log.Warning("common::config_state::load cannot decrypt config path '%s': %s", jsonPathWithEncryptedData, err.Error())
continue
}
val, err := sjson.Set(configStr, jsonPathWithEncryptedData, t)
if err != nil {
Log.Warning("common::config_state::load cannot put json value in config '%s': %s", jsonPathWithEncryptedData, err.Error())
continue
}
configStr = val
}
return []byte(configStr), nil
}
func SaveConfig(v []byte) error {
file, err := os.OpenFile(GetAbsolutePath(CONFIG_PATH, "config.json"), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0660)
if err != nil {
return fmt.Errorf(
APPNAME+" needs to be able to create and edit its configuration, but it currently cannot. "+
"Change the permissions to allow writing to `%s`",
GetAbsolutePath(CONFIG_PATH, "config.json"),
)
}
configStr := string(v)
var (
key = defaultValue(SECRET_KEY_DERIVATE_FOR_PROOF, "CONFIG_SECRET")
toEncrypt = defaultValue(true, "CONFIG_ENCRYPT")
)
for _, jsonPathWithEncryptedData := range configKeysToEncrypt {
if !toEncrypt {
continue
}
p := gjson.Get(configStr, jsonPathWithEncryptedData).String()
if p == "" {View on GitHub (pinned to 78f756eb94)
Solutions
- chown/chmod the config.json file and its directory so the Filestash process user has read-write access
- Check for immutable flags (chattr +i), read-only mounts, or disk-full conditions
- Run the server under a user with write access to the config path, or relocate CONFIG_PATH to a writable location
- Verify after fix that Save() completes and config.json is updated
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at server/pkg/config/config_state.go:78 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of mickael-kerjean/filestash@78f756eb94 (2026-09-06).
Data as JSON: /api/errors/0d3d92724716fc74.
Report an issue: GitHub.