From 835e49c10e3a6d10134963ee5c1574288bec20c2 Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Wed, 29 Jun 2022 06:01:48 -0400 Subject: [PATCH] klippy_connection: log raw peercred data on error Signed-off-by: Eric Callahan --- moonraker/klippy_connection.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/moonraker/klippy_connection.py b/moonraker/klippy_connection.py index 661fe37..cbb02ba 100644 --- a/moonraker/klippy_connection.py +++ b/moonraker/klippy_connection.py @@ -233,13 +233,16 @@ class KlippyConnection: "Unable to get Unix Socket, cant fetch peer credentials" ) return + data: bytes = b"" try: data = sock.getsockopt(socket.SOL_SOCKET, socket.SO_PEERCRED, 12) pid, uid, gid = struct.unpack("@LLL", data) except asyncio.CancelledError: raise except Exception: - logging.exception("Failed to get Klippy Credentials") + logging.exception( + f"Failed to get Klippy Peer Credentials, raw: 0x{data.hex()}" + ) return self._peer_cred = { "process_id": pid,