PermissionDeniedError classified as transient in semantic_processor: poison message blocks semantic queue forever
Subject
PermissionDeniedError is classified as transient in semantic_processor, so permission failures re-enqueue forever and block the semantic queue.
Description
PR #4232 stops parent refresh at namespace roots. That fix removes the known trigger from #4219. But the error classification gap remains. Any PermissionDeniedError raised while processing a semantic message still falls into the transient branch and re-enqueues forever.
I hit this on v0.4.16 via #4219. The poison message retried about every 30 seconds for 14 hours. The circuit breaker stayed open. All semantic processing for the user stalled. A restart did not clear it. I had to stop the server and delete the queue row from queue.db by hand.
Steps to reproduce
- Run v0.4.16.
- Trigger any code path that raises
openviking_cli.exceptions.PermissionDeniedErrorinsideSemanticProcessor.on_dequeue. #4219 provides one: a parent refresh forviking://user/u1builds the non-canonical URIviking://user/.overview.md. ACL resolution denies it. - Watch the queue. The message re-enqueues forever.
Root cause
In openviking/storage/queuefs/semantic_processor.py, the exception handler in on_dequeue calls classify_api_error(e). That function does not recognize openviking_cli.exceptions.PermissionDeniedError. So the error falls to the else branch. That branch logs "Transient API error processing semantic message, re-enqueueing" and calls _requeue_semantic_msg_after_error. The circuit breaker records a failure each time.
A permission denial is deterministic. Retrying it cannot succeed. One poisoned message then blocks the whole queue indefinitely.
Related prior art
- PR #2919 stopped re-enqueueing auth errors (HTTP 401/403) in the embedding handler. This report covers a different exception type in
semantic_processor. - PR #1531 classified filesystem errors such as
PermissionErroras permanent.openviking_cli.exceptions.PermissionDeniedErroris a distinct exception type. It is still unclassified. - Issue #2734 describes a similar poison-message pattern.
Suggested fix
Treat PermissionDeniedError (and permission/authorization exception types in general) as permanent in classify_api_error, or check for it in the on_dequeue handler. Log it at critical level. Mark the message failed. Drop it from the queue. Keep the error visible for diagnosis.
Environment
- OpenViking v0.4.16 from PyPI
- macOS, local server via launchd
Thanks for reporting this and for the detailed production evidence.
We confirmed the concrete failure path: parent bubbling from viking://user/{user_id} or viking://agent/skills could target the non-semantic namespace roots viking://user or viking://agent, then try to read sidecars such as viking://user/.overview.md.
This was fixed in #4232 by stopping parent refresh at the task-creation boundary while preserving valid semantic roots. The invalid work is no longer created, so we do not need to change the global model retry classifier for this reported case.
The fix is currently on main; v0.4.16 itself remains affected. Closing this issue as resolved by #4232. Thanks again!