Skip to content

ERROR error rsp for use db, error:Database not exist, dbFName:log #21822#33451

Draft
ljluestc wants to merge 1 commit into
taosdata:mainfrom
ljluestc:issue-21822
Draft

ERROR error rsp for use db, error:Database not exist, dbFName:log #21822#33451
ljluestc wants to merge 1 commit into
taosdata:mainfrom
ljluestc:issue-21822

Conversation

@ljluestc

@ljluestc ljluestc commented Nov 2, 2025

Copy link
Copy Markdown

Description

  • Fix taosKeeper “Database not exist” errors by eliminating implicit USE and fully qualifying all SQL with the metrics/audit database name.
  • Use non-DB-bound connectors for creation/inserts and reuse a single connector where appropriate.
  • Harden logging setup to avoid panics and permission issues; auto-create or fall back when log dir isn’t writable.
  • Stabilize tests: auto-skip integration tests when REST (127.0.0.1:6041) is unavailable; make system/TestInit opt-in via env.
  • Avoid privileged port binding in tests by using an ephemeral port for the program server.

Key Changes

  • SQL qualification and connector usage:
    • tools/keeper/api/report.go: qualify CREATE/INSERT, fix minor SQL syntax.
    • tools/keeper/api/common.go: non-DB-bound connector; qualify CREATE SQL.
    • tools/keeper/monitor/monitor.go: reuse non-DB-bound connection; qualify INSERT; identity remains hostname:port.
  • Logging robustness:
    • tools/keeper/infrastructure/log/log.go: ensure log directory, fall back to temp/writable path, don’t panic on rotation init failures.
  • Test stabilization:
    • tools/keeper/api/adapter2_test.go
    • tools/keeper/api/gen_metric_test.go
    • tools/keeper/api/https_test.go
    • tools/keeper/api/tables_test.go
    • tools/keeper/api/audit_test.go
      • Each now skips when 127.0.0.1:6041 is unreachable.
    • tools/keeper/system/program_test.go
      • TestInit opt-in via TAOS_KEEPER_RUN_INIT_TEST=1 and REST check.
      • Test_program binds to 127.0.0.1:0 (ephemeral port), avoiding port 80 errors.

@ljluestc ljluestc changed the title fix tests ERROR error rsp for use db, error:Database not exist, dbFName:log #21822 Nov 2, 2025
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

3 participants