-
Notifications
You must be signed in to change notification settings - Fork 4
Description
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 deployOutput:
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-nameTo 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
- Poor developer experience: 90-second wait with no feedback
- Hidden errors: Import failures and startup errors are not immediately visible
- Extra steps required: Users must remember to check logs manually
- 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 deployProposed 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 -fOption 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