Skip to content

Conversation

@Leechael
Copy link

@Leechael Leechael commented Dec 22, 2025

Fix QGS daemon's inability to auto-recover from temporary network errors (e.g., PCCS returning unexpected HTTP status codes or connection timeouts).

Related issue: #450

When QPL fails to retrieve PCK certificates (e.g., HTTP 404 from PCCS),
the QGS context was not being released, causing all subsequent quote
requests to fail until the service was restarted.

This fix ensures context is released on failure at all critical points:

qgs_ql_logic.cpp:
- Release context when tee_att_init_quote fails (first request)
- Release context when tee_att_get_quote_size/get_quote fails
  (subsequent requests with existing context)

network_wrapper.cpp (Linux & Windows):
- Add error logging for HTTP 404 (no cache data) with full URL
- Add error logging for unexpected HTTP status codes

The root cause was that HTTP 404 errors from PCCS (indicating no
certificate data available) left the context in a corrupted state.
With this fix, the next request will automatically re-initialize
the context and retry.
@Leechael Leechael force-pushed the fix/qgsd-context-recovery-on-network-error branch from 2a7c69f to 96d3811 Compare December 25, 2025 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant