{"record":{"id":"b399e3faac403d15","repo":"juicedata/juicefs","slug":"unexpected-number-of-fields","errorCode":null,"errorMessage":"unexpected number of fields","messagePattern":"unexpected number of fields","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/chunk/cached_store.go","lineNumber":635,"sourceCode":"\t\tc.CacheEviction = Eviction2Random\n\t}\n\tif c.CacheExpire > 0 && c.CacheExpire < time.Second {\n\t\tlogger.Warnf(\"cache-expire it too short, setting it to 1 second\")\n\t\tc.CacheExpire = time.Second\n\t}\n}\n\nfunc (c *Config) parseHours() (start, end int, err error) {\n\tif c.UploadHours == \"\" {\n\t\treturn\n\t}\n\tsplit := \",\"\n\tif strings.Contains(c.UploadHours, \"-\") {\n\t\tsplit = \"-\"\n\t}\n\tps := strings.Split(c.UploadHours, split)\n\tif len(ps) != 2 {\n\t\terr = errors.New(\"unexpected number of fields\")\n\t\treturn\n\t}\n\tif start, err = strconv.Atoi(ps[0]); err != nil {\n\t\treturn\n\t}\n\tif end, err = strconv.Atoi(ps[1]); err != nil {\n\t\treturn\n\t}\n\tif start < 0 || start > 23 || end < 0 || end > 23 {\n\t\terr = errors.New(\"invalid hour number\")\n\t}\n\treturn\n}\n\nfunc (c *Config) CacheEnabled() bool {\n\treturn c.CacheSize > 0\n}\n","sourceCodeStart":617,"sourceCodeEnd":653,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/chunk/cached_store.go#L617-L653","documentation":"Returned by Config.parseHours when the upload-hours option does not split into exactly two numeric fields. The value must be like '1,5' or '1-5'; having fewer or more fields (or a trailing separator) makes the upload window ill-defined and is rejected.","triggerScenarios":"Thrown at pkg/chunk/cached_store.go:635 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set upload-hours to exactly two hour values, e.g. --upload-hours 1,5 or --upload-hours 1-5"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}