fix: use ephemeral mode in OrchestrationClient to prevent read-only container failures#20905
Open
Br1an67 wants to merge 1 commit intoPrefectHQ:mainfrom
Open
fix: use ephemeral mode in OrchestrationClient to prevent read-only container failures#20905Br1an67 wants to merge 1 commit intoPrefectHQ:mainfrom
Br1an67 wants to merge 1 commit intoPrefectHQ:mainfrom
Conversation
…ontainer failures Closes PrefectHQ#19317 Background services (actions service) use OrchestrationClient, which calls create_app(). This triggers UI static directory creation, which fails with PermissionError in read-only containers (common in rootless/secure deployments), causing automation actions to silently fail and messages to go to DLQ. Changes: - Pass ephemeral=True to create_app() in BaseClient, skipping UI directory creation - Add exception logging in action consumer so unexpected errors are visible - Add regression test for ephemeral mode usage
03a04e6 to
f5c8c29
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #19317
Background services (e.g. actions service) use
OrchestrationClient, which callscreate_app(). This triggers UI static directory creation viacreate_ui_static_subpath(), which fails withPermissionErrorin read-only containers (common in rootless/secure deployments). The exception is swallowed, causing automation actions to silently fail and messages to go to DLQ with no error logs.Changes
1. Skip UI creation for OrchestrationClient (
src/prefect/server/api/clients.py)Pass
ephemeral=Truetocreate_app()inBaseClient.__init__. Background services use in-memory ASGI transport and don't need the UI —ephemeral=Trueskips UI directory creation, preventingPermissionErrorin read-only containers.2. Add error logging for unexpected action failures (
src/prefect/server/events/actions.py)Catch and log unexpected exceptions in the action consumer before re-raising. This provides visibility when actions fail for reasons other than
ActionFailed, instead of messages silently going to DLQ.3. Regression test (
tests/server/api/test_clients.py)Verifies that
OrchestrationClientcreates the app in ephemeral mode.Checklist
<link to issue>"mint.json.