Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply migration to clickhouse exposing only tcp secure port #515

Closed
gurvindersingh opened this issue Mar 2, 2021 · 2 comments
Closed

apply migration to clickhouse exposing only tcp secure port #515

gurvindersingh opened this issue Mar 2, 2021 · 2 comments

Comments

@gurvindersingh
Copy link

Describe the Bug
Current migrate tool, does not seem to detect that port being connected on requires SSL connection. So when applying migrations to clickhouse on secure port result in the error.

May be support needs to be added for SSL connection and give config parameter to enable it as needed.

Steps to Reproduce
Steps to reproduce the behavior:

  1. My migrations look like DROP DATABASE IF EXISTS test
  2. I ran migrate with the following options migrate -database "clickhouse://localhost:9440?x-multi-statement=true&username=admin&password=secure" -path migrations up
  3. See error
error: driver: bad connection

In server logs:
2021.03.02 12:15:47.292146 [ 107 ] {} <Error> ServerErrorHandler: Code: 210, e.displayText() = DB::NetException: SSL Exception: error:1400010B:SSL routines::wrong version number, while reading from socket ([::ffff:127.0.0.1]:34842), Stack trace (when copying this message, always include the lines below):

0. /server/build_docker/../contrib/poco/Foundation/src/Exception.cpp:27: Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x12d2cdf0 in /usr/bin/clickhouse
1. /server/build_docker/../src/Common/Exception.cpp:37: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x8eb87fd in /usr/bin/clickhouse
2. /server/build_docker/../src/Common/NetException.h:12: DB::ReadBufferFromPocoSocket::nextImpl() (.cold) @ 0x8c05204 in /usr/bin/clickhouse
3. /server/build_docker/../src/IO/ReadBuffer.h:59: DB::TCPHandler::runImpl() @ 0x10122839 in /usr/bin/clickhouse
4. /server/build_docker/../src/Server/TCPHandler.cpp:1219: DB::TCPHandler::run() @ 0x101232c0 in /usr/bin/clickhouse
5. /server/build_docker/../contrib/poco/Net/src/TCPServerConnection.cpp:57: Poco::Net::TCPServerConnection::start() @ 0x12c63b3b in /usr/bin/clickhouse
6. /server/build_docker/../contrib/libcxx/include/atomic:856: Poco::Net::TCPServerDispatcher::run() @ 0x12c63f4b in /usr/bin/clickhouse
7. /server/build_docker/../contrib/poco/Foundation/include/Poco/Mutex_POSIX.h:59: Poco::PooledThread::run() @ 0x12daa0d6 in /usr/bin/clickhouse
8. /server/build_docker/../contrib/poco/Foundation/include/Poco/AutoPtr.h:223: Poco::ThreadImpl::runnableEntry(void*) @ 0x12da6890 in /usr/bin/clickhouse
9. start_thread @ 0x9609 in /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
10. clone @ 0x122293 in /usr/lib/x86_64-linux-gnu/libc-2.31.so
 (version 20.8.7.15)

Expected Behavior
Migration applied successfully.

Migrate Version
v4.14.1

Loaded Source Drivers
e.g. s3, github, go-bindata, gcs, file
Obtained by running: migrate -help

Loaded Database Drivers
Source drivers: godoc-vfs, gcs, go-bindata, bitbucket, github, github-ee, gitlab, file, s3
Database drivers: cassandra, mongodb, mysql, spanner, firebird, postgres, stub, cockroach, cockroachdb, neo4j, postgresql, sqlserver, clickhouse, crdb-postgres, firebirdsql, mongodb+srv, redshift

@gurvindersingh gurvindersingh changed the title apply migration to clichouse exposing only tcp secure port apply migration to clickhouse exposing only tcp secure port Mar 3, 2021
@dhui
Copy link
Member

dhui commented Apr 6, 2021

Have you tried specifying TLS options?

@gurvindersingh
Copy link
Author

Forgot to update the issue, it is working with these options for future reference

migrate -database "clickhouse://localhost:9440?x-multi-statement=true&username=username&password=password&secure=true&skip_verify=true" -path migrations up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants