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

Локально тесты не прошли. и ошибка compose. #47

Closed
krivtsov opened this issue Jul 28, 2017 · 5 comments
Closed
Labels

Comments

@krivtsov
Copy link
Member

Репозиторий клонированный, без изменений

mix test

18:01:55.538 [error] GenServer #PID<0.209.0> terminating
** (KeyError) key :hostname not found in: [types: Postgrex.DefaultTypes, backoff_type: :stop, pool: DBConnection.Connection, database: "
template1", otp_app: :codebattle, repo: Codebattle.Repo, adapter: Ecto.Adapters.Postgres]
    (elixir) lib/keyword.ex:371: Keyword.fetch!/2
    (postgrex) lib/postgrex/protocol.ex:54: Postgrex.Protocol.connect/1
    (db_connection) lib/db_connection/connection.ex:134: DBConnection.Connection.connect/2
    (connection) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: nil

** (Mix) The database for Codebattle.Repo couldn't be created: an exception was raised:
    ** (KeyError) key :hostname not found in: [types: Postgrex.DefaultTypes, backoff_type: :stop, pool: DBConnection.Connection, databas
e: "template1", otp_app: :codebattle, repo: Codebattle.Repo, adapter: Ecto.Adapters.Postgres]
        (elixir) lib/keyword.ex:371: Keyword.fetch!/2
        (postgrex) lib/postgrex/protocol.ex:54: Postgrex.Protocol.connect/1
        (db_connection) lib/db_connection/connection.ex:134: DBConnection.Connection.connect/2
        (connection) lib/connection.ex:622: Connection.enter_connect/5
        (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Makefile:48: recipe for target 'test' failed
make: *** [test] Error 1

и ошибка compose-setup

docker-compose build web
Building web
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
Makefile:12: recipe for target 'compose-build' failed
make: *** [compose-build] Error 1
@imamatory
Copy link
Contributor

Это твоя локальная ошибка. Думаю это поможет docker/compose#1214 (comment)

@PeresvetS PeresvetS added this to Ready in Development Jul 29, 2017
@krivtsov krivtsov added the bug label Jul 30, 2017
@krivtsov
Copy link
Member Author

krivtsov commented Aug 1, 2017

Starting db ... 
Starting db ... error

ERROR: for db  Cannot start service db: driver failed programming external connectivity on endpoint db (9c5edcbb3b287bd26d7301efe2e0254a4f2b783aeab0b33973e0edf7c57a9538): Error starting userland proxy: listen tcp 0.0.0.0:5432: bind: address already in use

решение этой проблемы
service postgresql stop

@PeresvetS
Copy link
Member

PeresvetS commented Aug 1, 2017

Если и это вдруг кому-то не поможет, то можно просто и резко написать sudo killall postgres

@krivtsov
Copy link
Member Author

krivtsov commented Aug 1, 2017

а есть в этом файле codebattle/deps/ecto/lib/ecto/adapters/postgres.ex
запись template1

    def storage_up(opts) do
    database = Keyword.fetch!(opts, :database) || raise ":database is nil in repository configuration"
    encoding = opts[:encoding] || "UTF8"
    opts     = Keyword.put(opts, :database, "template1")
    database = Keyword.fetch!(opts, :database) || raise ":database is nil in repository configuration"
    command  = "DROP DATABASE \"#{database}\""
    opts     = Keyword.put(opts, :database, "template1")

@PeresvetS PeresvetS moved this from Ready to Doing in Development Aug 4, 2017
@PeresvetS
Copy link
Member

Теперь всё должно полностью работать.
Если вдруг у кого-то появляется ещё какая-то ошибка, то, пожалуйста, создайте новый issue с её описанием.

@PeresvetS PeresvetS moved this from Doing to Done in Development Aug 5, 2017
@PeresvetS PeresvetS removed this from Done in Development Aug 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants