Skip to content

1002 issue instead of 81 #755

Closed
Closed

Description

@RonanMorgan

Hi.

I receive a code 81 error shown in a stack trace (printed by ExceptionUtils.getStackTrace(exception)) :

ru.yandex.clickhouse.except.ClickHouseUnknownException: ClickHouse exception, code: 1002, host: host.net, port: 8123; Code: 81. DB::Exception: Database database_X doesn't exist.)

=> when I use exception.getErrorCode() it returned 1002
=> two "codes" are written in the stacktrace

here are the meaning of each code :
https://github.com/ClickHouse/clickhouse-jdbc/blob/094ed0b9d2dd8a18ae0c7b3f8f22c35e595822a6/clickhouse-jdbc/src/main/java/ru/yandex/clickhouse/except/ClickHouseErrorCode.java

I have upgraded my jdbc client to 0.3.2 and my version of clickhouse is 21.10.2.15 to be up to date but I have the same error.
Any idea why there are two codes in the stack trace ?

Greetings,
Ronan SY

Activity

  1. zhicwu commented on Nov 4, 2021

    @zhicwu
    Contributor

    Thanks for reporting the issue. It's a parsing issue as mentioned in #729 and it's been fixed in develop branch. In the upcoming new JDBC driver, it will try to extract error code from response header first, and then parse the error message.

    Lastly, I want to mention that 1) ClickHouseErrorCode is outdated and you may want to check here; 2) consider to use SQLState instead of specific error code.

  2. added this to the 0.3.2 Release milestone on Nov 4, 2021
  3. RonanMorgan commented on Nov 8, 2021

    @RonanMorgan
    Author

    thanks a lot !

  4. zhicwu commented on Nov 30, 2021

    @zhicwu
    Contributor

    Fixed in new JDBC driver:

    • http
      Error: Code: 81. DB::Exception: Database nondb doesn't exist. (UNKNOWN_DATABASE) (version 21.11.4.14 (official build))
       on server ClickHouseNode(addr=http:192.168.3.16:8123, db=default)@457087822
      SQLState:  07000
      ErrorCode: 81
      
    • grpc
      Error: DB::Exception: Database nondb doesn't exist on server ClickHouseNode(addr=grpc:192.168.3.16:9100, db=default)@1476795106
      SQLState:  07000
      ErrorCode: 81
      
  5. linked a pull request that will close this issueEnhance new JDBC driver #769on Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions