{"record":{"id":"4efd2e8dcc045582","repo":"hashicorp/nomad","slug":"mbits-has-been-deprecated-as-of-nomad-0-12-0-plea","errorCode":null,"errorMessage":"mbits has been deprecated as of Nomad 0.12.0. Please remove mbits from the network block","messagePattern":"mbits has been deprecated as of Nomad 0\\.12\\.0\\. Please remove mbits from the network block","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"nomad/structs/structs.go","lineNumber":7679,"sourceCode":"\t\tmErr.Errors = append(mErr.Errors, errors.New(\"PreventRescheduleOnLost is deprecated and ignored in favor of Disconnect.Replace\"))\n\t}\n\n\t// Warn about unbounded rescheduling which may cause thrashing if tasks have\n\t// unlimited attempts and a low delay.\n\t//\n\t// The 5 second gate on the delay is used as this was the previous minimum\n\t// value which did not produce a warning. It therefore feels like the right\n\t// gate to use.\n\tif rp := tg.ReschedulePolicy; rp != nil && rp.Unlimited && rp.Delay < 5*time.Second {\n\t\tmErr.Errors = append(\n\t\t\tmErr.Errors,\n\t\t\terrors.New(\"Reschedule policy has unlimited attempts enabled and a low delay; reschedule thrashing possible\"),\n\t\t)\n\t}\n\n\t// Check for mbits network field\n\tif len(tg.Networks) > 0 && tg.Networks[0].MBits > 0 {\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"mbits has been deprecated as of Nomad 0.12.0. Please remove mbits from the network block\"))\n\t}\n\n\t// Validate group-level services.\n\tfor _, s := range tg.Services {\n\t\tif err := s.Warnings(); err != nil {\n\t\t\terr = multierror.Prefix(err, fmt.Sprintf(\"Service %q:\", s.Name))\n\t\t\tmErr = *multierror.Append(&mErr, err)\n\t\t}\n\t}\n\n\tfor _, t := range tg.Tasks {\n\t\tif err := t.Warnings(); err != nil {\n\t\t\touter := fmt.Errorf(\"Task %q has warnings: %v\", t.Name, err)\n\t\t\tmErr.Errors = append(mErr.Errors, outer)\n\t\t}\n\t}\n\n\treturn mErr.ErrorOrNil()","sourceCodeStart":7661,"sourceCodeEnd":7697,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/structs.go#L7661-L7697","documentation":"This is a job-validation warning (from Warnings(), not Validate errors): the deprecated `mbits` field in a group network block is set to a nonzero value. Since Nomad 0.12.0 network bandwidth specification via mbits is ignored/deprecated in favor of the new network resource model.","triggerScenarios":"Submitting a job whose task group has `network { mbits = N }` with N > 0 in the first entry of tg.Networks.","commonSituations":"Upgrading pre-0.12 jobs that specified mbits; copy-pasted old HCL examples; migration tools preserving legacy fields.","solutions":["Delete the `mbits` line from the network block","Use the modern network fields (port labels, hostname, cidr) instead","Run `nomad job validate` after upgrading jobs from <=0.11"],"exampleFix":"// before\nnetwork {\n  mbits = 100\n  port \"http\" {}\n}\n// after\nnetwork {\n  port \"http\" {}\n}","handlingStrategy":"validation","validationCode":"for _, n := range g.Networks {\n  if n.MBits > 0 { return errors.New(\"remove deprecated mbits from network block\") }\n}","typeGuard":"func noMBits(g *api.TaskGroup) bool {\n  for _, n := range g.Networks {\n    if n.MBits != 0 { return false }\n  }\n  return true\n}","tryCatchPattern":null,"preventionTips":["Strip mbits when migrating jobs from Nomad <=0.11","Grep job repos for 'mbits' in an upgrade checklist","Read `nomad job plan` warnings, not just exit code"],"tags":["nomad","deprecation","network"],"backgroundTag":"deprecated-field-usage","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}