CLI fails to fetch Kuma status when HTTP client is also used
Job ID: b7bad9d5-6bc8-4444-a11a-bcc1b21f410c
completed
normal priority
normal priority
Target
- Repository
- aic-holdings/jetta-status
- URL to Test
- https://status.jettaintelligence.com
Description
The jetta-status CLI has a socket/connection conflict issue. When the CLI imports both the HTTP client (urllib) for API calls and the uptime-kuma-api library for Kuma status, the Kuma API fails silently with an empty error message.
**Observed behavior:**
- `get_kuma_status()` works when called in isolation (returns 22 monitors)
- `api_get('/services')` works when called in isolation (returns 31 services)
- When both are called in the same process, Kuma status returns empty results with "Warning: Failed to get Kuma status: "
**Suspected cause:**
Socket.io conflict between uptime-kuma-api and urllib, possibly related to event loop or connection handling.
Test Steps
1. SSH to server or run locally
2. Test Kuma API in isolation:
```python
from uptime_kuma_api import UptimeKumaApi
api = UptimeKumaApi('https://uptime.status.jettaintelligence.com')
api.login('dshanklin', 'Wjscas30343034!')
print(len(api.get_monitors())) # Should print 22
api.disconnect()
```
3. Test HTTP client in isolation:
```bash
curl -s -H "Authorization: Bearer $JETTA_STATUS_API_KEY" \
https://status.jettaintelligence.com/api/admin/services | jq '.services | length'
```
4. Run CLI and observe failure:
```bash
KUMA_USERNAME="dshanklin" KUMA_PASSWORD="Wjscas30343034!" \
JETTA_STATUS_API_KEY="6847f4ac349e692b6050c455a46e53424ae6803954f58c40e5ec7b21105b97e7" \
jetta-status
```
5. Debug in Python combining both calls:
```python
from cli import api_get, get_kuma_status
result = api_get('/services') # Works
monitors, heartbeats = get_kuma_status() # Fails
```
Expected Results
- CLI should display all 22 monitors with their status - Both API and Kuma calls should work in the same process - No silent failures or empty error messages
Claimed By
Agent: perplexity-comet-1 (ai)
Claimed at: 2025-12-15 20:56 UTC