?
CDEV-28
bug
Created: 2025-12-25 Updated: 2025-12-25
Relationships Loading...
Attachments
Loading...
Comments (3)
qa-agent · 2025-12-25
[QA] VERIFIED - CDEV-28 fixes are working correctly: **Exec stdout capture fix**: Tests that assert on stdout content now PASS: - test_full_lifecycle ✓ - test_exec_multiple_commands ✓ **Timeout fix**: No more timeout errors: - test_lifecycle_with_restart ✓ (was timing out before) **2 tests still fail due to UNRELATED issues** (tracked in CDEV-29): - test_connect_info_desktop_container - fails because curl is missing in container - test_create_container_success - fails because curl is missing in container The CDEV-28 fixes are complete. The remaining failures are a separate issue (missing curl in base image).
agent · 2025-12-25
## Fix Applied ### Bug 1: Exec stdout capture not working **Location:** `app/services/incus.py:415-420` **Root Cause:** The code was accessing `metadata.output` directly, but the Incus API returns the exec result in a nested structure at `metadata.metadata.output`. The operation result from `_wait_for_operation` contains the outer metadata (operation info) with the inner metadata (exec result) nested inside. **Fix:** Changed the metadata extraction to properly access the nested structure: ```python metadata = data.get('metadata', {}) inner_metadata = metadata.get('metadata', {}) output = inner_metadata.get('output', {}) return_code = inner_metadata.get('return', 0) ``` ### Bug 2: Desktop container creation timeout **Location:** `app/services/incus.py:121` **Root Cause:** The httpx client timeout was 30 seconds, but `_wait_for_operation` waits up to 60 seconds for async operations. This mismatch caused timeouts when waiting for long-running operations like container creation. **Fix:** Increased httpx client timeout from 30s to 120s (double the operation wait timeout). ### Tests Updated Updated `tests/test_incus_client.py::test_exec_command` to: 1. Use the correct nested metadata structure matching the actual Incus API response 2. Assert on stdout and stderr content (not just return code) ### Verification All 340 unit tests pass. Integration tests are skipped (Incus not available on this machine).
triage-agent · 2025-12-25
## Bug Triage Complete **Reproduction:** CONFIRMED (via code analysis and direct API testing) ### Summary **Bug 1: Exec stdout capture not working** - **Location:** `app/services/incus.py:415-417` - **Root Cause:** Code accesses `metadata.output` but API returns nested `metadata.metadata.output` - **Fix:** Change to `metadata.get('metadata', {}).get('output', {})` **Bug 2: Desktop container creation timeout** - **Location:** `app/services/incus.py:121, 183` - **Root Cause:** httpx client timeout (30s) is shorter than operation wait timeout (60s) - **Fix:** Increase httpx timeout to 120s or make configurable ### TDD Approach 1. Write failing tests that verify correct nested metadata extraction 2. Write tests that verify timeout alignment 3. Implement fixes 4. Verify integration tests pass ### Priority High - These are core container management functionality bugs. ### Complexity Low - Both are straightforward fixes. See attached triage report for full details.