{"record":{"id":"6e35bddcf956ece5","repo":"AdguardTeam/AdGuardHome","slug":"bad-value-for-q-key-w","errorCode":null,"errorMessage":"bad value for %q key: %w","messagePattern":"bad value for %q key: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/updater/check.go","lineNumber":110,"sourceCode":"\tdata []byte,\n) (vi VersionInfo, err error) {\n\tinfo := VersionInfo{\n\t\tCanAutoUpdate: aghalg.NBFalse,\n\t}\n\tversionJSON := map[string]string{\n\t\t\"version\":          \"\",\n\t\t\"announcement\":     \"\",\n\t\t\"announcement_url\": \"\",\n\t}\n\terr = json.Unmarshal(data, &versionJSON)\n\tif err != nil {\n\t\treturn info, fmt.Errorf(\"version.json: %w\", err)\n\t}\n\n\tfor k, v := range versionJSON {\n\t\terr = validate.NotEmpty(\"version_json_value\", v)\n\t\tif err != nil {\n\t\t\treturn info, fmt.Errorf(\"bad value for %q key: %w\", k, err)\n\t\t}\n\t}\n\n\tinfo.NewVersion = versionJSON[\"version\"]\n\tinfo.Announcement = versionJSON[\"announcement\"]\n\tinfo.AnnouncementURL = versionJSON[\"announcement_url\"]\n\n\tpackageURL, key, found := u.downloadURL(ctx, versionJSON)\n\tif !found {\n\t\treturn info, fmt.Errorf(\"version.json: bad key %q: %w\", key, errors.ErrNoValue)\n\t}\n\n\tisNewVersion := info.NewVersion != u.version\n\tif isNewVersion {\n\t\tu.logger.InfoContext(\n\t\t\tctx,\n\t\t\t\"a new version is available\",\n\t\t\t\"current_version\", u.version,","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/AdguardTeam/AdGuardHome/blob/b41aefbe51c8dde65e2c50f093996afa0502edf9/internal/updater/check.go#L92-L128","documentation":"Thrown while parsing the version.json response during an update check. Each value in the JSON map must be a non-empty string; validate.NotEmpty rejects empty or whitespace-only values. The offending key name is included in the message.","triggerScenarios":"Calling VersionInfo/parseVersionResponse against a version.json whose 'version', 'announcement', or 'announcement_url' (or any other) key has an empty string value.","commonSituations":"Corrupted or truncated mirror serving version.json; a CI/staging channel where announcement fields are left blank; manual editing of the channel metadata.","solutions":["Fetch the version.json URL manually and inspect all keys for empty values","Fix the publishing pipeline so every key has a non-empty string (use a placeholder like '-' for announcement)","Switch to the default/stable update channel or official metadata URL","Retry later if the mirror content is transiently corrupted"],"exampleFix":"// before\n{\"version\":\"v0.107.0\",\"announcement\":\"\",\"announcement_url\":\"https://...\"}\n// after\n{\"version\":\"v0.107.0\",\"announcement\":\"-\",\"announcement_url\":\"https://...\"}","handlingStrategy":"validation","validationCode":"resp, err := http.Get(url)\n// ...\nvar vj map[string]string\nif err := json.NewDecoder(resp.Body).Decode(&vj); err != nil { /* handle */ }\nfor k, v := range vj {\n    if strings.TrimSpace(v) == \"\" { /* skip/fix key before calling VersionInfo */ }\n}","typeGuard":null,"tryCatchPattern":"if _, err := u.VersionInfo(ctx); err != nil {\n    if strings.Contains(err.Error(), \"bad value for\") { /* tolerate and use cached info */ }\n}","preventionTips":["Validate version.json with a schema before feeding it to the updater","Monitor channel metadata generation so no key ships empty"],"tags":["update-check","json-validation","updater"],"backgroundTag":"json-schema-validation-failed","analyzedSha":"b41aefbe51c8dde65e2c50f093996afa0502edf9","analyzedAt":"2026-08-27T04:57:55.097Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}