{"record":{"id":"003b98f42a99f18f","repo":"nats-io/nats-server","slug":"config-reload-not-supported-for-jetstream-storage","errorCode":null,"errorMessage":"config reload not supported for jetstream storage directory","messagePattern":"config reload not supported for jetstream storage directory","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/reload.go","lineNumber":1820,"sourceCode":"\t\t\tif new != old {\n\t\t\t\tdiffOpts = append(diffOpts, &jetStreamOption{newValue: new})\n\t\t\t}\n\n\t\t\t// Mark whether JS will be disabled.\n\t\t\tdisableJS = !new\n\t\tcase \"storedir\":\n\t\t\tnew := newValue.(string)\n\t\t\told := oldValue.(string)\n\t\t\tmodified := new != old\n\n\t\t\t// Check whether JS is being disabled and/or storage dir attempted to change.\n\t\t\tif jsEnabled && modified {\n\t\t\t\tif new == _EMPTY_ {\n\t\t\t\t\t// This means that either JS is being disabled or it is using an temp dir.\n\t\t\t\t\t// Allow the change but error in case JS was not disabled.\n\t\t\t\t\tjsStoreDirChanged = true\n\t\t\t\t} else {\n\t\t\t\t\treturn nil, fmt.Errorf(\"config reload not supported for jetstream storage directory\")\n\t\t\t\t}\n\t\t\t}\n\t\tcase \"jetstreammaxmemory\", \"jetstreammaxstore\":\n\t\t\told := oldValue.(int64)\n\t\t\tnew := newValue.(int64)\n\n\t\t\t// Check whether JS is being disabled and/or limits are being changed.\n\t\t\tvar (\n\t\t\t\tmodified  = new != old\n\t\t\t\tfromUnset = old == -1\n\t\t\t\tfromSet   = !fromUnset\n\t\t\t\ttoUnset   = new == -1\n\t\t\t\ttoSet     = !toUnset\n\t\t\t\tincreased = fromSet && toSet && new > old\n\t\t\t)\n\t\t\tif jsEnabled && modified {\n\t\t\t\t// Cannot change limits from dynamic storage at runtime.\n\t\t\t\tswitch {","sourceCodeStart":1802,"sourceCodeEnd":1838,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/reload.go#L1802-L1838","documentation":"JetStream's storage directory (`store_dir`) cannot be changed while JetStream is enabled and running. During config reload, if the jetstream block was modified and the new store_dir is non-empty and different, the server rejects the reload because moving live stream/metadata storage at runtime is not supported. An empty new store_dir is tolerated because it means JetStream is being disabled or using a temp dir, which is checked later.","triggerScenarios":"SIGHUP reload after editing `jetstream.store_dir` to a different non-empty path while JetStream is enabled; moving storage to a bigger disk by editing the config and reloading instead of restarting.","commonSituations":"Operators migrating JetStream data to a new volume via config edit + reload; automation tools normalizing store_dir paths; changing store_dir from an explicit path back to a different explicit default.","solutions":["Keep `jetstream.store_dir` unchanged across reloads; leave it empty to use the default","To relocate storage, disable JetStream or stop the server, move the data directory, update the config, and restart","If the new value is empty (temp/disabled), the reload proceeds — verify JS is actually being disabled or you'll hit a later error"],"exampleFix":"// before\njetstream { store_dir: \"/data/new-path\" }  # + reload signal\n// after\nserver # systemctl stop nats-server && mv /data/old-path/* /data/new-path/\njetstream { store_dir: \"/data/new-path\" }\nserver # systemctl start nats-server","handlingStrategy":"validation","validationCode":"// Refuse to reload when store_dir changes while JS stays enabled:\nfunc storeDirChanged(old, new *Options) bool {\n\treturn old.JetStream && new.JetStream &&\n\t\told.StoreDir != new.StoreDir && new.StoreDir != \"\"\n}\n// if storeDirChanged(old, new) { scheduleRestart() }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin jetstream.store_dir (or leave it empty) for the server's lifetime","Move JetStream data with stop → move files → update config → start","Alert on config diffs that touch store_dir"],"tags":["nats-server","config-reload","jetstream"],"backgroundTag":"jetstream-store-dir-change","analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}