Skip to content

phala logs returns empty — composition API returns containers: [] despite container running #193

@0xmatchmaker

Description

@0xmatchmaker

Summary

Container logs are unavailable via phala logs for CVMs that use dockerfile_inline in their docker-compose.yaml, even though the containers are running correctly.

Environment

  • CLI version: latest (phala npm package)
  • OS image: dstack-dev-0.5.6
  • Instance type: tdx.small

Steps to Reproduce

  1. Deploy a CVM with dockerfile_inline:
services:
  my-app:
    build:
      context: .
      dockerfile_inline: |
        FROM python:3.12-slim
        WORKDIR /app
        RUN echo 'print("hello")' > app.py
        CMD ["python3", "-u", "app.py"]
    ports:
      - "8080:8080"
  1. Verify container is running: phala ps my-app → shows container running
  2. Try to get logs: phala logs --cvm-id my-app → "No logs available"
  3. Confirm app works via HTTP endpoint → returns valid response

Root Cause Analysis

Three API data sources are all empty:

  1. GET /cvms/{id}/composition returns containers: [] — CLI can't discover container log endpoints
  2. syslog_endpoint is null — fallback streaming path unavailable
  3. services is [] despite public_logs: true

Meanwhile, phala ps successfully lists the container, suggesting the guest agent can enumerate containers but the composition/syslog APIs don't reflect this.

Workarounds

• phala logs --serial works (kernel/boot logs)
• Expose an HTTP status endpoint in the app
• Use phala ssh if SSH keys are configured

Expected Behavior

phala logs should return container stdout/stderr regardless of build method (dockerfile_inline vs pre-built image).

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions