Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Log rootless admission fallback reasons

rcourtmand99e3cc7153e
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index 87bed955ac..c79d0518d0 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -92,7 +92,9 @@ direct admission while using helper summary inventory and falls back to a
complete helper snapshot after repeated direct-runtime loss, without exposing
container actions in either safe-profile mode. Static profile gates also reject
legacy Docker report-response update commands and suppress registry scans and
-orphan-backup cleanup in the collector.
+orphan-backup cleanup in the collector. Before initial helper fallback, local
+runtime diagnostics record the exact direct-admission refusal so ambiguity and
+other boundary failures remain distinguishable without weakening the fallback.
The collector reports that runtime truth as the shared
`typed-privilege-helper` module. SMART, Proxmox, and `container.inventory`
operation failures remain independently active until that exact operation
diff --git a/internal/dockeragent/agent.go b/internal/dockeragent/agent.go
index a7adf99b15..62baaef1d1 100644
--- a/internal/dockeragent/agent.go
+++ b/internal/dockeragent/agent.go
@@ -328,6 +328,9 @@ func New(cfg Config) (*Agent, error) {
return nil, fmt.Errorf("dockeragent.New: connect runtime: %w", connectErr)
}
if connectErr != nil {
+ logger.Warn().
+ Err(connectErr).
+ Msg("Direct collector-owned rootless runtime unavailable; using typed helper inventory")
probeCtx, cancelProbe := context.WithTimeout(context.Background(), helperInventoryOperationDeadline)
result, helperErr := cfg.HelperInventory.Inventory(probeCtx)
cancelProbe()
diff --git a/internal/dockeragent/agent_internal_test.go b/internal/dockeragent/agent_internal_test.go
index 67759f54af..193caaf5bb 100644
--- a/internal/dockeragent/agent_internal_test.go
+++ b/internal/dockeragent/agent_internal_test.go
@@ -1,6 +1,7 @@
package dockeragent
import (
+ "bytes"
"context"
"errors"
"fmt"
@@ -21,12 +22,42 @@ import (
containertypes "github.com/moby/moby/api/types/container"
systemtypes "github.com/moby/moby/api/types/system"
"github.com/moby/moby/client"
+ "github.com/rcourtman/pulse-go-rewrite/internal/agenthelper"
"github.com/rcourtman/pulse-go-rewrite/internal/hostmetrics"
agentsdocker "github.com/rcourtman/pulse-go-rewrite/pkg/agents/docker"
agentshost "github.com/rcourtman/pulse-go-rewrite/pkg/agents/host"
"github.com/rs/zerolog"
)
+func TestNewLogsDirectAdmissionRefusalBeforeTypedHelperFallback(t *testing.T) {
+ originalConnect := connectCollectorRuntimeFn
+ t.Cleanup(func() { connectCollectorRuntimeFn = originalConnect })
+ connectCollectorRuntimeFn = func(RuntimeKind, *zerolog.Logger) (dockerClient, systemtypes.Info, RuntimeKind, error) {
+ return nil, systemtypes.Info{}, RuntimeAuto, errors.New("ambiguous collector-owned rootless runtime endpoints")
+ }
+ helper := &helperInventoryStub{result: agenthelper.ContainerInventoryResult{
+ Runtimes: []agenthelper.ContainerRuntimeSnapshot{{Runtime: "docker", Available: true}},
+ }}
+ var logs bytes.Buffer
+ logger := zerolog.New(&logs)
+ agent, err := New(Config{
+ PulseURL: "http://127.0.0.1:7655", APIToken: "token", Runtime: "auto",
+ HelperInventory: helper, Logger: &logger,
+ })
+ if err != nil {
+ t.Fatalf("New helper fallback: %v", err)
+ }
+ defer agent.Close()
+ for _, expected := range []string{
+ "Direct collector-owned rootless runtime unavailable; using typed helper inventory",
+ "ambiguous collector-owned rootless runtime endpoints",
+ } {
+ if !strings.Contains(logs.String(), expected) {
+ t.Fatalf("helper fallback log omitted %q: %s", expected, logs.String())
+ }
+ }
+}
+
func TestDockerReportSequenceIDsAreProcessScopedAndMonotonic(t *testing.T) {
agent := &Agent{reportStreamID: "docker-process-stream"}
first := agent.nextReportSequenceID()