Closed Bazmundi closed 5 years ago
@Bazmundi Looks like you are starting the application process as a root user with
sudo docker-compose up
.
Could you please try without sudo
and report whether the error still occurs?
It appears that recent changes in elixir-plug/plug
library (in particular https://github.com/elixir-plug/plug/commit/672cdd6e328740ea1e3b8927284d96a68ed62b3c#diff-618de3f6bf97fa90fa716e798031b884) introduced an additional dependency.
Phoenix 1.3.3 and 1.3.4 projects do not auto-generate the mix.exs
file correctly. I recommend filing a bug against elixir-plug
or phoenix
. This is a not a bug with the phoenix-docker repo.
However, as a workaround, for now you can add
{:plug_cowboy, "~> 1.0"}
to your dependency list in mix.exs
and run ./mix deps.get
to get a working 1.3.3 or 1.3.4 project with Plug 1.7+.
@Bazmundi Looks like you are starting the application process as a root user with
sudo docker-compose up
.Could you please try without
sudo
and report whether the error still occurs?
Yep, I did have to sort out docker startup as sudoer. I fixed and run from console with same result.
It appears that recent changes in
elixir-plug/plug
library (in particular elixir-plug/plug@672cdd6#diff-618de3f6bf97fa90fa716e798031b884) introduced an additional dependency.Phoenix 1.3.3 and 1.3.4 projects do not auto-generate the
mix.exs
file correctly. I recommend filing a bug againstelixir-plug
orphoenix
. This is a not a bug with the phoenix-docker repo.However, as a workaround, for now you can add
{:plug_cowboy, "~> 1.0"}
to your dependency list in
mix.exs
and run./mix deps.get
to get a working 1.3.3 or 1.3.4 project with Plug 1.7+.
Tricky. Did you ever watch the process while people sorted out etiquette for lining up at teller machines. It took a little while to sort out how and where to line up.
So, here is the drill.
The promise of docker images is that the composer owns the image and problems with the image are the owners. Otherwise the idea of docker containers, and especially docker hub style distributions, does not make sense.
It is the technically a problem with docker-phoenix because the promise is load and run.
Nope, didn't fix it.
On Tue, Nov 20, 2018 at 7:34 AM Nicolas Bettenburg notifications@github.com wrote:
It appears that recent changes in elixir-plug/plug library (in particular elixir-plug/plug@672cdd6#diff-618de3f6bf97fa90fa716e798031b884 https://github.com/elixir-plug/plug/commit/672cdd6e328740ea1e3b8927284d96a68ed62b3c#diff-618de3f6bf97fa90fa716e798031b884) introduced an additional dependency.
Phoenix 1.3.3 and 1.3.4 projects do not auto-generate the mix.exs file correctly. I recommend filing a bug against elixir-plug or phoenix. This is a not a bug with the phoenix-docker repo.
However, as a workaround, for now you can add
{:plug_cowboy, "~> 1.0"}
to your dependency list in mix.exs and run ./mix deps.get to get a working 1.3.3 or 1.3.4 project with Plug 1.7+.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nicbet/docker-phoenix/issues/12#issuecomment-440041006, or mute the thread https://github.com/notifications/unsubscribe-auth/ABsMKxpbsSMw8v-FRz8zFQgyjDmlPHbFks5uwxzVgaJpZM4YnbGE .
docker-phoenix
image prepares a docker image containing NodeJS 8.x LTS and Phoenix 1.3.3. mix phx.new
generator of phoenix
version 1.3.3
generates a mix.exs
files with dependency definitions with requirements operator ~>
. elixir-plug
) in a minor version update covered by that operator introduced a change to transitive dependencies (cowboy_plug
).phoenix
1.4.0
include updated generators for mix.exs
.docker-phoenix
repo are hitting the same bug with OS installed 1.3.x
versions of phoenix
.Bottom line is that there is nothing that I can do in this repo to fix your issue within the 1.3.x
branch. I'll be pushing up a 1.4
version in the next days, which should take care of the problem as long as you start a new phoenix 1.4 project...
Older 1.3
projects should not be impacted as long as you don't run mix deps.update
Yep, that would be you being a good docker citizen me waiting patiently.
On Tue, Nov 20, 2018 at 11:36 PM Nicolas Bettenburg < notifications@github.com> wrote:
- The docker-phoenix image prepares a docker image containing NodeJS 8.x LTS and Phoenix 1.3.3.
- The mix phx.new generator of phoenix version 1.3.3 generates a mix.exs files with dependency definitions with requirements operator ~> .
- One of these dependencies (elixir-plug) in a minor version update covered by that operator introduced a change to transitive dependencies ( cowboy_plug).
- Newer version of phoenix 1.4.0 include updated generators for mix.exs .
- People who are not using the docker-phoenix repo are hitting the same bug with OS installed 1.3.x versions of phoenix.
Bottom line is that there is nothing that I can do in this repo to fix your issue within the 1.3.x branch. I'll be pushing up a 1.4 version in the next days, which should take care of the problem as long as you start a new phoenix 1.4 project...
Older 1.3 projects should not be impacted as long as you don't run mix deps.update
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nicbet/docker-phoenix/issues/12#issuecomment-440266738, or mute the thread https://github.com/notifications/unsubscribe-auth/ABsMK2WxwSAizczZ_QTYDSqHRVQg6E8Tks5uw_5cgaJpZM4YnbGE .
@Bazmundi Updated this repo to 1.4.0. While it won't help with fixing the 1.3.3 issue, a new project, based on latest versions of Elixir
and Phoenix
should work out of the box.
sudo docker-compose up phoenix_db_1_85f5f1d1343c is up-to-date Creating phoenix_app_1_43af3c589570 ... done Attaching to phoenix_db_1_85f5f1d1343c, phoenix_app_1_5fc54ca2d440 db_1_85f5f1d1343c | The files belonging to this database system will be owned by user "postgres". db_1_85f5f1d1343c | This user must also own the server process. db_1_85f5f1d1343c | db_1_85f5f1d1343c | The database cluster will be initialized with locale "en_US.utf8". db_1_85f5f1d1343c | The default database encoding has accordingly been set to "UTF8". db_1_85f5f1d1343c | The default text search configuration will be set to "english". db_1_85f5f1d1343c | db_1_85f5f1d1343c | Data page checksums are disabled. db_1_85f5f1d1343c | db_1_85f5f1d1343c | fixing permissions on existing directory /var/lib/postgresql/data ... ok db_1_85f5f1d1343c | creating subdirectories ... ok db_1_85f5f1d1343c | selecting default max_connections ... 100 db_1_85f5f1d1343c | selecting default shared_buffers ... 128MB db_1_85f5f1d1343c | selecting dynamic shared memory implementation ... posix db_1_85f5f1d1343c | creating configuration files ... ok db_1_85f5f1d1343c | running bootstrap script ... ok db_1_85f5f1d1343c | performing post-bootstrap initialization ... ok db_1_85f5f1d1343c | syncing data to disk ... ok db_1_85f5f1d1343c | db_1_85f5f1d1343c | WARNING: enabling "trust" authentication for local connections db_1_85f5f1d1343c | You can change this by editing pg_hba.conf or using the option -A, or db_1_85f5f1d1343c | --auth-local and --auth-host, the next time you run initdb. db_1_85f5f1d1343c | db_1_85f5f1d1343c | Success. You can now start the database server using: db_1_85f5f1d1343c | db_1_85f5f1d1343c | pg_ctl -D /var/lib/postgresql/data -l logfile start db_1_85f5f1d1343c | db_1_85f5f1d1343c | **** db_1_85f5f1d1343c | WARNING: No password has been set for the database. db_1_85f5f1d1343c | This will allow anyone with access to the db_1_85f5f1d1343c | Postgres port to access your database. In db_1_85f5f1d1343c | Docker's default configuration, this is db_1_85f5f1d1343c | effectively any other container on the same db_1_85f5f1d1343c | system. db_1_85f5f1d1343c | db_1_85f5f1d1343c | Use "-e POSTGRES_PASSWORD=password" to set db_1_85f5f1d1343c | it in "docker run". db_1_85f5f1d1343c | **** db_1_85f5f1d1343c | waiting for server to start....2018-11-17 12:02:13.692 UTC [44] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" db_1_85f5f1d1343c | 2018-11-17 12:02:13.884 UTC [45] LOG: database system was shut down at 2018-11-17 12:02:11 UTC db_1_85f5f1d1343c | 2018-11-17 12:02:13.954 UTC [44] LOG: database system is ready to accept connections db_1_85f5f1d1343c | done db_1_85f5f1d1343c | server started db_1_85f5f1d1343c | db_1_85f5f1d1343c | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/* db_1_85f5f1d1343c | db_1_85f5f1d1343c | waiting for server to shut down....2018-11-17 12:02:13.995 UTC [44] LOG: received fast shutdown request db_1_85f5f1d1343c | 2018-11-17 12:02:14.040 UTC [44] LOG: aborting any active transactions db_1_85f5f1d1343c | 2018-11-17 12:02:14.043 UTC [44] LOG: worker process: logical replication launcher (PID 51) exited with exit code 1 db_1_85f5f1d1343c | 2018-11-17 12:02:14.043 UTC [46] LOG: shutting down db_1_85f5f1d1343c | 2018-11-17 12:02:14.337 UTC [44] LOG: database system is shut down db_1_85f5f1d1343c | done db_1_85f5f1d1343c | server stopped db_1_85f5f1d1343c | db_1_85f5f1d1343c | PostgreSQL init process complete; ready for start up. db_1_85f5f1d1343c | db_1_85f5f1d1343c | 2018-11-17 12:02:14.454 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 db_1_85f5f1d1343c | 2018-11-17 12:02:14.454 UTC [1] LOG: listening on IPv6 address "::", port 5432 db_1_85f5f1d1343c | 2018-11-17 12:02:14.554 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" db_1_85f5f1d1343c | 2018-11-17 12:02:14.712 UTC [53] LOG: database system was shut down at 2018-11-17 12:02:14 UTC db_1_85f5f1d1343c | 2018-11-17 12:02:14.760 UTC [1] LOG: database system is ready to accept connections db_1_85f5f1d1343c | 2018-11-17 12:13:15.977 UTC [62] LOG: could not send data to client: Broken pipe db_1_85f5f1d1343c | 2018-11-17 12:13:15.977 UTC [62] STATEMENT: SELECT t.oid, t.typname, t.typsend, t.typreceive, t.typoutput, t.typinput, db_1_85f5f1d1343c | coalesce(d.typelem, t.typelem), coalesce(r.rngsubtype, 0), ARRAY ( db_1_85f5f1d1343c | SELECT a.atttypid db_1_85f5f1d1343c | FROM pg_attribute AS a db_1_85f5f1d1343c | WHERE a.attrelid = t.typrelid AND a.attnum > 0 AND NOT a.attisdropped db_1_85f5f1d1343c | ORDER BY a.attnum db_1_85f5f1d1343c | ) db_1_85f5f1d1343c | FROM pg_type AS t db_1_85f5f1d1343c | LEFT JOIN pg_type AS d ON t.typbasetype = d.oid db_1_85f5f1d1343c | LEFT JOIN pg_range AS r ON r.rngtypid = t.oid OR (t.typbasetype <> 0 AND r.rngtypid = t.typbasetype) db_1_85f5f1d1343c | db_1_85f5f1d1343c | db_1_85f5f1d1343c | 2018-11-17 12:13:15.977 UTC [62] FATAL: connection to client lost db_1_85f5f1d1343c | 2018-11-17 12:13:15.977 UTC [62] STATEMENT: SELECT t.oid, t.typname, t.typsend, t.typreceive, t.typoutput, t.typinput, db_1_85f5f1d1343c | coalesce(d.typelem, t.typelem), coalesce(r.rngsubtype, 0), ARRAY ( db_1_85f5f1d1343c | SELECT a.atttypid db_1_85f5f1d1343c | FROM pg_attribute AS a db_1_85f5f1d1343c | WHERE a.attrelid = t.typrelid AND a.attnum > 0 AND NOT a.attisdropped db_1_85f5f1d1343c | ORDER BY a.attnum db_1_85f5f1d1343c | ) db_1_85f5f1d1343c | FROM pg_type AS t db_1_85f5f1d1343c | LEFT JOIN pg_type AS d ON t.typbasetype = d.oid db_1_85f5f1d1343c | LEFT JOIN pg_range AS r ON r.rngtypid = t.oid OR (t.typbasetype <> 0 AND r.rngtypid = t.typbasetype) db_1_85f5f1d1343c | db_1_85f5f1d1343c | app_1_5fc54ca2d440 | [info] Application hello exited: Hello.Application.start(:normal, []) returned an error: shutdown: failed to start child: HelloWeb.Endpoint app_1_5fc54ca2d440 | (EXIT) an exception was raised: app_1_5fc54ca2d440 | (UndefinedFunctionError) function Plug.Cowboy.child_spec/1 is undefined (module Plug.Cowboy is not available) app_1_5fc54ca2d440 | Plug.Cowboy.childspec([scheme: :http, plug: {HelloWeb.Endpoint, []}, options: [dispatch: [: [{"/phoenix/live_reload/socket/websocket", Phoenix.Endpoint.CowboyWebSocket, {Phoenix.Transports.WebSocket, {HelloWeb.Endpoint, Phoenix.LiveReloader.Socket, [path: "/websocket", serializer: [{Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"}, {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}], timeout: 60000, transport_log: false, compress: false]}}}, {"/socket/websocket", Phoenix.Endpoint.CowboyWebSocket, {Phoenix.Transports.WebSocket, {HelloWeb.Endpoint, HelloWeb.UserSocket, [path: "/websocket", serializer: [{Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"}, {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}], timeout: 60000, transportlog: false, compress: false]}}}, {:, Plug.Adapters.Cowboy.Handler, {HelloWeb.Endpoint, []}}]], port: 4000, otp_app: :hello]]) app_1_5fc54ca2d440 | (phoenix) lib/phoenix/endpoint/cowboy_adapter.ex:96: Phoenix.Endpoint.CowboyAdapter.child_spec/3 app_1_5fc54ca2d440 | (phoenix) lib/phoenix/endpoint/supervisor.ex:106: anonymous fn/6 in Phoenix.Endpoint.Supervisor.server_children/4 app_1_5fc54ca2d440 | (elixir) lib/enum.ex:1899: Enum."-reduce/3-lists^foldl/2-0-"/3 app_1_5fc54ca2d440 | (phoenix) lib/phoenix/endpoint/supervisor.ex:97: Phoenix.Endpoint.Supervisor.server_children/4 app_1_5fc54ca2d440 | (phoenix) lib/phoenix/endpoint/supervisor.ex:57: Phoenix.Endpoint.Supervisor.init/1 app_1_5fc54ca2d440 | (stdlib) supervisor.erl:294: :supervisor.init/1 app_1_5fc54ca2d440 | (stdlib) gen_server.erl:365: :gen_server.init_it/2 app_1_5fc54ca2d440 | (stdlib) gen_server.erl:333: :gen_server.init_it/6 app_1_5fc54ca2d440 | (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3 app_1_5fc54ca2d440 | (Mix) Could not start application hello: Hello.Application.start(:normal, []) returned an error: shutdown: failed to start child: HelloWeb.Endpoint app_1_5fc54ca2d440 | (EXIT) an exception was raised: app_1_5fc54ca2d440 | ** (UndefinedFunctionError) function Plug.Cowboy.child_spec/1 is undefined (module Plug.Cowboy is not available) app_1_5fc54ca2d440 | Plug.Cowboy.childspec([scheme: :http, plug: {HelloWeb.Endpoint, []}, options: [dispatch: [: [{"/phoenix/live_reload/socket/websocket", Phoenix.Endpoint.CowboyWebSocket, {Phoenix.Transports.WebSocket, {HelloWeb.Endpoint, Phoenix.LiveReloader.Socket, [path: "/websocket", serializer: [{Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"}, {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}], timeout: 60000, transport_log: false, compress: false]}}}, {"/socket/websocket", Phoenix.Endpoint.CowboyWebSocket, {Phoenix.Transports.WebSocket, {HelloWeb.Endpoint, HelloWeb.UserSocket, [path: "/websocket", serializer: [{Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"}, {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}], timeout: 60000, transportlog: false, compress: false]}}}, {:, Plug.Adapters.Cowboy.Handler, {HelloWeb.Endpoint, []}}]], port: 4000, otp_app: :hello]]) app_1_5fc54ca2d440 | (phoenix) lib/phoenix/endpoint/cowboy_adapter.ex:96: Phoenix.Endpoint.CowboyAdapter.child_spec/3 app_1_5fc54ca2d440 | (phoenix) lib/phoenix/endpoint/supervisor.ex:106: anonymous fn/6 in Phoenix.Endpoint.Supervisor.server_children/4 app_1_5fc54ca2d440 | (elixir) lib/enum.ex:1899: Enum."-reduce/3-lists^foldl/2-0-"/3 app_1_5fc54ca2d440 | (phoenix) lib/phoenix/endpoint/supervisor.ex:97: Phoenix.Endpoint.Supervisor.server_children/4 app_1_5fc54ca2d440 | (phoenix) lib/phoenix/endpoint/supervisor.ex:57: Phoenix.Endpoint.Supervisor.init/1 app_1_5fc54ca2d440 | (stdlib) supervisor.erl:294: :supervisor.init/1 app_1_5fc54ca2d440 | (stdlib) gen_server.erl:365: :gen_server.init_it/2 app_1_5fc54ca2d440 | (stdlib) gen_server.erl:333: :gen_server.init_it/6 app_1_5fc54ca2d440 | (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3 phoenix_app_1_5fc54ca2d440 exited with code 1