Skip to main content
Version: v3.9.0

Logs and exec

Logs and exec​

Stream container logs and open interactive shells for user microservices and system microservices. The command is logs (plural).

Node daemon logs and node exec stay on Node logs and exec. This page does not repeat them.

potctl logs microservice myapp/api -n my-ecn
potctl exec microservice myapp/api -n my-ecn

logs and exec.

Running services are also in EdgeOps Console → Workloads, which uses the same WebSocket API.

Names​

PatternExampleLookup
User appmyapp/apiUser microservice by name.
System appsystem-edge01/debugSystem microservice when the user application is missing.

Discover names with get microservices and get system-microservices.

ResourceCommand
User microservicedescribe microservice myapp/api
System microservicedescribe system-microservice system-edge01/debug

describe microservice does not describe legacy system-catalog microservices (catalog ids 3 and below). Use describe system-microservice for those.

logs microservice​

The command tails stdout and stderr of the workload container on the Edgelet node that hosts the microservice.

FlagDefaultRange
--tail1001 to 5000
--followtrueStream until you stop it.
--sinceunsetRFC3339
--untilunsetRFC3339
  1. Resolve the microservice on the user application, then on the system application.
  2. The status must be RUNNING. Otherwise the CLI errors.
  3. Load the Edgelet node from the namespace and the Controller.
  4. On a remote node, open a WebSocket for user or system microservice logs, with the tail options.
  5. On a local Edgelet node (kind: LocalAgent), read Docker or Podman logs for the container iofog_<microservice-uuid>. That path dumps the log once. --tail and --follow are not applied on the local engine path.
potctl logs microservice wasm/wasm -n my-ecn
potctl logs microservice system-lima/debug -n my-ecn --follow=false --tail=200

exec microservice​

Interactive WebSocket exec into the running workload container. There is no separate attach step. exec agent is the node path and can provision a debug system microservice. That flow is on Node logs and exec.

Requirements:

  • The microservice is RUNNING.
  • User microservice exec needs a subject with the Developer role.
  • System microservices may require SRE. The CLI reports that only SRE can access system microservices.
  1. Look up the user microservice. If the application id is invalid, look up the system microservice.
  2. Verify RUNNING.
  3. Open the user or system exec WebSocket.
  4. Attach the local terminal to that session.
  5. Closing the session prints a success message.

Up to 3 concurrent exec sessions are allowed per microservice. A fourth session returns HTTP 409.

potctl exec microservice myapp/api -n my-ecn
potctl exec microservice system-edge01/debug -n my-ecn

Protocol limits are on Exec sessions.

Workload commands and node commands​

logs agentlogs microservice
TargetEdgelet daemon on the nodeApplication or system container
WhereNode logs and execThis page
exec agentexec microservice
TargetDebug system container on the nodeThe workload container
ProvisionMay attach a debug microserviceNone
Typical roleSRE for node execDeveloper for microservice exec

Rebuild a system microservice​

After an image or config change on a Controller-managed system workload:

potctl rebuild system-microservice system-edge01/debug -n my-ecn

User kind: Microservice deploy cannot create system microservices.

Troubleshooting​

MessageLikely cause
Microservice is not currently runningStatus is not RUNNING. Wait, or fix the deploy.
Insufficient permissions, DeveloperThe subject needs Developer for user microservice exec.
Only SRE can access system microservicesUse an SRE account, or skip exec on that system microservice.
Maximum of 3 concurrent exec sessionsClose another exec session.
Log session relay unavailableController HA or the NATS relay. Retry.
Timeout waiting for agent connectionThe Edgelet node is offline, or the network path is down.
Group 3See anything wrong with the document? Help us improve it!