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

error with mariadb:10.2: recv failed with: :timeout #194

Closed
seeekr opened this issue Jul 15, 2017 · 5 comments
Closed

error with mariadb:10.2: recv failed with: :timeout #194

seeekr opened this issue Jul 15, 2017 · 5 comments

Comments

@seeekr
Copy link

seeekr commented Jul 15, 2017

Running mix ecto.migrate with just a simple, example User model and nothing else on a new phoenix app gives me this error with MariaDB 10.2.x consistently:

$ mix ecto.migrate


18:47:57.345 [error] Could not retrieve migrated versions. This error typically happens when the "schema_migrations" table, which Ecto uses for storing migrationinformation, is already used by another library or for other purposes.

You can fix this by running `mix ecto.drop` in the appropriate `MIX_ENV` to drop the existing database and let Ecto start a new one with a proper definition of "schema_migrations" or by configuring the repository to use another source:

    config :backend_exs, BackendExs.Repo,
      migration_source: "some_other_table_for_schema_migrations"

The full error is shown below.


18:47:57.345 [error] Mariaex.Protocol (#PID<0.187.0>) disconnected: ** (Mariaex.Error) [tcp] `recv` failed with: :timeout
** (Mariaex.Error) [tcp] `recv` failed with: :timeout
    (ecto) lib/ecto/adapters/sql.ex:436: Ecto.Adapters.SQL.execute_and_cache/7
    (ecto) lib/ecto/repo/queryable.ex:130: Ecto.Repo.Queryable.execute/5
    (ecto) lib/ecto/repo/queryable.ex:35: Ecto.Repo.Queryable.all/4
    (ecto) lib/ecto/migrator.ex:276: Ecto.Migrator.verbose_schema_migration/3
    (ecto) lib/ecto/migrator.ex:148: Ecto.Migrator.run/4
    (ecto) lib/mix/tasks/ecto.migrate.ex:84: anonymous fn/4 in Mix.Tasks.Ecto.Migrate.run/2
    (elixir) lib/enum.ex:645: Enum."-each/2-lists^foreach/1-0-"/2
    (elixir) lib/enum.ex:645: Enum.each/2
    (mix) lib/mix/task.ex:300: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2
    (elixir) lib/code.ex:370: Code.require_file/2

Works fine with MySQL 5.6.x. Running latest versions of everything. Mac OS X 10.11, Docker for Mac used for running MySQL/MariaDB.

@seeekr
Copy link
Author

seeekr commented Jul 15, 2017

And works fine with MariaDB 10.1.x and MySQL 5.7.x as well. With 10.2.x it returns timeout error consistently.

@surik
Copy link
Member

surik commented Jul 15, 2017

Do you use mariaex 0.8.2 from hex.pm? Can you check master?

@seeekr
Copy link
Author

seeekr commented Jul 15, 2017

Yes, I am using 0.8.2 from hex.pm.

I'm new to the Elixir ecosystem. I've now defined the dependency like this to fetch from git:

{:mariaex, git: "https://github.com/xerions/mariaex", branch: "master", override: true}

The error then does not occur and instead mix ecto.create and mix ecto.migrate both work fine.

@surik
Copy link
Member

surik commented Jul 15, 2017

Good. The new version of mariaex will be released soon.

@seeekr
Copy link
Author

seeekr commented Jul 15, 2017

Thanks, great to hear!

@seeekr seeekr closed this as completed Jul 15, 2017
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