Skip to content

UN-4123 [FIX] The default Redis user without a password is not an error - #2315

Merged
muhammad-ali-e merged 2 commits into
mainfrom
UN-4123-redis-default-user-noise
Oct 5, 2026
Merged

muhammad-ali-e merged 2 commits into
mainfrom
UN-4123-redis-default-user-noise

Conversation

@muhammad-ali-e

Copy link
Copy Markdown
Contributor

What

Exempt the username default from the "username set but no password" ERROR added in
6c0a69dec (#2299). The username is still dropped; only the logging is conditional.

Why

That diagnostic replaces redis-py's opaque DataError: Invalid input of type: 'NoneType'
on the first command with a message that names the values file. It is right for a named
ACL user. It is wrong for default.

default is Redis's own built-in user, and AUTH default <pw> is equivalent to
AUTH <pw> — so default with no password is not a misconfiguration. It is the
absence of ACL usage, which is the normal state for the in-cluster Redis that has no
password at all. Both values.yaml and sample.on-prem.values.yaml ship
REDIS_USER: default, so the error fired on every default on-prem install.

Measured on two staging namespaces before this fix:

unstract-onprem      274 occurrences / 20 min
unstract-onprem-ha   400+ / 20 min   (query limit)

across: log-history-scheduler, pg-api-file-processing, pg-executor,
        log-stream-consumer, log-consumer-v2, backend, bulk-download, migrations

Roughly 20,000 ERROR lines a day per namespace. Nothing was broken — the username
should be ignored and was. The cost is log volume, and real errors buried under it,
which is the opposite of what the diagnostic was for.

How it was found

Deploying rc.423 to a vanilla in-cluster on-prem namespace. Both managed-Redis
configurations set REDIS_USER: "" explicitly, so neither could surface it — only the
shipped default does, which is what most on-prem installs run.

How

if username and not password:
    if username.strip().lower() != "default":
        logger.error(...)
    username = None

username = None stays outside the condition, so behaviour is unchanged — a username
without a password is dropped either way, because redis-py cannot send one. A
non-default username without a password still reports, since that is the case that
becomes the opaque DataError.

Spelling and surrounding whitespace are normalised before the comparison: the chart writes
one spelling and a hand-edited values file may write another.

Can this PR break any existing features? If yes, please list possible items. If no, please explain why.

No.

  • The resolved connection parameters are identical in every case. username = None was
    already applied unconditionally and still is; only whether a line is logged changes.
  • default with a password is untouched and still sent as a two-argument AUTH —
    asserted by test_the_default_user_WITH_a_password_is_kept.
  • A named user without a password still errors — asserted by
    test_a_named_user_without_a_password_still_errors.

Relevant Docs

None.

Related Issues or PRs

Dependencies Versions / Env Variables

None.

Notes on Testing

  • tests/test_redis_client_config.py: 144 passed, including 5 new.
  • backend/tests/test_redis_settings_derivation.py: 92 passed (the backend resolver
    shares this code path).
  • Mutation-checked rather than assumed: removing the exemption fails exactly the three
    silence cases and nothing else.

Also worth fixing, not in this PR

charts/unstract-platform/values.yaml in unstract-cloud carries a comment claiming "The
on-prem sample now ships REDIS_USER: """
. It does not — sample.on-prem.values.yaml:190
ships REDIS_USER: default, same as the base at values.yaml:207. That belongs in a cloud
PR; noting it here so the inaccuracy is recorded.

🤖 Generated with Claude Code

6c0a69d added an ERROR when a username is set without a password, to replace
redis-py's opaque "DataError: Invalid input of type: 'NoneType'" on the first
command with something that names the values file. The diagnostic is right for a
named ACL user. It is wrong for "default".

"default" is Redis's own built-in user and `AUTH default <pw>` is equivalent to
`AUTH <pw>`, so "default with no password" is not a misconfiguration -- it is the
absence of ACL usage, which is the normal state for the in-cluster Redis that has
no password at all. values.yaml and sample.on-prem.values.yaml both ship
REDIS_USER: default, so the error fired on every default on-prem install.

Measured on two staging namespaces before this fix: ~274 lines in 20 minutes in
one and 400+ in the other, across eight pod types -- roughly 20k ERROR lines a
day per namespace. Nothing was broken; the username SHOULD be ignored and was.
The cost is log volume and real errors buried under it, which is what the
diagnostic was meant to prevent.

The username is still dropped either way, so behaviour is unchanged. Only the
logging is conditional, and a NON-default username without a password still
reports -- that is the case redis-py turns into the opaque DataError.

Found by deploying rc.423 to a vanilla in-cluster on-prem namespace. Both managed
configurations set REDIS_USER: "" explicitly, so neither could surface it; only
the shipped default does, which is what most on-prem installs run.

Mutation-checked: removing the exemption fails the three silence cases and
nothing else.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

via Greptile

RetriggerConfidence Score: 5/5

[Medium risk] Changes Redis configuration validation logic.

The PR appears safe to merge; the case-sensitive comparison addresses the prior diagnostic concern.

Summary

The PR suppresses the missing-password error for the built-in Redis user default while continuing to drop the username when no password is set. The latest change makes the exemption case-sensitive and tests that DEFAULT still produces the diagnostic.

Reviews (2) · Last reviewed commit: "UN-4123 [FIX] Address review: the defaul..."

Comment thread unstract/core/src/unstract/core/cache/redis_client.py Outdated
…itive

Redis ACL usernames are case-sensitive, so `DEFAULT` is a named user distinct
from the built-in `default`. Lowercasing the comparison suppressed the
missing-password diagnostic for it -- a real mistake made harder to diagnose,
which is the opposite of the point. Compare exactly.

The .strip() stays. env_chain returns the RAW value deliberately (stripping it
there truncated a password once, per the comment at its definition), so a
hand-edited values file can carry padding around a username that was meant to be
the built-in one. Whitespace is an editing artifact; case is semantic.

test_a_case_distinct_default_still_errors covers it, and "DEFAULT" is out of the
silence parametrize. Mutation-checked: restoring .lower() fails that test alone.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Oct 5, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Unstract test results

Per-group results

Status Group Tier Passed Failed Errors Skipped Duration (s)
✅ e2e-api-deployment e2e 3 0 0 0 14.6
✅ e2e-coowners e2e 1 0 0 0 1.7
✅ e2e-etl e2e 1 0 0 0 15.1
✅ e2e-login e2e 2 0 0 0 1.4
✅ e2e-prompt-studio e2e 1 0 0 0 4.9
✅ e2e-smoke e2e 2 0 0 0 1.5
✅ e2e-workflow e2e 1 0 0 0 14.5
✅ frontend unit 620 0 0 0 18.7
✅ integration-backend integration 603 0 0 26 38.9
✅ integration-connectors integration 1 0 0 7 5.5
✅ integration-workers integration 164 0 0 1 29.8
❌ ui e2e 0 1 0 0 0.0
✅ unit-backend unit 1422 0 0 1 47.4
✅ unit-connectors unit 72 0 0 0 10.3
✅ unit-core unit 281 0 0 0 3.3
✅ unit-platform-service unit 15 0 0 0 2.8
✅ unit-rig unit 120 0 0 0 4.7
✅ unit-runner unit 10 0 0 0 3.1
✅ unit-sdk1 unit 718 0 0 0 34.1
✅ unit-workers unit 1383 0 0 1 123.2
TOTAL 5420 1 0 36 375.5

Critical paths

⚠️ Critical paths not yet covered

  • workflow-execution-fan-out — Multi-file workflow execution fans out to file-processing workers and rejoins. (declared coverage: no groups declared)
✅ Covered critical paths
  • auth-login — covered by e2e-login
  • adapter-register-llm — covered by integration-backend
  • workflow-author — covered by integration-backend
  • co-owner-manage — covered by integration-backend, e2e-coowners
  • workflow-create-execute — covered by e2e-workflow
  • api-deployment-provision — covered by integration-backend
  • api-deployment-auth — covered by integration-backend
  • api-deployment-run — covered by e2e-api-deployment
  • mcp-server-auth — covered by integration-backend
  • mcp-platform-auth — covered by integration-backend
  • platform-key-whoami — covered by integration-backend
  • prompt-studio-author — covered by integration-backend
  • prompt-studio-fetch-response — covered by e2e-prompt-studio
  • connector-register-test — covered by integration-backend
  • pipeline-etl-execute — covered by e2e-etl
  • usage-aggregate-read — covered by integration-backend
  • usage-token-tracking — covered by e2e-api-deployment
  • callback-result-delivery — covered by e2e-api-deployment

@muhammad-ali-e
muhammad-ali-e merged commit 5261be2 into main Oct 5, 2026
14 checks passed
@muhammad-ali-e
muhammad-ali-e deleted the UN-4123-redis-default-user-noise branch October 5, 2026 13:35
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.

1 participant