Skip to content

Deployment hangs without error feedback when import failures occur #52

@obigroup

Description

@obigroup

Description

When deploying an agent with pcc deploy, if there are import errors or other startup failures in the Python code, the deployment process hangs for 90 seconds without providing any error feedback. Users must manually run pcc agent logs <agent-name> to discover what went wrong.

Current Behavior

pcc deploy

Output:

Updating deployment for agent 'agent-name'
╭─ ᓚᘏᗢ Error ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Deployment did not enter ready state within 90 seconds. Please check logs with `pcc agent logs agent-name'`                                                                                                           │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Then users must run:

pcc agent logs agent-name

To discover the actual error:

2025-06-12 14:52:48 locale.Error: unsupported locale setting
2025-06-12 14:52:48     return _setlocale(category, locale)
2025-06-12 14:52:48   File "/usr/local/lib/python3.10/locale.py", line 620, in setlocale
2025-06-12 14:52:48     locale.setlocale(locale.LC_TIME, "fr_FR.UTF-8")
2025-06-12 14:52:48   File "/app/bot.py", line 45, in <module>
2025-06-12 14:52:48     from bot import bot
2025-06-12 14:52:48   File "/app/app.py", line 8, in <module>
2025-06-12 14:52:48 Traceback (most recent call last):
2025-06-12 14:52:46   warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
2025-06-12 14:52:46 /usr/local/lib/python3.10/site-packages/pydub/utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
2025-06-12 14:52:43 2025-06-12 14:52:43.610 | INFO     | pipecat:<module>:13 - ᓚᘏᗢ Pipecat 0.0.67 ᓚᘏᗢ

Issues with Current Behavior

  1. Poor developer experience: 90-second wait with no feedback
  2. Hidden errors: Import failures and startup errors are not immediately visible
  3. Extra steps required: Users must remember to check logs manually
  4. Inefficient debugging: Slows down the development/deployment cycle

Proposed Solution

Option 1: Automatic Log Streaming

When deployment fails to reach ready state, automatically stream the recent logs to show what went wrong:

pcc deploy

Proposed output:

Updating deployment for agent 'agent-name'
╭─ ᓚᘏᗢ Error ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Deployment did not enter ready state within 90 seconds.                                                                                                                                                                 │
│                                                                                                                                                                                                                          │
│ Recent logs:                                                                                                                                                                                                             │
│ 2025-06-12 14:52:48 locale.Error: unsupported locale setting                                                                                                                                                            │
│ 2025-06-12 14:52:48     return _setlocale(category, locale)                                                                                                                                                              │
│ 2025-06-12 14:52:48   File "/usr/local/lib/python3.10/locale.py", line 620, in setlocale                                                                                                                               │
│ 2025-06-12 14:52:48     locale.setlocale(locale.LC_TIME, "fr_FR.UTF-8")                                                                                                                                                │
│ 2025-06-12 14:52:48   File "/app/bot.py", line 45, in <module>                                                                                                                                                          │
│                                                                                                                                                                                                                          │
│ Run `pcc agent logs agent-name` for complete logs                                                                                                                                                                       │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Option 2: Real-time Log Streaming Flag

Add a flag to stream logs during deployment:

pcc deploy --follow-logs
# or
pcc deploy -f

Option 3: Earlier Error Detection

Implement health checks or startup probes that can detect import failures faster than the current 90-second timeout.

Benefits

  • Faster debugging: Immediate visibility into deployment issues
  • Better UX: No need to remember additional commands
  • Reduced development cycle time: Faster feedback loop
  • Clearer error reporting: Errors are surfaced automatically

Additional Context

This issue is particularly problematic when developing and testing, as import errors (missing dependencies, syntax errors, etc.) are common and the current behavior significantly slows down the development workflow.

Common scenarios where this would help:

  • Missing system dependencies (like ffmpeg)
  • Python import errors
  • Configuration issues
  • Locale/environment setup problems

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions