{"record":{"id":"3e2df6d550f421c7","repo":"ruvnet/RuView","slug":"fps-must-be-between-1-and-60","errorCode":null,"errorMessage":"FPS must be between 1 and 60","messagePattern":"FPS must be between 1 and 60","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"archive/v1/src/config/domains.py","lineNumber":215,"sourceCode":"    \n    # Compression settings\n    compression_enabled: bool = Field(default=True, description=\"Enable compression\")\n    compression_level: int = Field(default=5, description=\"Compression level (1-9)\")\n    \n    # WebSocket settings\n    ping_interval: int = Field(default=60, description=\"Ping interval in seconds\")\n    timeout: int = Field(default=300, description=\"Connection timeout in seconds\")\n    max_connections: int = Field(default=100, description=\"Maximum concurrent connections\")\n    \n    # Data filtering\n    min_confidence: float = Field(default=0.5, description=\"Minimum confidence for streaming\")\n    include_metadata: bool = Field(default=True, description=\"Include metadata in stream\")\n    \n    @validator(\"fps\")\n    def validate_fps(cls, v):\n        \"\"\"Validate FPS value.\"\"\"\n        if not 1 <= v <= 60:\n            raise ValueError(\"FPS must be between 1 and 60\")\n        return v\n    \n    @validator(\"compression_level\")\n    def validate_compression_level(cls, v):\n        \"\"\"Validate compression level.\"\"\"\n        if not 1 <= v <= 9:\n            raise ValueError(\"Compression level must be between 1 and 9\")\n        return v\n\n\nclass AlertConfig(BaseModel):\n    \"\"\"Configuration for alerts and notifications.\"\"\"\n    \n    # Alert types\n    enable_pose_alerts: bool = Field(default=False, description=\"Enable pose-based alerts\")\n    enable_activity_alerts: bool = Field(default=False, description=\"Enable activity-based alerts\")\n    enable_zone_alerts: bool = Field(default=False, description=\"Enable zone-based alerts\")\n    enable_system_alerts: bool = Field(default=True, description=\"Enable system alerts\")","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/ruvnet/RuView/blob/4685618388a5e49fad5b3005806f3bdd6a7c25c3/archive/v1/src/config/domains.py#L197-L233","documentation":"Pydantic v1 @validator on StreamingConfig.fps in archive/v1/src/config/domains.py. It enforces 1 <= fps <= 60 and the field is typed int (default 30). Values outside the range raise ValueError, surfaced as pydantic.ValidationError during StreamingConfig construction or when loading the 'streaming' section of a domain config file.","triggerScenarios":"fps=0 (attempting to disable streaming); fps=120 (high-framerate camera setups); fps values above 60 for smoother playback; fractional rates like 29.97 rejected or coerced because the field is int, not float.","commonSituations":"Porting broadcast/camera configs that assume NTSC 29.97 fps; trying to pause a stream by setting fps to 0; performance tuning that raises fps without knowing the cap.","solutions":["Set fps to an integer within 1-60 (e.g., 30 or 60)","For fractional rates, pick the nearest supported integer (29.97 -> 30)","To disable streaming, use the service lifecycle (do not start it) rather than fps=0","If >60 fps is a hard requirement, change the validator bound and verify the pipeline actually sustains it"],"exampleFix":"# before\nstreaming = StreamingConfig(fps=0)\n\n# after\nstreaming = StreamingConfig(fps=30)","handlingStrategy":"validation","validationCode":"fps = cfg.get(\"fps\", 30)\nassert isinstance(fps, int) and 1 <= fps <= 60, f\"fps must be int in 1-60, got {fps!r}\"","typeGuard":"def is_valid_fps(v) -> bool:\n    return isinstance(v, int) and not isinstance(v, bool) and 1 <= v <= 60","tryCatchPattern":"from pydantic import ValidationError\ntry:\n    streaming = StreamingConfig(**cfg[\"streaming\"])\nexcept ValidationError as e:\n    if any(err[\"loc\"][-1] == \"fps\" for err in e.errors()):\n        raise ValueError(\"streaming.fps must be an integer between 1 and 60\") from e\n    raise","preventionTips":["Keep fps an integer in 1-60; round 29.97-style rates to 30","Never use fps=0 to disable a stream — control it via the service lifecycle","Document the 1-60 cap next to the fps key in config templates"],"tags":["pydantic","validation","config","streaming","fps","python"],"backgroundTag":null,"analyzedSha":"4685618388a5e49fad5b3005806f3bdd6a7c25c3","analyzedAt":"2026-08-16T06:09:40.886Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}