{"record":{"id":"f593eee2312b80e8","repo":"weaviate/weaviate","slug":"parse-transfer-inactivity-timeout-as-duration-w","errorCode":null,"errorMessage":"parse TRANSFER_INACTIVITY_TIMEOUT as duration: %w","messagePattern":"parse TRANSFER_INACTIVITY_TIMEOUT as duration: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"usecases/config/environment.go","lineNumber":224,"sourceCode":"\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"parse LAZY_LOAD_SHARD_SIZE_THRESHOLD_GB as float: %w\", err)\n\t\t}\n\t\tif asFloat < 0 {\n\t\t\treturn fmt.Errorf(\"LAZY_LOAD_SHARD_SIZE_THRESHOLD_GB must be >= 0\")\n\t\t}\n\t\tconfig.LazyLoadShardSizeThresholdGB = asFloat\n\t} else {\n\t\tconfig.LazyLoadShardSizeThresholdGB = DefaultLazyLoadShardSizeThresholdGB\n\t}\n\n\tif entcfg.Enabled(os.Getenv(\"FORCE_FULL_REPLICAS_SEARCH\")) {\n\t\tconfig.ForceFullReplicasSearch = true\n\t}\n\n\tif v := os.Getenv(\"TRANSFER_INACTIVITY_TIMEOUT\"); v != \"\" {\n\t\ttimeout, err := time.ParseDuration(v)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"parse TRANSFER_INACTIVITY_TIMEOUT as duration: %w\", err)\n\t\t}\n\t\tconfig.TransferInactivityTimeout = timeout\n\t} else {\n\t\tconfig.TransferInactivityTimeout = DefaultTransferInactivityTimeout\n\t}\n\n\terr := parsePositiveDuration(\n\t\t\"HALT_FOR_TRANSFER_TIMEOUT\",\n\t\tfunc(val time.Duration) { config.HaltForTransferTimeout = val },\n\t\tDefaultHaltForTransferTimeout,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Recount all property lengths at startup to support accurate BM25 scoring\n\tif entcfg.Enabled(os.Getenv(\"RECOUNT_PROPERTIES_AT_STARTUP\")) {\n\t\tconfig.RecountPropertiesAtStartup = true","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/usecases/config/environment.go#L206-L242","documentation":"FromEnv reads TRANSFER_INACTIVITY_TIMEOUT and parses it with time.ParseDuration to configure how long a shard/replica transfer may be inactive before being considered failed. An invalid duration string is wrapped as \"parse TRANSFER_INACTIVITY_TIMEOUT as duration: %w\" and aborts config loading so the operator sees the bad env var immediately.","triggerScenarios":"TRANSFER_INACTIVITY_TIMEOUT set to a value time.ParseDuration rejects: \"90\" (no unit), \"2h30\" (incomplete compound), \"90min\", \"1 hr\", or whitespace-padded values, during LoadConfig.","commonSituations":"Following docs from other systems that accept bare seconds; writing \"90min\" instead of \"90m\"; k8s duration formats like \"1h30m0s\" are fine but \"90\" is not; leftover placeholder values in compose files.","solutions":["Use a valid Go duration with an explicit unit, e.g. TRANSFER_INACTIVITY_TIMEOUT=2m or 1h30m.","Unset the variable to use DefaultTransferInactivityTimeout.","Verify with Go's ParseDuration semantics: number+unit (ns, us, ms, s, m, h), no spaces."],"exampleFix":"// before\nTRANSFER_INACTIVITY_TIMEOUT=90\n// after\nTRANSFER_INACTIVITY_TIMEOUT=90s","handlingStrategy":"validation","validationCode":"v := os.Getenv(\"TRANSFER_INACTIVITY_TIMEOUT\")\nif v != \"\" {\n    if _, err := time.ParseDuration(v); err != nil {\n        return fmt.Errorf(\"invalid TRANSFER_INACTIVITY_TIMEOUT %q: %w\", v, err)\n    }\n}","typeGuard":"func validDuration(v string) bool {\n    _, err := time.ParseDuration(v)\n    return err == nil\n}","tryCatchPattern":null,"preventionTips":["Always write durations with units (90s, 2m, 1h); bare numbers are rejected.","Use Go duration syntax, not k8s-only or human forms like \"90min\" or \"1 hr\".","Keep a reference table of duration-typed Weaviate env vars in your ops runbook."],"tags":["configuration","env-var","duration-parse"],"backgroundTag":"invalid-duration-env-var","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}