Skip to main content
Version: v3.9.0

Node logs and exec

Use logs agent to stream Edgelet daemon logs and exec agent to open an interactive shell on the edge host through a Controller-managed debug microservice.

Both commands need a namespace connected to a Controller (connect or control plane deploy) and an Edgelet node name known to the Controller.

Command name

The CLI subcommand is logs (plural), not log: potctl logs agent NAME.

Prerequisites​

Requirementlogs agentexec agent
Namespace config under ~/.iofog/v3YesYes
Controller API reachableRemote node: yesYes
Edgelet node registered on ControllerYesYes
Edgelet daemon RUNNINGRecommended (remote stream)Required
RBAC / auth rolesController sessionSRE-class access for node exec (Controller enforces)

Sync before remote logs: the CLI calls SyncAgentInfo so the local namespace cache matches Controller Agent records.

Edgelet log stream (logs agent)​

Purpose​

Tail Edgelet daemon logs on the node, not arbitrary application microservice logs. For workload logs use logs microservice.

Syntax​

potctl logs agent AGENT_NAME -n NAMESPACE [flags]

Flags​

FlagDefaultDescription
--tail100Lines to fetch first (1–5000)
--followtrueKeep streaming new lines
--since(empty)Start time RFC3339 / ISO 8601 (e.g. 2024-01-01T00:00:00Z)
--until(empty)End time RFC3339

Set --follow=false for a one-shot snapshot (still subject to remote vs local behavior below).

How it works​

Remote Edgelet node (kind: Agent)​

  1. Resolve agent UUID from the Controller.
  2. Open a WebSocket log session via SDK DialFogLogs with tail options.
  3. Print LogMessageLine frames to stdout until stop, error, or connection end.

The Controller may relay logs across HA replicas. If relay is unavailable you may see messages about log session relay or server draining. Retry or use another controller replica.

Local Edgelet node (kind: LocalAgent)​

  1. Read namespace-stored LocalAgent spec (container engine from agent config).
  2. Fetch logs from the local Edgelet container (GetLogsByName on the Edgelet container name).
  3. Print stdout and stderr once to the terminal.

Important: --tail, --follow, --since, and --until apply to the remote DialFogLogs path. They are not passed to the local container engine path today. Local logs agent is effectively a full container log dump from the engine API.

Examples​

# Follow last 100 lines (default)
potctl logs agent edge-01 -n my-ecn

# Snapshot only, last 500 lines
potctl logs agent edge-01 -n my-ecn --follow=false --tail=500

# Time window (remote)
potctl logs agent edge-01 -n my-ecn --since=2026-01-01T00:00:00Z --until=2026-01-02T00:00:00Z

Troubleshooting​

SymptomLikely cause
Agent not in namespace configDeploy or connect did not persist the node; run describe agent
Timeout waiting for agentNode offline or network path to Edgelet broken
Relay / draining errorsController HA or rollout. Retry.
Local: empty or errorEdgelet container not running on this machine

Interactive debug shell (exec agent)​

Purpose​

Open a terminal session into a debug container on the edge node. The CLI connects through the Controller exec WebSocket API to a system microservice named like debug, debug-<agentName>, or debug-<agentUUID> under application system-<agentName>.

This is node-level debug exec (SRE), not exec microservice (Developer workload exec).

Syntax​

potctl exec agent AGENT_NAME [DEBUG_IMAGE] -n NAMESPACE
ArgumentDescription
AGENT_NAMEController agent name
DEBUG_IMAGEOptional OCI image for the debug container when auto-provisioning

If omitted, Controller or catalog defaults apply when fog debug exec is provisioned.

How it works​

Auto-provision (default path)​

exec agent calls ensureDebugExecReady:

  1. Fail fast if agent DaemonStatus is not RUNNING.
  2. Look for an existing debug system microservice on that agent.
  3. If missing, call AttachExecToAgent (same API as attach exec agent) with optional image.
  4. Poll every 2s (max 60 attempts) until microservice status is RUNNING.
  5. DialSystemMicroserviceExecWithOptions and hand off to an interactive terminal (raw TTY on Unix).

If debug was already provisioned but stopped, the CLI waits for RUNNING again.

Manual provision (optional)​

Provision without opening a shell first:

potctl attach exec agent edge-01 -n my-ecn
potctl attach exec agent edge-01 ghcr.io/org/debug:1.0 -n my-ecn

Then:

potctl exec agent edge-01 -n my-ecn

Remove the debug workload when finished:

potctl detach exec agent edge-01 -n my-ecn

detach exec agent calls DetachExecFromAgent on the agent UUID and removes fog debug exec resources.

Session behavior​

  • Spinner stops before the interactive session; stdin/stdout attach to the WebSocket exec stream.
  • Status lines from the session may print via SDK callbacks.
  • Exit closes the session; the CLI prints success when the session ends cleanly.
  • Concurrent exec limits: the Controller may return 409. At most 3 concurrent exec sessions per microservice (message surfaced by the CLI).

Examples​

# Auto-provision debug container if needed, then shell
potctl exec agent edge-01 -n my-ecn

# Custom debug image on first provision
potctl exec agent edge-01 ghcr.io/org/debug:latest -n my-ecn

Troubleshooting​

SymptomLikely cause
Agent is not runningStart Edgelet or fix the node before exec
Timeout waiting for debug containerImage pull failure, agent disk, or catalog/registry
Insufficient permissionsUser lacks SRE (node exec) role on Controller
Only SRE for system MSExpected for system microservice exec path
Relay / draining errorsSame HA considerations as logs
Debug microservice not found (older flows)Run attach exec agent or use exec agent (auto-provisions)

Compare: logs vs exec vs microservice logs/exec​

CommandTargetTransportInteractive
logs agentEdgelet daemonDialFogLogs (remote) or local container logsNo (stream to stdout)
exec agentDebug system container on nodeDialSystemMicroserviceExecYes (shell)
logs microserviceApp microserviceDialMicroserviceLogs / system variantNo
exec microserviceRunning app microserviceDialMicroserviceExecYes

See also​

Group 3See anything wrong with the document? Help us improve it!