{"record":{"id":"196bb6008c95c047","repo":"sgl-project/sglang","slug":"streaming-sessions-are-disabled-please-relaunch-w","errorCode":null,"errorMessage":"Streaming sessions are disabled. Please relaunch with --enable-streaming-session.","messagePattern":"Streaming sessions are disabled\\. Please relaunch with --enable-streaming-session\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/managers/tokenizer_control_mixin.py","lineNumber":909,"sourceCode":"\n        reader = self.load_snapshot_reader\n        if dp_rank is not None:\n            load = reader.read(dp_rank)\n            results = [load] if load is not None else []\n        else:\n            results = reader.read_all()\n\n        return results\n\n    async def open_session(\n        self: TokenizerManager,\n        obj: OpenSessionReqInput,\n        request: Optional[fastapi.Request] = None,\n    ):\n        self.auto_create_handle_loop()\n        if obj.streaming:\n            if not self.server_args.enable_streaming_session:\n                raise ValueError(\n                    \"Streaming sessions are disabled. \"\n                    \"Please relaunch with --enable-streaming-session.\"\n                )\n\n        if obj.session_id is None:\n            obj.session_id = uuid.uuid4().hex\n        elif obj.session_id in self.session_futures:\n            return None\n\n        future = asyncio.Future()\n        self.session_futures[obj.session_id] = future\n        self._dispatch_to_scheduler(obj)\n\n        try:\n            return await future\n        finally:\n            self.session_futures.pop(obj.session_id, None)\n","sourceCodeStart":891,"sourceCodeEnd":927,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/managers/tokenizer_control_mixin.py#L891-L927","documentation":"open_session raises when a client requests a streaming session (obj.streaming=True) but the server was not launched with --enable-streaming-session.","triggerScenarios":"Calling the session API with streaming=True on a server without --enable-streaming-session.","commonSituations":"Client SDK defaults requesting streaming sessions; older launch scripts missing the new flag.","solutions":["Relaunch the server with --enable-streaming-session","Or open the session non-streaming (streaming=False) if streaming isn't required"],"exampleFix":"# before\npython -m sglang.launch_server --model-path ...\n# after\npython -m sglang.launch_server --model-path ... --enable-streaming-session","handlingStrategy":"validation","validationCode":"if obj.streaming and not server_info.get('enable_streaming_session'):\n    obj.streaming = False  # or fail with a clear config error","typeGuard":null,"tryCatchPattern":"try:\n    await client.open_session(obj)\nexcept ValueError as e:\n    if 'enable-streaming-session' in str(e):\n        obj.streaming = False\n        return await client.open_session(obj)\n    raise","preventionTips":["Launch with --enable-streaming-session if clients use streaming sessions","Default SDKs to streaming=False unless the server advertises the feature"],"tags":["sessions","streaming","config","http-api"],"backgroundTag":"feature-not-enabled","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}