Skip to content

server: preserve websocket close code when proxying to outposts (cherry-pick #26090 to version-2026.8) - #26132

Merged
BeryJu merged 1 commit into
version-2026.8from
cherry-pick/26090-to-version-2026.8
Sep 14, 2026
Merged

BeryJu merged 1 commit into
version-2026.8from
cherry-pick/26090-to-version-2026.8

Conversation

@authentik-cherry-pick

Copy link
Copy Markdown
Contributor

Cherry-pick of #26090 to version-2026.8 branch.

Original PR: #26090
Original Author: @robisonjoel
Cherry-picked commit: fce697d

* server: preserve websocket close code when proxying to outposts

The websocket proxy that bridges outpost connections to the gunicorn/uvicorn
backend replaced every relayed close frame with a code-less close
(`Message::Close(None)`), discarding the status code and reason from the peer.

When a web worker is recycled (routinely, via web.max_requests) or restarted on
upgrade, uvicorn closes the outpost websocket gracefully with 1012 (service
restart). Because the proxy relayed `Close(None)`, the outpost instead received a
close frame with no status code, which surfaces as `websocket: close 1005 (no
status)` and is logged at warning level - indistinguishable from a genuine fault,
so a healthy deployment warns on every recycle and trips outpost-disconnect
alerting. The reverse direction stripped the outpost's own close code too.

Relay the received close frame verbatim in both directions so the peer sees the
real close code and reason. The tail-of-stream case (peer closes without sending
a Close frame) still sends `Close(None)`, which is correct.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* no claude comments

Signed-off-by: Jens Langhammer <[email protected]>

---------

Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
Co-authored-by: Jens Langhammer <[email protected]>
@netlify

netlify Bot commented Sep 14, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit 7e2bc6c
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6aa7ee0374628f0008fcf69a
😎 Deploy Preview https://deploy-preview-26132--authentik-integrations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Sep 14, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 7e2bc6c
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6aa7ee03598b0f0008a3b71c
😎 Deploy Preview https://deploy-preview-26132--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.81%. Comparing base (b4392ba) to head (7e2bc6c).
⚠️ Report is 1 commits behind head on version-2026.8.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/server/core.rs 0.00% 4 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           version-2026.8   #26132   +/-   ##
===============================================
  Coverage           91.81%   91.81%           
===============================================
  Files                1160     1160           
  Lines               74633    74635    +2     
  Branches             4054     4056    +2     
===============================================
+ Hits                68525    68527    +2     
  Misses               6066     6066           
  Partials               42       42           
Flag Coverage Δ
conformance 33.89% <ø> (+<0.01%) ⬆️
e2e 38.54% <ø> (+<0.01%) ⬆️
integration 30.53% <ø> (+<0.01%) ⬆️
rust 42.89% <0.00%> (-0.03%) ⬇️
unit 93.37% <ø> (+<0.01%) ⬆️
unit-migrate 93.40% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@github-actions

Copy link
Copy Markdown
Contributor

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-7e2bc6cec1b773b1a9589894b36a93198e84ecd6
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
    image:
        repository: ghcr.io/goauthentik/dev-server
        tag: gh-7e2bc6cec1b773b1a9589894b36a93198e84ecd6

Afterwards, run the upgrade commands from the latest release notes.

@BeryJu
BeryJu merged commit 1d11156 into version-2026.8 Sep 14, 2026
137 of 138 checks passed
@BeryJu
BeryJu deleted the cherry-pick/26090-to-version-2026.8 branch September 14, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants