ipfs/kubo · warning
source field %s does not exist
Error message
source field %s does not exist
What it means
migrations.MoveField returns this when the source field `from` does not exist in the config map (GetField reported !exists). Migration helpers assume the field is present when reorganizing old configs into new shapes.
Source
Thrown at repo/fsrepo/migrations/common/config_helpers.go:108
return false
}
parentMap, ok := parent.(map[string]any)
if !ok {
return false
}
fieldName := parts[len(parts)-1]
_, exists = parentMap[fieldName]
delete(parentMap, fieldName)
return exists
}
// MoveField moves a field from one location to another
func MoveField(config map[string]any, from, to string) error {
value, exists := GetField(config, from)
if !exists {
return fmt.Errorf("source field %s does not exist", from)
}
SetField(config, to, value)
DeleteField(config, from)
return nil
}
// RenameField renames a field within the same parent
func RenameField(config map[string]any, path, oldName, newName string) error {
var parent map[string]any
if path == "" {
parent = config
} else {
p, exists := GetField(config, path)
if !exists {
return fmt.Errorf("parent path %s does not exist", path)
}
var ok boolView on GitHub (pinned to 329838acdf)
Solutions
- Check the field exists first with GetField and skip MoveField if absent
- Make the migration idempotent: if GetField(config, to) already has the value, return nil
- Manually inspect ~/.ipfs/config and add the missing field or migrate by hand
Example fix
// before
if err := MoveField(config, "Experimental.ShardingEnabled", "Replication"); err != nil { return err }
// after
if _, exists := GetField(config, "Experimental.ShardingEnabled"); exists {
if err := MoveField(config, "Experimental.ShardingEnabled", "Replication"); err != nil { return err }
} Defensive patterns
Strategy: validation
Validate before calling
if _, exists := GetField(config, from); !exists {
return nil // nothing to move; migration already applied or field never set
} Try / catch
if err := MoveField(config, from, to); err != nil {
if strings.Contains(err.Error(), "does not exist") { return nil } // idempotent skip
return err
} Prevention
- Make migrations idempotent by checking source presence first
- Handle already-migrated configs (field present at `to`)
- Inspect the config file when a migration fails to see actual field names
When it happens
Trigger: Running a migration (e.g. ipfs migrate to a new version) on a config file where the expected field was never set, already moved, removed, or spelled differently; running the same migration twice.
Common situations: Users with hand-edited or very old/minimal configs upgrading Kubo; re-running interrupted migrations where the field was already relocated to `to`.
Related errors
- mountFuse: GetConfig() failed: %s
- %s path cannot be empty
- Provide.DHT.KeystoreBatchSize must be positive, got %d
- Provide.DHT.OfflineDelay must be non-negative, got %v
- Provide.DHT.SendProviderRecordTimeout must be positive, got
AI-assisted analysis of ipfs/kubo@329838acdf (2026-09-03).
Data as JSON: /api/errors/9db954e3c3137e1e.
Report an issue: GitHub.