Skip to content

fix bug in case that rest catalog has wrong auth_header - #96680

Merged
hanfei1991 merged 9 commits into
ClickHouse:masterfrom
hanfei1991:hanfei/fix-rest-catalog
Feb 21, 2026
Merged

hanfei1991 merged 9 commits into
ClickHouse:masterfrom
hanfei1991:hanfei/fix-rest-catalog

Conversation

@hanfei1991

@hanfei1991 hanfei1991 commented Feb 11, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

when we create a restful datalake catalog with a invalid auth_header, it will break system.tables. We should catch this exception.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.2.1.1006

@clickhouse-gh

clickhouse-gh Bot commented Feb 11, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [465616f]

Summary: ❌

job_name test_name status info comment
Integration tests (amd_asan, flaky) failure
test_database_hms/test.py::test_hive_catalog_url_parsing[3-3] FAIL cidb
test_database_hms/test.py::test_hive_catalog_url_parsing[1-3] FAIL cidb
test_database_hms/test.py::test_hive_catalog_url_parsing[2-3] FAIL cidb
Stateless tests (arm_asan, azure, parallel) failure
01038_dictionary_lifetime_min_zero_sec FAIL cidb
BuzzHouse (amd_tsan) failure
Logical error: Digest does not match (STID: 5029-4dec) FAIL cidb, issue

@hanfei1991 hanfei1991 changed the title fix bug when rest catalog has wrong auth_header fix bug in case that rest catalog has wrong auth_header Feb 11, 2026
@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Feb 11, 2026
@Algunenano Algunenano self-assigned this Feb 17, 2026
try
{
iceberg_tables = catalog->getTables();
iceberg_tables = getCatalog()->getTables();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Needs the same change in getTablesIterator (which is why the test are failing).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also I see multiple other calls to getCatalog() that might have a similar issue and, even worse, that getCatalog() can return nullptr in some situations and we dereference it without any checks

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

AFAICT getCatalog() can still return nullptr's, and there are other usages of getCatalog() in this file that might need similar treatment

@hanfei1991 hanfei1991 Feb 19, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I read the code again. and nullptr looks not possible because if it's DatabaseDataLakeCatalogType::NONE, it will throw throw Exception(code: ErrorCodes::BAD_ARGUMENTS, fmt: "Unspecified catalog type"); in getCatalog().
see https://github.com/ClickHouse/ClickHouse/pull/88987/changes#diff-b3d41aa50f5e1e900316e8da7c3eafa738c84d95a52e99c1422844916cf28c12R121

This PR aims to catch the exception from system.tables. for other usage of getCatalog(), I don't know if we should catch the exception.

@hanfei1991
hanfei1991 enabled auto-merge February 21, 2026 02:01
@hanfei1991
hanfei1991 disabled auto-merge February 21, 2026 11:59
@hanfei1991
hanfei1991 added this pull request to the merge queue Feb 21, 2026
Merged via the queue into ClickHouse:master with commit 59e0bfd Feb 21, 2026
141 of 144 checks passed
@hanfei1991
hanfei1991 deleted the hanfei/fix-rest-catalog branch February 21, 2026 12:18
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Feb 21, 2026
Algunenano added a commit that referenced this pull request Jul 6, 2026
Resolve conflicts for the backport of #98827 to 25.8:
- Keep only the new `HTTPHeaderFilter.h` include (25.8 has no `FailPoint.h` include here).
- `test_database_iceberg`: keep only the new `test_invalid_auth_header_format`, dropping master-only tests.
- `test_database_iceberg_nessie_catalog` does not exist in 25.8, keep it deleted.
- `03913_datalake_restful_catalog_bad_format`: keep only the forbidden-header check added by this PR. The first half of the master test relies on #96680, which is not in 25.8.

Co-Authored-By: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants