Skip to content

docs: Fix the "Could not open websocket" / multiple-accounts OAuth troubleshooting - #8637

Merged
philippjfr merged 1 commit into
mainfrom
docs-azure-oauth-multiaccount-websocket
Jun 5, 2026
Merged

docs: Fix the "Could not open websocket" / multiple-accounts OAuth troubleshooting#8637
philippjfr merged 1 commit into
mainfrom
docs-azure-oauth-multiaccount-websocket

Conversation

@MarcSkovMadsen

Copy link
Copy Markdown
Collaborator

Summary

Addresses the documentation half of #8634 ("Azure OAuth not working with multiple accounts").

The OAuth troubleshooting guide currently attributes the "Could not open websocket" failure to "multiple accounts" and recommends incognito / clearing cookies / a different browser. Investigation of #8634 shows that description is misleading:

  • The real cause is request-header size. Bokeh embeds the originating request's OAuth cookies into the session token, which the browser sends back in the Sec-WebSocket-Protocol header on the /ws upgrade. When that header exceeds the proxy's per-request-header buffer (nginx large_client_header_buffers, default 8 KB) the proxy returns HTTP 400 and the upgrade never reaches the Panel server.
  • "Multiple accounts" don't enlarge the app's request headers (those cookies live on the identity provider's domain). Incognito / another browser only appear to fix it because they carry slightly smaller headers and slip back under the limit — not a reliable fix.

Changes

doc/how_to/authentication/trouble_shooting.md

  • Replace Cause: Token Too Big + Cause: Multiple Accounts with Cause: Request Headers Too Big, explaining the mechanism, how to diagnose it (DevTools / net-export, the HTTP 400, the Sec-WebSocket-Protocol/Cookie header sizes), and real fixes:
    1. raise the proxy request-header buffer (incl. the ingress-nginx ConfigMap caveat — it isn't a per-Ingress annotation);
    2. --exclude-cookies access_token id_token refresh_token (with the pn.state.* tradeoff);
    3. reduce token size (fewer scopes, Azure group overage);
    4. drop the encryption key.
  • Add "A note on multiple accounts" clarifying they aren't the cause, and pointing to prompt for controlling account selection.

doc/how_to/authentication/providers/azure.md

Related

🤖 Generated with Claude Code

… issue

The OAuth troubleshooting guide attributed 'Could not open websocket' to
'multiple accounts' and recommended incognito/clearing cookies. The real
cause is almost always request-header size: the Sec-WebSocket-Protocol
session token embeds the OAuth cookies and exceeds the proxy's per-header
buffer (nginx large_client_header_buffers, default 8KB), so the upgrade is
rejected before reaching the server.

- Rewrite the troubleshooting section to explain the real cause, how to
  diagnose it, and the real fixes (raise the proxy request-header buffer
  incl. the ingress-nginx ConfigMap caveat, --exclude-cookies, reduce token
  size, drop encryption key).
- Add a 'note on multiple accounts' clarifying they don't enlarge app
  request headers, and document oauth_extra_params prompt=select_account for
  controlling account selection.
- Document the same prompt/multiple-account guidance in the Azure provider
  docs.

Refs #8634, #7909.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@philippjfr
philippjfr merged commit fe4f6c2 into main Jun 5, 2026
9 of 12 checks passed
@philippjfr
philippjfr deleted the docs-azure-oauth-multiaccount-websocket branch June 5, 2026 09:51
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