{"record":{"id":"cbb46a4ce2570d12","repo":"ruvnet/RuView","slug":"stream-fps-must-be-between-1-and-60","errorCode":null,"errorMessage":"Stream FPS must be between 1 and 60","messagePattern":"Stream FPS must be between 1 and 60","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"archive/v1/src/config/settings.py","lineNumber":207,"sourceCode":"        allowed_levels = [\"DEBUG\", \"INFO\", \"WARNING\", \"ERROR\", \"CRITICAL\"]\n        if v.upper() not in allowed_levels:\n            raise ValueError(f\"Log level must be one of: {allowed_levels}\")\n        return v.upper()\n    \n    @field_validator(\"pose_confidence_threshold\")\n    @classmethod\n    def validate_confidence_threshold(cls, v):\n        \"\"\"Validate confidence threshold.\"\"\"\n        if not 0.0 <= v <= 1.0:\n            raise ValueError(\"Confidence threshold must be between 0.0 and 1.0\")\n        return v\n    \n    @field_validator(\"stream_fps\")\n    @classmethod\n    def validate_stream_fps(cls, v):\n        \"\"\"Validate streaming FPS.\"\"\"\n        if not 1 <= v <= 60:\n            raise ValueError(\"Stream FPS must be between 1 and 60\")\n        return v\n    \n    @field_validator(\"port\")\n    @classmethod\n    def validate_port(cls, v):\n        \"\"\"Validate port number.\"\"\"\n        if not 1 <= v <= 65535:\n            raise ValueError(\"Port must be between 1 and 65535\")\n        return v\n    \n    @field_validator(\"workers\")\n    @classmethod\n    def validate_workers(cls, v):\n        \"\"\"Validate worker count.\"\"\"\n        if v < 1:\n            raise ValueError(\"Workers must be at least 1\")\n        return v\n    ","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/ruvnet/RuView/blob/4685618388a5e49fad5b3005806f3bdd6a7c25c3/archive/v1/src/config/settings.py#L189-L225","documentation":"Pydantic v2 @field_validator on Settings.stream_fps in archive/v1/src/config/settings.py. It enforces 1 <= stream_fps <= 60, matching the domain-level StreamingConfig.fps validator. An invalid STREAM_FPS env value fails Settings() construction at startup. fps=0 (a naive way to disable streaming) and 120 (high-framerate setups) are the typical rejects.","triggerScenarios":"STREAM_FPS=0 to 'turn off' streaming; STREAM_FPS=120 imported from a 120Hz capture config; STREAM_FPS=-1 sentinel values; fractional values like 29.97 depending on the field's declared type.","commonSituations":"Reusing camera-capture configs with uncapped fps; disabling streams via fps instead of the service lifecycle; performance tuning that raises fps past the 60 cap.","solutions":["Set STREAM_FPS to an integer between 1 and 60","Disable streaming via the stream lifecycle endpoints (POST /stream/never-start or simply do not start it), not fps=0","Cap imported configs: min(fps, 60)","If the deployment truly needs >60 fps, raise the validator bound and load-test the pipeline"],"exampleFix":"# before\nSTREAM_FPS=0\n\n# after\nSTREAM_FPS=30","handlingStrategy":"validation","validationCode":"raw = int(os.environ.get(\"STREAM_FPS\", \"30\"))\nassert 1 <= raw <= 60, f\"STREAM_FPS must be 1-60, got {raw} (use the service lifecycle, not fps=0, to disable streaming)\"","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    settings = Settings()\nexcept ValidationError as e:\n    if any(err[\"loc\"][-1] == \"stream_fps\" for err in e.errors()):\n        raise SystemExit(\"stream_fps must be an integer between 1 and 60\") from e\n    raise","preventionTips":["Cap imported fps values at 60: min(fps, 60)","Disable streams via lifecycle control, never fps=0","Keep the 1-60 cap documented beside STREAM_FPS in the .env template"],"tags":["pydantic","settings","validation","fps","streaming","environment-variables","python"],"backgroundTag":null,"analyzedSha":"4685618388a5e49fad5b3005806f3bdd6a7c25c3","analyzedAt":"2026-08-16T06:09:40.886Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}