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
Running services are also in EdgeOps Console → Workloads, which uses the same WebSocket API.
Names
| Pattern | Example | Lookup |
|---|---|---|
| User app | myapp/api | User microservice by name. |
| System app | system-edge01/debug | System microservice when the user application is missing. |
Discover names with get microservices and get system-microservices.
| Resource | Command |
|---|---|
| User microservice | describe microservice myapp/api |
| System microservice | describe 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.
| Flag | Default | Range |
|---|---|---|
--tail | 100 | 1 to 5000 |
--follow | true | Stream until you stop it. |
--since | unset | RFC3339 |
--until | unset | RFC3339 |
- Resolve the microservice on the user application, then on the system application.
- The status must be
RUNNING. Otherwise the CLI errors. - Load the Edgelet node from the namespace and the Controller.
- On a remote node, open a WebSocket for user or system microservice logs, with the tail options.
- On a local Edgelet node (
kind: LocalAgent), read Docker or Podman logs for the containeriofog_<microservice-uuid>. That path dumps the log once.--tailand--followare 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.
- Look up the user microservice. If the application id is invalid, look up the system microservice.
- Verify
RUNNING. - Open the user or system exec WebSocket.
- Attach the local terminal to that session.
- 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 agent | logs microservice | |
|---|---|---|
| Target | Edgelet daemon on the node | Application or system container |
| Where | Node logs and exec | This page |
exec agent | exec microservice | |
|---|---|---|
| Target | Debug system container on the node | The workload container |
| Provision | May attach a debug microservice | None |
| Typical role | SRE for node exec | Developer 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
| Message | Likely cause |
|---|---|
| Microservice is not currently running | Status is not RUNNING. Wait, or fix the deploy. |
| Insufficient permissions, Developer | The subject needs Developer for user microservice exec. |
| Only SRE can access system microservices | Use an SRE account, or skip exec on that system microservice. |
| Maximum of 3 concurrent exec sessions | Close another exec session. |
| Log session relay unavailable | Controller HA or the NATS relay. Retry. |
| Timeout waiting for agent connection | The Edgelet node is offline, or the network path is down. |
Related
- Microservices
- Microservice fields for
statusandexecStatuson describe - Node logs and exec
- Exec sessions