-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Can't execute migrations for Clickhouse #380
Comments
Have same problem using v3 and v4. m, err := migrate.New(
"file:///path_to/db/migrations",
"clickhouse://localhost:8123?x-multi-statement=true&database=fura") After 180 seconds:
|
Same thing when I'm trying to execute |
Hi there, migrate -path=./migrations/ -database "clickhouse://${DB_HOST}:${DB_PORT}?username=${DB_USER}&password=${DB_PASSWORD}&database=main" up the following error occurs:
|
Got the same error message
|
I've got same issue
migrate command
|
Add tests to prevent regressions: golang-migrate#380 Tests are currently failing, presumably due to the same linked connection issue.
I'm able to reproduce the issue but don't know how to fix it. |
Guys, you are facing this problem, because of port 8123. It is used only for HTTP connections. This issue should be closed |
@finnan444 The tests are already using port 9000 but are failing |
Not sure about the tests but I ran into the same issue and applied what @finnan444 mentioned prior to seeing this issue. It resolves the issue with bad connections. Came here looking for a way to migrate every shard in the cluster with one execution of migrate. |
@finnan444 This fixes my problem! |
I'm also seeing this issue on an Altinity hosted cluster. Using the clickhouse client (below) works fine > docker run clickhouse/clickhouse-client -h myhost --port 9440 -s --user admin --password password However using the same options with migrate doesn't work > migrate -verbose -path ../metrics/staging/migrations -database "clickhouse://myhost:9440?username=admin&password=password&database=default" up 1
error: dial tcp: i/o timeout in line 0: SHOW TABLES FROM default LIKE 'schema_migrations' (tried with + without URL encoding on the password) |
@andyrichardson you need |
Same error, I think that's because that the production db is secured with SSL, but I don't see any SSL settings in CLI of migrate tool... |
@artur-shafikov you can add |
Hello, everyone! 👋 The issue is that clickhouse changed the format of the connection string URL, see this issue: ClickHouse/clickhouse-go#757 So to fix this issue just use a new format. I would be happy to fix the issue and provide the PR. |
Describe the Bug
I'm receiving "driver: bad connection" each time trying to execute migrations for Clickhouse. The error appears after 3 minutes.
Steps to Reproduce
example/001_init.up.sql
example/001_init.down.sql
Expected Behavior
Migration executed.
Migrate Version
v4.10.0
Obtained by running:
migrate -version
.Installed with brew.
Loaded Source Drivers
godoc-vfs, gcs, file, s3, github, github-ee, gitlab, go-bindata
Obtained by running:
migrate -help
Loaded Database Drivers
clickhouse, cockroach, firebirdsql, mongodb, crdb-postgres, postgresql, firebird, stub, spanner, sqlserver, cassandra, cockroachdb, mysql, postgres, redshift
Obtained by running:
migrate -help
Go Version
go version go1.13.4 darwin/amd64
Obtained by running:
go version
Stacktrace
Please provide if available
Additional context
Clickhouse version:
ClickHouse server version 20.1.4 revision 54431
The text was updated successfully, but these errors were encountered: