sipeed/picoclaw · error

V1→V2 migration failed

Error message

V1→V2 migration failed: %w

What it means

Returned during config load when the V0→V1 migration succeeded but migrateV1ToV2 failed to transform the map to the V2 layout (missing channels/models keys the migrator expects, unexpected value types). The wrapped %w carries the transformation error; load aborts before marshal/write-back.

Solutions

  1. Inspect the wrapped error for which V1 structure was rejected
  2. Restore from backup and fix the offending section, or manually port the config to the current version
  3. Report if a legitimately-shaped V1 config fails the migrator
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at pkg/config/config.go:1356 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/763e5d5ab700bbdc. Report an issue: GitHub.

Appendix: source

Thrown at pkg/config/config.go:1356

		var m map[string]any
		m, err = loadConfigMap(path)
		if err != nil {
			logger.ErrorCF(
				"config",
				formatDiagnosticLogMessage("Failed to load config", err),
				map[string]any{"path": path},
			)
			return nil, err
		}

		migrateErr := migrateV0ToV1(m)
		if migrateErr != nil {
			return nil, fmt.Errorf("V0→V1 migration failed: %w", migrateErr)
		}
		migrateErr = migrateV1ToV2(m)
		if migrateErr != nil {
			return nil, fmt.Errorf("V1→V2 migration failed: %w", migrateErr)
		}
		migrateErr = migrateV2ToV3(m)
		if migrateErr != nil {
			return nil, fmt.Errorf("V2→V3 migration failed: %w", migrateErr)
		}

		var migrated []byte
		migrated, err = json.Marshal(m)
		if err != nil {
			return nil, err
		}

		cfg, err = loadConfig(migrated)
		if err != nil {
			return nil, err
		}

		err = MakeBackup(path)

View on GitHub (pinned to 49183d7e8d)