{"record":{"id":"b88fc74d59db9517","repo":"juanfont/headscale","slug":"major-version-change-not-supported","errorCode":null,"errorMessage":"major version change not supported","messagePattern":"major version change not supported","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hscontrol/db/versioncheck.go","lineNumber":21,"sourceCode":"import (\n\t\"errors\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/juanfont/headscale/hscontrol/types\"\n\t\"github.com/rs/zerolog/log\"\n\t\"gorm.io/gorm\"\n\t\"gorm.io/gorm/clause\"\n)\n\nvar errVersionUpgrade = errors.New(\"version upgrade not supported\")\n\nvar errVersionDowngrade = errors.New(\"version downgrade not supported\")\n\nvar errVersionMajorChange = errors.New(\"major version change not supported\")\n\nvar errVersionParse = errors.New(\"cannot parse version\")\n\nvar errVersionFormat = errors.New(\n\t\"version does not follow semver major.minor.patch format\",\n)\n\n// DatabaseVersion tracks the headscale version that last\n// successfully started against this database.\n// It is a single-row table (ID is always 1).\ntype DatabaseVersion struct {\n\tID        uint   `gorm:\"primaryKey\"`\n\tVersion   string `gorm:\"not null\"`\n\tUpdatedAt time.Time\n}\n\n// semver holds parsed major.minor.patch components.\ntype semver struct {","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/hscontrol/db/versioncheck.go#L3-L39","documentation":"Error \"major version change not supported\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at hscontrol/db/versioncheck.go:21 when the library encounters an invalid state.","commonSituations":"A database from a different major headscale version cannot be opened. Follow the documented upgrade path between major versions instead of pointing the new binary at the old database.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (major version change not supported); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (major version change not supported); retry the operation after fixing the input, configuration, or environment.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"565fd254d06c4c7f9a8cad1714a43445c79ba420","analyzedAt":"2026-08-15T13:12:30.133Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}