{"record":{"id":"0a5a8152d150ab8a","repo":"OpenBMB/ChatDev","slug":"log-level-must-be-either-debug-or-info","errorCode":null,"errorMessage":"log_level must be either DEBUG or INFO","messagePattern":"log_level must be either DEBUG or INFO","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"server/routes/batch.py","lineNumber":41,"sourceCode":"        manager = ensure_known_session(session_id, require_connection=True)\n    except ValidationError as exc:\n        raise HTTPException(status_code=400, detail=str(exc))\n\n    if max_parallel < 1:\n        raise HTTPException(status_code=400, detail=\"max_parallel must be >= 1\")\n\n    try:\n        content = await file.read()\n        tasks, file_base = parse_batch_file(content, file.filename or \"batch.csv\")\n    except ValidationError as exc:\n        raise HTTPException(status_code=400, detail=str(exc))\n\n    resolved_level = None\n    if log_level:\n        try:\n            resolved_level = LogLevel(log_level)\n        except ValueError:\n            raise HTTPException(status_code=400, detail=\"log_level must be either DEBUG or INFO\")\n\n    service = BatchRunService()\n    asyncio.create_task(\n        service.run_batch(\n            session_id,\n            yaml_file,\n            tasks,\n            manager,\n            max_parallel=max_parallel,\n            file_base=file_base,\n            log_level=resolved_level,\n        )\n    )\n\n    return {\n        \"status\": \"accepted\",\n        \"session_id\": session_id,\n        \"batch_id\": session_id,","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/OpenBMB/ChatDev/blob/4fb2db0ea90375ce1059f44fe03ffbd191a7a169/server/routes/batch.py#L23-L59","documentation":"The batch endpoint tries to convert the log_level string to a LogLevel enum; on ValueError it returns 400. Given the message, only DEBUG and INFO are accepted here.","triggerScenarios":"POST to batch execution with log_level=WARNING, TRACE, 'debug' (wrong case depends on enum), or any string not in the LogLevel enum.","commonSituations":"Copy-pasting log levels from other tooling (WARNING, ERROR) that this endpoint doesn't accept; case mismatches; stale config from an older API that allowed more levels.","solutions":["Use DEBUG or INFO (exact case as defined in the LogLevel enum)","Omit log_level entirely if you don't need to override it","Check the LogLevel enum definition for accepted values before sending"],"exampleFix":"# before\nlog_level: WARNING\n# after\nlog_level: INFO","handlingStrategy":"validation","validationCode":"ALLOWED = {'DEBUG', 'INFO'}\nif log_level is not None:\n    assert log_level in ALLOWED, f'log_level must be one of {ALLOWED}'","typeGuard":"def is_valid_batch_level(v: str | None) -> bool:\n    return v is None or v in {'DEBUG', 'INFO'}","tryCatchPattern":"try:\n    client.execute_batch(..., log_level=level)\nexcept HTTPError as e:\n    if e.response.status_code == 400 and 'log_level' in e.response.text:\n        client.execute_batch(..., log_level='INFO')","preventionTips":["Check the endpoint-specific accepted levels; batch only allows DEBUG/INFO","Omit log_level when unsure"],"tags":["http-400","batch","logging","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"4fb2db0ea90375ce1059f44fe03ffbd191a7a169","analyzedAt":"2026-08-27T14:35:29.622Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}