From 4f827019563af03ae8eb502082ca58c9625a2e7c Mon Sep 17 00:00:00 2001 From: Carsten Date: Tue, 21 Apr 2026 22:15:32 +0200 Subject: [PATCH] fix(agent): jason-safe error entries + correct handle_info return MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Errors produced by Collectors.Host were keyword tuples {:tag, msg}, which Jason cannot encode — metric push crashed the channel. Convert them to plain maps with :tag and :message fields. Reporter.handle_info/2 returned {:ok, socket}, which Slipstream rejects (GenServer-style {:noreply, socket} is the only valid return for that callback, unlike handle_connect/handle_join/handle_disconnect). --- agent/lib/proxmox_agent/collectors/host.ex | 2 +- agent/lib/proxmox_agent/reporter.ex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/lib/proxmox_agent/collectors/host.ex b/agent/lib/proxmox_agent/collectors/host.ex index 2f7971d..cc5dcc6 100644 --- a/agent/lib/proxmox_agent/collectors/host.ex +++ b/agent/lib/proxmox_agent/collectors/host.ex @@ -46,7 +46,7 @@ defmodule ProxmoxAgent.Collectors.Host do try do {fun.(), nil} rescue - e -> {fallback, {tag, Exception.message(e)}} + e -> {fallback, %{tag: Atom.to_string(tag), message: Exception.message(e)}} end end diff --git a/agent/lib/proxmox_agent/reporter.ex b/agent/lib/proxmox_agent/reporter.ex index 12d4bef..38dbcc6 100644 --- a/agent/lib/proxmox_agent/reporter.ex +++ b/agent/lib/proxmox_agent/reporter.ex @@ -47,7 +47,7 @@ defmodule ProxmoxAgent.Reporter do payload = %{collected_at: DateTime.utc_now() |> DateTime.to_iso8601(), data: sample} :ok = push_metric(socket, "metric:fast", payload) Process.send_after(self(), :collect_fast, socket.assigns.cfg.fast_seconds * 1000) - {:ok, socket} + {:noreply, socket} end @impl Slipstream