{"record":{"id":"7e2776c9b28df313","repo":"juanfont/headscale","slug":"cannot-parse-version","errorCode":null,"errorMessage":"cannot parse version","messagePattern":"cannot parse version","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hscontrol/db/versioncheck.go","lineNumber":23,"sourceCode":"\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 {\n\tMajor int\n\tMinor int","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/hscontrol/db/versioncheck.go#L5-L41","documentation":"Error \"cannot parse version\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at hscontrol/db/versioncheck.go:23 when the library encounters an invalid state.","commonSituations":"A stored or supplied version string could not be parsed. Ensure versions follow the major.minor.patch format; this usually indicates a corrupted version record or an invalid build version.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (cannot parse version); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (cannot parse version); 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"}