{"record":{"id":"68967766a459a2ea","repo":"hashicorp/nomad","slug":"failed-to-parse-collection-interval-v","errorCode":null,"errorMessage":"failed to parse collection interval: %v","messagePattern":"failed to parse collection interval: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/device/server.go","lineNumber":81,"sourceCode":"\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Make the response\n\tpresp := &proto.ReserveResponse{\n\t\tContainerRes: convertStructContainerReservation(resp),\n\t}\n\n\treturn presp, nil\n}\n\nfunc (d *devicePluginServer) Stats(req *proto.StatsRequest, stream proto.DevicePlugin_StatsServer) error {\n\tctx := stream.Context()\n\n\t// Retrieve the collection interval\n\tinterval, err := ptypes.Duration(req.CollectionInterval)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to parse collection interval: %v\", err)\n\t}\n\n\t// Default the duration if we get an invalid duration\n\tif interval.Nanoseconds() == 0 {\n\t\tinterval = time.Second\n\t}\n\n\toutCh, err := d.impl.Stats(ctx, interval)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn nil\n\t\tcase resp, ok := <-outCh:\n\t\t\t// The output channel has been closed, end the stream","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/plugins/device/server.go#L63-L99","documentation":"In the device plugin server's Stats handler, the collection interval sent by the client could not be parsed as a protobuf duration, so device stats streaming cannot be paced.","triggerScenarios":"Thrown at plugins/device/server.go:81 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the client sends a valid protobuf duration for the collection interval","Update mismatched client/plugin proto definitions"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}