Skip to content

Failure: clickhouse-head-x86-with-analyzer-zookeeper/rbac_1/rbac_1 - DB::Exception: Couldn't delete /var/lib/clickhouse/access/38373166-2d31-6134-6164-373733313063.sql. (FILE_DOESNT_EXIST) #64

@CarlosFelipeOR

Description

@CarlosFelipeOR

Version: 25.11.1.2598

Description

When renaming a user to an existing user name, ALTER USER ... RENAME TO ... correctly returns ACCESS_ENTITY_ALREADY_EXISTS, but the rename is still partially applied internally.

As a result:

  1. user15 is renamed to user16 even though an exception is thrown.
  2. Two user16 entries appear in system.users.
  3. Dropping user16 and user15 removes both entries.
  4. Subsequent CREATE USER OR REPLACE user15 fails with FILE_DOESNT_EXIST or ACCESS_ENTITY_ALREADY_EXISTS(on CREATE USER user15).

This indicates that the rename operation is modifying internal metadata even after the exception, leading to RBAC corruption.

Steps to reproduce the issue

CREATE USER IF NOT EXISTS user15 IDENTIFIED WITH no_password;
CREATE USER IF NOT EXISTS user16 IDENTIFIED WITH no_password;
-- Check that user15 and user16 were created:
SELECT name, storage, id FROM system.users;

-- Expected error: ACCESS_ENTITY_ALREADY_EXISTS
ALTER USER user15 RENAME TO user16;

-- Problem: even though the previous command raises an exception,
-- user15 is actually renamed and now we have two `user16` entries:
SELECT name, storage, id FROM system.users;

DROP USER IF EXISTS user16;
DROP USER IF EXISTS user15;

-- Both `user16` entries are deleted:
SELECT name, storage, id FROM system.users;

-- This is the failure Code: 107(FILE_DOESNT_EXIST) that is later caught in the regression test :
CREATE USER OR REPLACE user15;

Versions tested:

  • 25.11.1.2648 - ❌ Failed
  • 25.10.2.65 - ✅ Passed
  • 25.9.5.21 - ✅ Passed
  • 25.8.11.66 - ✅ Passed

Issue on Upstream

ALTER USER RENAME applies changes even after throwing ACCESS_ENTITY_ALREADY_EXISTS, causing RBAC corruption


CI Run

https://github.com/Altinity/clickhouse-regression/actions/runs/19316216971/job/55247989837

Artifacts and Reports

Artifacts will be uploaded to https://altinity-test-reports.s3.amazonaws.com/index.html#clickhouse/25.11.1.2598/19316216971/testflows/x86_64/with_analyzer/zookeeper/without_thread_fuzzer/rbac1/
Review report at https://altinity-test-reports.s3.amazonaws.com/clickhouse/25.11.1.2598/19316216971/testflows/x86_64/with_analyzer/zookeeper/without_thread_fuzzer/rbac1/report.html
Review new fails (nice) at https://altinity-test-reports.s3.amazonaws.com/clickhouse/25.11.1.2598/19316216971/testflows/x86_64/with_analyzer/zookeeper/without_thread_fuzzer/rbac1/nice-new-fails.log.txt

Failure Description

Received exception from server (version 25.11.1):
Code: 107. DB::Exception: Received from localhost:9000. DB::Exception: Couldn't delete /var/lib/clickhouse/access/38373166-2d31-6134-6164-373733313063.sql. (FILE_DOESNT_EXIST)
(query: CREATE USER OR REPLACE user15 )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions