Skip to content

[#32074] DocDB: Fix webserver auth failing to start with --webserver_password_file#32135

Open
ddorian wants to merge 1 commit into
yugabyte:masterfrom
ddorian:fix-webserver-auth-option
Open

[#32074] DocDB: Fix webserver auth failing to start with --webserver_password_file#32135
ddorian wants to merge 1 commit into
yugabyte:masterfrom
ddorian:fix-webserver-auth-option

Conversation

@ddorian

@ddorian ddorian commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #32074

…bserver_password_file

Summary:
Setting --webserver_password_file (with --webserver_authentication_domain) to
enable Web UI authentication caused yb-master / yb-tserver to fail at startup:

  Webserver: Invalid option: global_passwords_file
  Webserver: Could not start on address 0.0.0.0:7000

The embedded webserver passes the password-file path to squeasel under the
option name "global_passwords_file", but the bundled squeasel registers that
config option as "global_auth_file" (GLOBAL_PASSWORDS_FILE is only the internal
enum index, not the option string). squeasel's sq_start() does not recognize the
name, logs "Invalid option", and returns NULL, so the webserver - and therefore
the whole process - never starts, making the documented webserver authentication
flags unusable.

Pass the correct "global_auth_file" option name so the password file is wired to
squeasel's HTTP digest auth.

Added a unit test that sets a password file, asserts the webserver starts, and
asserts an unauthenticated request is rejected with HTTP 401. The test fails
before this change (the server refuses to start).

Test Plan:
./yb_build.sh release --cxx-test webserver-test --gtest_filter 'WebserverAuthTest.*'

Passes with the fix. Reverting the option name to "global_passwords_file"
reproduces the failure:
  webserver.cc: Webserver: Invalid option: global_passwords_file
  Network error: Webserver: Could not start on address 0.0.0.0:0

---

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

LGTM — The changes fix the squeasel option-name mismatch by using 'global_auth_file' and add a regression test to verify unauthenticated requests are rejected.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

// md5("yugabyte:YugabyteDB:yugabyte").
ASSERT_OK(WriteStringToFile(
env_.get(),
Substitute("yugabyte:$0:0fbdc56fb215d4d2e29ff88863aa2da5\n", kAuthDomain),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Format instead of Substitute

// without credentials is rejected with HTTP 401.
TEST_F(WebserverAuthTest, TestUnauthenticatedRequestRejected) {
Status s = curl_.FetchURL(url_, &buf_);
ASSERT_EQ("Remote error: HTTP 401", s.ToString(/* no file/line */ false));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also test the success case

@hari90

hari90 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

PR summary does not match requirements

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.

[DocDB] yb-master/yb-tserver fail to start when --webserver_password_file is set (Web UI auth)

2 participants