{"record":{"id":"3c0c5d3c632c16a1","repo":"ipfs/kubo","slug":"the-swarm-resourcemgr-limits-configuration-has-bee","errorCode":null,"errorMessage":"The Swarm.ResourceMgr.Limits configuration has been removed in Kubo 0.19 and should be empty or not present. To set custom libp2p limits, read https://github.com/ipfs/kubo/blob/master/docs/libp2p-resource-management.md#user-supplied-override-limits","messagePattern":"The Swarm\\.ResourceMgr\\.Limits configuration has been removed in Kubo 0\\.19 and should be empty or not present\\. To set custom libp2p limits, read https://github\\.com/ipfs/kubo/blob/master/docs/libp2p-resource-management\\.md#user-supplied-override-limits","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/types.go","lineNumber":532,"sourceCode":"\ntype swarmLimits doNotUse\n\nvar _ json.Unmarshaler = swarmLimits(false)\n\nfunc (swarmLimits) UnmarshalJSON(b []byte) error {\n\td := json.NewDecoder(bytes.NewReader(b))\n\tfor {\n\t\tswitch tok, err := d.Token(); err {\n\t\tcase io.EOF:\n\t\t\treturn nil\n\t\tcase nil:\n\t\t\tswitch tok {\n\t\t\tcase json.Delim('{'), json.Delim('}'):\n\t\t\t\t// accept empty objects\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t//nolint\n\t\t\treturn fmt.Errorf(\"The Swarm.ResourceMgr.Limits configuration has been removed in Kubo 0.19 and should be empty or not present. To set custom libp2p limits, read https://github.com/ipfs/kubo/blob/master/docs/libp2p-resource-management.md#user-supplied-override-limits\")\n\t\tdefault:\n\t\t\treturn err\n\t\t}\n\t}\n}\n\ntype experimentalAcceleratedDHTClient doNotUse\n\nvar _ json.Unmarshaler = experimentalAcceleratedDHTClient(false)\n\nfunc (experimentalAcceleratedDHTClient) UnmarshalJSON(b []byte) error {\n\td := json.NewDecoder(bytes.NewReader(b))\n\tfor {\n\t\tswitch tok, err := d.Token(); err {\n\t\tcase io.EOF:\n\t\t\treturn nil\n\t\tcase nil:\n\t\t\tswitch tok {","sourceCodeStart":514,"sourceCodeEnd":550,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/config/types.go#L514-L550","documentation":"Swarm.ResourceMgr.Limits was removed in Kubo 0.19; its UnmarshalJSON only accepts an absent key or an empty JSON object and rejects any non-empty content with this migration error. Custom libp2p resource limits must now be supplied via the rcmgr override limits file described in docs/libp2p-resource-management.md.","triggerScenarios":"Starting a node whose config.json still contains a populated Swarm.ResourceMgr.Limits object (e.g. carried over from a pre-0.19 repo), or setting it via `ipfs config --json Swarm.ResourceMgr.Limits '{...}'`.","commonSituations":"Upgrading an old node (config migration did not clean the key); copying a colleague's pre-0.19 config; automation tools writing limits back into the removed key.","solutions":["Remove the Swarm.ResourceMgr.Limits key from config.json (or leave it as an empty object {}).","Configure custom libp2p limits via the user-supplied override limits file per https://github.com/ipfs/kubo/blob/master/docs/libp2p-resource-management.md#user-supplied-override-limits.","Run `ipfs config show`, edit out the key, and `ipfs config replace` the cleaned file."],"exampleFix":"// before (config.json)\n{\"Swarm\": {\"ResourceMgr\": {\"Limits\": {\"System\": {\"Conns\": 9000}}}}}\n// after\n{\"Swarm\": {\"ResourceMgr\": {\"Limits\": {}}}}\n// move overrides to the limits override file (ResourceManager.AdditionalResources / override file per docs)","handlingStrategy":"validation","validationCode":"// before starting the daemon, strip removed Limits key\nfunc stripRemovedLimits(cfg map[string]any) {\n    if rm, ok := cfg[\"Swarm\"].(map[string]any); ok {\n        if r, ok := rm[\"ResourceMgr\"].(map[string]any); ok {\n            if lim, ok := r[\"Limits\"].(map[string]any); ok && len(lim) > 0 {\n                delete(r, \"Limits\") // or migrate to override limits file\n            }\n        }\n    }\n}","typeGuard":"func limitsKeyEmpty(cfg map[string]any) bool {\n    rm, _ := cfg[\"Swarm\"].(map[string]any)\n    r, _ := rm[\"ResourceMgr\"].(map[string]any)\n    lim, _ := r[\"Limits\"].(map[string]any)\n    return len(lim) == 0\n}","tryCatchPattern":"if err := node.Start(); err != nil {\n    if strings.Contains(err.Error(), \"Swarm.ResourceMgr.Limits\") {\n        // remove/migrate the key and restart\n    }\n}","preventionTips":["On upgrade from <0.19, migrate limits to the resource-manager override file, not config","Grep config.json for ResourceMgr.Limits before daemon start in provisioning scripts","Follow docs/libp2p-resource-management.md for custom limits"],"tags":["config","migration","resource-manager"],"backgroundTag":"removed-config-key","analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}