{"record":{"id":"0404ba482f0a307c","repo":"BerriAI/litellm","slug":"error-logging-request-payload-payload-none","errorCode":null,"errorMessage":"Error logging request payload. Payload=none.","messagePattern":"Error logging request payload\\. Payload=none\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"warning","filePath":"litellm/integrations/langsmith.py","lineNumber":202,"sourceCode":"        self,\n        kwargs,\n        response_obj,\n        start_time,\n        end_time,\n        credentials: LangsmithCredentialsObject,\n    ):\n        try:\n            _litellm_params: Final = kwargs.get(\"litellm_params\", {}) or {}\n            metadata = _litellm_params.get(\"metadata\", {}) or {}\n\n            fields: Final = self._extract_metadata_fields(metadata, credentials)\n            verbose_logger.debug(\n                \"Langsmith Logging - project_name: %s, run_name %s\", fields[\"project_name\"], fields[\"run_name\"]\n            )\n\n            payload: Final[StandardLoggingPayload | None] = kwargs.get(\"standard_logging_object\", None)\n            if payload is None:\n                raise Exception(\"Error logging request payload. Payload=none.\")\n\n            metadata = payload[\"metadata\"]\n            extra_metadata: Final = self._build_extra_metadata(dict(metadata))\n            inputs: Final = {**payload, \"metadata\": self._redact_metadata(dict(metadata))}\n            outputs: Final = self._build_outputs_with_usage(payload)\n\n            data: Final = {\n                \"name\": fields[\"run_name\"],\n                \"run_type\": \"llm\",\n                \"inputs\": inputs,\n                \"outputs\": outputs,\n                \"session_name\": fields[\"project_name\"],\n                \"start_time\": payload[\"startTime\"],\n                \"end_time\": payload[\"endTime\"],\n                \"tags\": payload[\"request_tags\"],\n                \"extra\": extra_metadata,\n            }\n","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/integrations/langsmith.py#L184-L220","documentation":"The Langsmith logger expects a pre-built 'standard_logging_object' in kwargs; when it is None it raises before building the run payload. LiteLLM normally constructs this standard logging payload earlier in the request pipeline, so its absence means the logging hook was invoked outside the normal litellm call flow or the payload was stripped.","triggerScenarios":"Calling LangsmithLogger's log method directly (unit tests or custom instrumentation) without a standard_logging_object in kwargs; invoking success callbacks on a hand-built kwargs dict; middleware that drops 'standard_logging_object' from kwargs before logging.","commonSituations":"Teams unit-testing custom callback wiring by fabricating kwargs; forks that call internal logging APIs; version changes that rename or move the standard logging payload construction before callbacks run.","solutions":["If calling the logger directly, build a StandardLoggingPayload first (via litellm's standard logging payload helpers or by running a real completion) and put it under kwargs['standard_logging_object']","Prefer integration tests that go through litellm.completion with callbacks enabled instead of invoking the logger manually","Inspect kwargs just before the callback fires to confirm which layer removed the payload","Update to a matching litellm version if custom middleware was written against an older payload key"],"exampleFix":"# before\nlogger.log_success_event(kwargs={\"litellm_params\": {}}, ...)  # Exception: Payload=none.\n\n# after\nkwargs = {\n    \"standard_logging_object\": build_standard_logging_payload(...),\n    \"litellm_params\": {\"metadata\": {}},\n}\nlogger.log_success_event(kwargs=kwargs, ...)","handlingStrategy":"try-catch","validationCode":"def has_standard_logging_object(kwargs: dict) -> bool:\n    return kwargs.get(\"standard_logging_object\") is not None","typeGuard":null,"tryCatchPattern":"try:\n    logger.log_success_event(kwargs, response_obj, start, end)\nexcept Exception as e:\n    if \"Payload=none\" in str(e):\n        pass  # logging hook called outside normal pipeline; skip, do not fail the request\n    else:\n        raise","preventionTips":["Prefer integration tests through litellm.completion over calling loggers directly","If calling callbacks manually, build kwargs via the framework's payload helpers"],"tags":["python","langsmith","callback","logging","internal-api"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}