sipeed/picoclaw · error
failed to create config backup
Error message
failed to create config backup: %w
What it means
Raised by MakeBackup when copying the existing config file to its dated .bak copy fails (read/write/permission error). The backup step aborts so a reset or save never proceeds without a recoverable copy of the previous config.
Solutions
- Check file permissions on the config file and its directory
- Verify sufficient disk space for the backup copy
- Remove stale .bak files or locks in the config directory
- Create the backup manually before retrying the operation
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at pkg/config/config.go:1646 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15).
Data as JSON: /api/errors/6dc98403beb40ece.
Report an issue: GitHub.
Appendix: source
Thrown at pkg/config/config.go:1646
githubCfg.AuthToken = *NewSecureString(value)
}
if value, envSet := os.LookupEnv(envSkillsGitHubProxy); envSet {
githubCfg.Param["proxy"] = value
}
cfg.Tools.Skills.Registries.Set("github", githubCfg)
}
func MakeBackup(path string) error {
if _, err := os.Stat(path); os.IsNotExist(err) {
return nil
}
dateSuffix := time.Now().Format(".20060102.bak")
// Backup config file
bakPath := path + dateSuffix
if err := fileutil.CopyFile(path, bakPath, 0o600); err != nil {
logger.ErrorF("failed to create config backup", map[string]any{"error": err})
return fmt.Errorf("failed to create config backup: %w", err)
}
// Backup security config file
secPath := securityPath(path)
if _, err := os.Stat(secPath); err == nil {
secBakPath := secPath + dateSuffix
if secErr := fileutil.CopyFile(secPath, secBakPath, 0o600); secErr != nil {
logger.ErrorF("failed to create security backup", map[string]any{"error": secErr})
return fmt.Errorf("failed to create security backup: %w", secErr)
}
}
return nil
}
func toNameIndex(list []*ModelConfig) []string {
nameList := make([]string, 0, len(list))
countMap := make(map[string]int)
for _, model := range list {
name := model.ModelNameView on GitHub (pinned to 49183d7e8d)