Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Certificate file /etc/clickhouse-server/server.crt No such file or directory #91

Open
@patsevanton

Description

@patsevanton

Hello! Thanks for role clickhouse
I try install and get error

CertificateReloader: Cannot obtain modification time for key file /etc/clickhouse-server/server.key, skipping update. errno: 2, strerror: No such file or directory

Playbook

  - hosts: clickhouse_cluster
    become: true
    pre_tasks:
      - name: Update apt cache.
        apt: update_cache=true cache_valid_time=600
        when: ansible_os_family == 'Debian'
      - name: Remove 127.0.1.1 from /etc/hosts for Yandex Cloud
        lineinfile:
          path: /etc/hosts
          state: absent
          regexp: '^127.0.1.1'
    roles:
      - ansible-clickhouse

Inventory

all:
  children:
    clickhouse_cluster:
      hosts:
        clickhouse0:
          ansible_host: xxx
        clickhouse1:
          ansible_host: xxx
        clickhouse2:
          ansible_host: xxx
  vars:
    ansible_user:  ubuntu
    ansible_ssh_private_key_file: ~/.ssh/id_rsa
    clickhouse_users_custom:
      - { name: "testuser",
          password_sha256_hex: "f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2",
          networks: "{{ clickhouse_networks_default }}",
          profile: "default",
          quota: "default",
          dbs: [ testu1 ] ,
          comment: "classic user with plain password"}
      - { name: "testuser2",
          password: "testplpassword",
          networks: "{{ clickhouse_networks_default }}",
          profile: "default",
          quota: "default",
          dbs: [ testu2 ] ,
          comment: "classic user with hex password"}
      - { name: "testuser3",
          password: "testplpassword",
          networks: { 192.168.0.0/24, 10.0.0.0/8 },
          profile: "default",
          quota: "default",
          dbs: [ testu1,testu2,testu3 ] ,
          comment: "classic user with multi dbs and multi-custom network allow password"}
    clickhouse_query_log_ttl: 'event_date + INTERVAL 7  DELETE'
    clickhouse_dicts:
      test1:
        name: test_dict
        odbc_source:
          connection_string: "DSN=testdb"
          source_table: "dict_source"
        lifetime:
          min: 300
          max: 360
        layout: hashed
        structure:
          key: "testIntKey"
          attributes:
            - { name: testAttrName, type: UInt32, null_value: 0 }
      test2:
        name: test_dict
        odbc_source:
          connection_string: "DSN=testdb"
          source_table: "dict_source"
        lifetime:
          min: 300
          max: 360
        layout: complex_key_hashed
        structure:
          key:
            attributes:
              - { name: testAttrComplexName, type: String }
          attributes:
            - { name: testAttrName, type: String, null_value: "" }
    clickhouse_dbs_custom:
      - { name: testu1 }
      - { name: testu2, state:present }
      - { name: testu3, state:absent }
    clickhouse_clusters:
      your_cluster_name:
        shard_1:

          - { host: "clickhouse0", port: 9000 }

          - { host: "clickhouse1", port: 9000 }

          - { host: "clickhouse2", port: 9000 }
     
    clickhouse_zookeeper_nodes:
      - { host: "clickhouse0", port: 2181 }
      - { host: "clickhouse1", port: 2181 }
      - { host: "clickhouse2", port: 2181 }

Ansible output

TASK [ansible-clickhouse : Wait for Clickhouse Server to Become Ready] *****************************************************************************************************************
Monday 04 April 2022  13:39:15 +0600 (0:00:01.407)       0:02:23.761 **********
fatal: [clickhouse1]: FAILED! => changed=false
  elapsed: 300
  msg: Timeout when waiting for 127.0.0.1:9000
fatal: [clickhouse2]: FAILED! => changed=false
  elapsed: 300
  msg: Timeout when waiting for 127.0.0.1:9000
fatal: [clickhouse0]: FAILED! => changed=false
  elapsed: 300
  msg: Timeout when waiting for 127.0.0.1:9000

clickhouse-server.err.log

8. main @ 0xa4d81ea in /usr/bin/clickhouse
9. __libc_start_main @ 0x7f99c27ce0b3 in ?
10. _start @ 0xa2d15ee in /usr/bin/clickhouse
 (version 22.3.2.1)
2022.04.04 07:54:31.484906 [ 5289 ] {} <Error> Application: DB::Exception: Syntax error (Storage to create table for query_log): failed at position 85 ('DELETE'): DELETE ORDER BY (event_date, event_time). Expected one of: token, DoubleColon, MOD, DIV, NOT, BETWEEN, LIKE, ILIKE, NOT LIKE, NOT ILIKE, IN, NOT IN, GLOBAL IN, GLOBAL NOT IN, IS, AND, OR, QuestionMark, alias, AS, SECOND, SQL_TSI_SECOND, SS, S, MINUTE, SQL_TSI_MINUTE, MI, N, HOUR, SQL_TSI_HOUR, HH, DAY, SQL_TSI_DAY, DD, D, WEEK, SQL_TSI_WEEK, WK, WW, MONTH, SQL_TSI_MONTH, MM, M, QUARTER, SQL_TSI_QUARTER, QQ, Q, YEAR, SQL_TSI_YEAR, YYYY, YY, end of query
2022.04.04 07:55:01.955613 [ 5364 ] {} <Warning> Application: Calculated checksum of the binary: 51010DC62C0638E7259D2BDDE72C485C. There is no information about the reference checksum.
2022.04.04 07:55:01.974060 [ 5364 ] {} <Error> CertificateReloader: Cannot obtain modification time for certificate file /etc/clickhouse-server/server.crt, skipping update. errno: 2, strerror: No such file or directory
2022.04.04 07:55:01.974087 [ 5364 ] {} <Error> CertificateReloader: Cannot obtain modification time for key file /etc/clickhouse-server/server.key, skipping update. errno: 2, strerror: No such file or directory
2022.04.04 07:55:01.974386 [ 5364 ] {} <Error> CertificateReloader: Poco::Exception. Code: 1000, e.code() = 0, SSL context exception: Error loading private key from file /etc/clickhouse-server/server.key: error:02000002:system library:OPENSSL_internal:No such file or directory (version 22.3.2.1)
2022.04.04 07:55:01.982144 [ 5364 ] {} <Error> Application: Caught exception while loading metadata: Code: 62. DB::Exception: Syntax error (Storage to create table for query_log): failed at position 85 ('DELETE'): DELETE ORDER BY (event_date, event_time). Expected one of: token, DoubleColon, MOD, DIV, NOT, BETWEEN, LIKE, ILIKE, NOT LIKE, NOT ILIKE, IN, NOT IN, GLOBAL IN, GLOBAL NOT IN, IS, AND, OR, QuestionMark, alias, AS, SECOND, SQL_TSI_SECOND, SS, S, MINUTE, SQL_TSI_MINUTE, MI, N, HOUR, SQL_TSI_HOUR, HH, DAY, SQL_TSI_DAY, DD, D, WEEK, SQL_TSI_WEEK, WK, WW, MONTH, SQL_TSI_MONTH, MM, M, QUARTER, SQL_TSI_QUARTER, QQ, Q, YEAR, SQL_TSI_YEAR, YYYY, YY, end of query. (SYNTAX_ERROR), Stack trace (when copying this message, always include the lines below):

0. DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0xa4dde1a in /usr/bin/clickhouse
1. DB::parseQueryAndMovePosition(DB::IParser&, char const*&, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, unsigned long, unsigned long) @ 0x159d3a9f in /usr/bin/clickhouse
2. DB::SystemLogs::SystemLogs(std::__1::shared_ptr<DB::Context const>, Poco::Util::AbstractConfiguration const&) @ 0x147b831b in /usr/bin/clickhouse
3. DB::Context::initializeSystemLogs() @ 0x140d442f in /usr/bin/clickhouse
4. DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) @ 0xa564827 in /usr/bin/clickhouse
5. Poco::Util::Application::run() @ 0x164cb146 in /usr/bin/clickhouse
6. DB::Server::run() @ 0xa556c51 in /usr/bin/clickhouse
7. mainEntryClickHouseServer(int, char**) @ 0xa554227 in /usr/bin/clickhouse

Version

clickhouse-server/stable,stable,now 22.3.2.2

Environment

Version

ansible [core 2.12.2]
  python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]

Server where ansible

cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"

Remote server

cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions