shu-0-lycorish / trafficsimu_deploy

0 stars 0 forks source link

ローカルに保存後,起動時にエラーが起こる #1

Open shu-0-lycorish opened 11 months ago

shu-0-lycorish commented 11 months ago

エラー内容

このリポジトリをローカルに保存し,mix deps.getを行った後に起動を試みると下記のようなエラーが発生し,起動できない.

[error] Postgrex.Protocol (#PID<0.4158.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4160.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Task #PID<0.5201.0> started from SampleDaisyuiWeb.Endpoint terminating
** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
    (inets 9.0.1) :http_util.timestamp()
    (inets 9.0.1) httpc.erl:750: :httpc.handle_request/9
    (tailwind 0.1.9) lib/tailwind.ex:324: Tailwind.fetch_body!/1
    (tailwind 0.1.9) lib/tailwind.ex:230: Tailwind.install/0
    (tailwind 0.1.9) lib/tailwind.ex:215: Tailwind.install_and_run/2
    (phoenix 1.6.15) lib/phoenix/endpoint/watcher.ex:19: Phoenix.Endpoint.Watcher.watch/2
    (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: &Phoenix.Endpoint.Watcher.watch/2
    Args: ["tailwind", {Tailwind, :install_and_run, [:default, ["--watch"]]}]
[error] Task #PID<0.5200.0> started from SampleDaisyuiWeb.Endpoint terminating
** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
    (inets 9.0.1) :http_util.timestamp()
    (inets 9.0.1) httpc.erl:750: :httpc.handle_request/9
    (esbuild 0.5.0) lib/esbuild.ex:297: Esbuild.fetch_body!/1
    (esbuild 0.5.0) lib/esbuild.ex:209: Esbuild.install/0
    (esbuild 0.5.0) lib/esbuild.ex:189: Esbuild.install_and_run/2
    (phoenix 1.6.15) lib/phoenix/endpoint/watcher.ex:19: Phoenix.Endpoint.Watcher.watch/2
    (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: &Phoenix.Endpoint.Watcher.watch/2
    Args: ["esbuild", {Esbuild, :install_and_run, [:default, ["--sourcemap=inline", "--watch"]]}]

想定

このリポジトリをローカルに保存,起動し,http://localhost:4000/でアプリケーションを確認できる.

zacky1972 commented 11 months ago

My environment is here:

% elixir -v
Erlang/OTP 26 [erts-14.1.1] [source] [64-bit] [smp:20:20] [ds:20:20:10] [async-threads:1] [jit]

Elixir 1.15.7 (compiled with Erlang/OTP 26)

In my environment, mix deps.get was successful:

% mix deps.get
Resolving Hex dependencies...
Resolution completed in 0.068s
Unchanged:
  castore 0.1.19
  connection 1.1.0
  cowboy 2.9.0
  cowboy_telemetry 0.4.0
  cowlib 2.11.0
  db_connection 2.4.2
  decimal 2.0.0
  ecto 3.9.2
  ecto_sql 3.9.1
  esbuild 0.5.0
  file_system 0.2.10
  floki 0.34.0
  gettext 0.20.0
  jason 1.4.0
  mime 2.0.3
  phoenix 1.6.15
  phoenix_ecto 4.4.0
  phoenix_html 3.2.0
  phoenix_live_dashboard 0.6.5
  phoenix_live_reload 1.4.0
  phoenix_live_view 0.17.12
  phoenix_pubsub 2.1.1
  phoenix_template 1.0.0
  phoenix_view 2.0.2
  plug 1.14.0
  plug_cowboy 2.6.0
  plug_crypto 1.2.3
  postgrex 0.16.5
  ranch 1.8.0
  swoosh 1.8.2
  tailwind 0.1.9
  telemetry 1.1.0
  telemetry_metrics 0.6.1
  telemetry_poller 1.0.0
* Getting phoenix (Hex package)
* Getting phoenix_ecto (Hex package)
* Getting ecto_sql (Hex package)
* Getting postgrex (Hex package)
* Getting phoenix_html (Hex package)
* Getting phoenix_live_reload (Hex package)
* Getting phoenix_live_view (Hex package)
* Getting floki (Hex package)
* Getting phoenix_live_dashboard (Hex package)
* Getting esbuild (Hex package)
* Getting swoosh (Hex package)
* Getting telemetry_metrics (Hex package)
* Getting telemetry_poller (Hex package)
* Getting gettext (Hex package)
* Getting jason (Hex package)
* Getting plug_cowboy (Hex package)
* Getting tailwind (Hex package)
* Getting castore (Hex package)
* Getting cowboy (Hex package)
* Getting cowboy_telemetry (Hex package)
* Getting plug (Hex package)
* Getting mime (Hex package)
* Getting plug_crypto (Hex package)
* Getting telemetry (Hex package)
* Getting cowlib (Hex package)
* Getting ranch (Hex package)
* Getting file_system (Hex package)
* Getting connection (Hex package)
* Getting db_connection (Hex package)
* Getting decimal (Hex package)
* Getting ecto (Hex package)
* Getting phoenix_pubsub (Hex package)
* Getting phoenix_view (Hex package)
* Getting phoenix_template (Hex package)
You have added/upgraded packages you could sponsor, run `mix hex.sponsor` to learn more

I suggest to git clone this repository to another path, and try mix deps.get.

zacky1972 commented 11 months ago

I guess that the following instruction is too unclear to reproduce your situation:

このリポジトリをローカルに保存し,mix deps.getを行った後に起動を試みると下記のようなエラーが発生し,起動できない.

Describe the reproduction instruction, clearly.

shu-0-lycorish commented 11 months ago

My environment is here:

% elixir -v
Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit] [dtrace]

Elixir 1.15.7 (compiled with Erlang/OTP 26)

git clone was successful:

 % git clone https://github.com/shu-0-lycorish/trafficsimu_deploy.git
Cloning into 'trafficsimu_deploy'...
remote: Enumerating objects: 97, done.
remote: Counting objects: 100% (97/97), done.
remote: Compressing objects: 100% (79/79), done.
remote: Total 97 (delta 12), reused 96 (delta 11), pack-reused 0
Receiving objects: 100% (97/97), 68.00 KiB | 1.33 MiB/s, done.
Resolving deltas: 100% (12/12), done.

And, mix deps.get was successful:

% mix deps.get
Resolving Hex dependencies...
Resolution completed in 0.089s
Unchanged:
  castore 0.1.19
  connection 1.1.0
  cowboy 2.9.0
  cowboy_telemetry 0.4.0
  cowlib 2.11.0
  db_connection 2.4.2
  decimal 2.0.0
  ecto 3.9.2
  ecto_sql 3.9.1
  esbuild 0.5.0
  file_system 0.2.10
  floki 0.34.0
  gettext 0.20.0
  jason 1.4.0
  mime 2.0.3
  phoenix 1.6.15
  phoenix_ecto 4.4.0
  phoenix_html 3.2.0
  phoenix_live_dashboard 0.6.5
  phoenix_live_reload 1.4.0
  phoenix_live_view 0.17.12
  phoenix_pubsub 2.1.1
  phoenix_template 1.0.0
  phoenix_view 2.0.2
  plug 1.14.0
  plug_cowboy 2.6.0
  plug_crypto 1.2.3
  postgrex 0.16.5
  ranch 1.8.0
  swoosh 1.8.2
  tailwind 0.1.9
  telemetry 1.1.0
  telemetry_metrics 0.6.1
  telemetry_poller 1.0.0
* Getting phoenix (Hex package)
* Getting phoenix_ecto (Hex package)
* Getting ecto_sql (Hex package)
* Getting postgrex (Hex package)
* Getting phoenix_html (Hex package)
* Getting phoenix_live_reload (Hex package)
* Getting phoenix_live_view (Hex package)
* Getting floki (Hex package)
* Getting phoenix_live_dashboard (Hex package)
* Getting esbuild (Hex package)
* Getting swoosh (Hex package)
* Getting telemetry_metrics (Hex package)
* Getting telemetry_poller (Hex package)
* Getting gettext (Hex package)
* Getting jason (Hex package)
* Getting plug_cowboy (Hex package)
* Getting tailwind (Hex package)
* Getting castore (Hex package)
* Getting cowboy (Hex package)
* Getting cowboy_telemetry (Hex package)
* Getting plug (Hex package)
* Getting mime (Hex package)
* Getting plug_crypto (Hex package)
* Getting telemetry (Hex package)
* Getting cowlib (Hex package)
* Getting ranch (Hex package)
* Getting file_system (Hex package)
* Getting connection (Hex package)
* Getting db_connection (Hex package)
* Getting decimal (Hex package)
* Getting ecto (Hex package)
* Getting phoenix_pubsub (Hex package)
* Getting phoenix_view (Hex package)
* Getting phoenix_template (Hex package)
You have added/upgraded packages you could sponsor, run `mix hex.sponsor` to learn more

Then, when I run mix pox.server mix phx.server, I get this error:

could not compile dependency :ecto, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile ecto --force", update it with "mix deps.update ecto" or clean it with "mix deps.clean ecto"

So I ran mix deps.clean ecto and mix deps.update ecto as instructed. (mix deps.compile ecto --force ave the same error and could not run.) Then, when I ran server again, the following error message was repeatedly displayed:

% mix phx.server
==> decimal
Compiling 4 files (.ex)
Generated decimal app
===> Analyzing applications...
===> Compiling telemetry
==> telemetry_metrics
Compiling 7 files (.ex)
Generated telemetry_metrics app
===> Analyzing applications...
===> Compiling telemetry_poller
==> jason
Compiling 10 files (.ex)
Generated jason app
==> db_connection
Compiling 14 files (.ex)
Generated db_connection app
==> ecto
Compiling 56 files (.ex)
warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
  lib/ecto/repo/preloader.ex:208: Ecto.Repo.Preloader.fetch_ids/4

warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
  lib/ecto/changeset/relation.ex:473: Ecto.Changeset.Relation.process_current/3

warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
  lib/ecto/changeset.ex:2543: Ecto.Changeset.optimistic_lock/3

Generated ecto app
==> plug
Compiling 1 file (.erl)
Compiling 41 files (.ex)
Generated plug app
==> phoenix_html
Compiling 8 files (.ex)
Generated phoenix_html app
==> phoenix_template
Compiling 4 files (.ex)
Generated phoenix_template app
==> phoenix_view
Compiling 1 file (.ex)
Generated phoenix_view app
==> postgrex
Compiling 64 files (.ex)
Generated postgrex app
==> ecto_sql
Compiling 25 files (.ex)
warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
  lib/ecto/migrator.ex:246: Ecto.Migrator.up/4

Generated ecto_sql app
==> castore
Compiling 1 file (.ex)
Generated castore app
==> esbuild
Compiling 3 files (.ex)
warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
  lib/esbuild.ex:66: Esbuild.start/2

warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
  lib/esbuild.ex:80: Esbuild.start/2

Generated esbuild app
==> tailwind
Compiling 3 files (.ex)
warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
  lib/tailwind.ex:91: Tailwind.start/2

warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
  lib/tailwind.ex:105: Tailwind.start/2

Generated tailwind app
===> Analyzing applications...
===> Compiling cowlib
src/cow_sse.erl:56:29: Warning: type variable 'State' is only used once (is unbound)

===> Analyzing applications...
===> Compiling cowboy
===> Analyzing applications...
===> Compiling cowboy_telemetry
==> plug_cowboy
Compiling 5 files (.ex)
warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
  lib/plug/cowboy.ex:344: Plug.Cowboy.to_args/5

Generated plug_cowboy app
==> phoenix
Compiling 69 files (.ex)
warning: missing parentheses for expression following "do:" keyword. Parentheses are required to solve ambiguity inside keywords.

This error happens when you have function calls without parentheses inside keywords. For example:

    function(arg, one: nested_call a, b, c)
    function(arg, one: if expr, do: :this, else: :that)

In the examples above, we don't know if the arguments "b" and "c" apply to the function "function" or "nested_call". Or if the keywords "do" and "else" apply to the function "function" or "if". You can solve this by explicitly adding parentheses:

    function(arg, one: if(expr, do: :this, else: :that))
    function(arg, one: nested_call(a, b, c))

Ambiguity found at:
  lib/phoenix/controller.ex:998

warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
  lib/phoenix/code_reloader/server.ex:50: Phoenix.CodeReloader.Server.handle_call/3

warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
  lib/phoenix/endpoint/supervisor.ex:34: Phoenix.Endpoint.Supervisor.init/1

warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
  lib/phoenix/endpoint/supervisor.ex:57: Phoenix.Endpoint.Supervisor.init/1

warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
  lib/phoenix/endpoint/supervisor.ex:78: Phoenix.Endpoint.Supervisor.pubsub_children/2

warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
  lib/phoenix/endpoint/supervisor.ex:264: Phoenix.Endpoint.Supervisor.build_url/2

warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
  lib/phoenix/controller.ex:1009: Phoenix.Controller.warn_if_ajax/1

warning: missing parentheses for expression following "do:" keyword. Parentheses are required to solve ambiguity inside keywords.

This error happens when you have function calls without parentheses inside keywords. For example:

    function(arg, one: nested_call a, b, c)
    function(arg, one: if expr, do: :this, else: :that)

In the examples above, we don't know if the arguments "b" and "c" apply to the function "function" or "nested_call". Or if the keywords "do" and "else" apply to the function "function" or "if". You can solve this by explicitly adding parentheses:

    function(arg, one: if(expr, do: :this, else: :that))
    function(arg, one: nested_call(a, b, c))

Ambiguity found at:
  lib/phoenix/router/resource.ex:71

warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
  lib/phoenix/socket.ex:610: Phoenix.Socket.handle_in/4

Generated phoenix app
==> phoenix_live_reload
Compiling 4 files (.ex)
warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
  lib/phoenix_live_reload/application.ex:32: Phoenix.LiveReloader.Application.start_link/0

Generated phoenix_live_reload app
==> phoenix_live_view
Compiling 31 files (.ex)
Generated phoenix_live_view app
==> phoenix_live_dashboard
Compiling 40 files (.ex)
Generated phoenix_live_dashboard app
==> swoosh
Compiling 40 files (.ex)
Generated swoosh app
==> phoenix_ecto
Compiling 7 files (.ex)
Generated phoenix_ecto app
warning: the :gettext compiler is no longer required in your mix.exs.

Please find the following line in your mix.exs and remove the :gettext entry:

    compilers: [..., :gettext, ...] ++ Mix.compilers(),

  (gettext 0.20.0) lib/mix/tasks/compile.gettext.ex:5: Mix.Tasks.Compile.Gettext.run/1
  (mix 1.15.7) lib/mix/task.ex:455: anonymous fn/3 in Mix.Task.run_task/5
  (mix 1.15.7) lib/mix/tasks/compile.all.ex:124: Mix.Tasks.Compile.All.run_compiler/2
  (mix 1.15.7) lib/mix/tasks/compile.all.ex:104: Mix.Tasks.Compile.All.compile/4
  (mix 1.15.7) lib/mix/tasks/compile.all.ex:93: Mix.Tasks.Compile.All.with_logger_app/2
  (mix 1.15.7) lib/mix/tasks/compile.all.ex:56: Mix.Tasks.Compile.All.run/1
  (mix 1.15.7) lib/mix/task.ex:455: anonymous fn/3 in Mix.Task.run_task/5
  (mix 1.15.7) lib/mix/tasks/compile.ex:141: Mix.Tasks.Compile.run/1
  (mix 1.15.7) lib/mix/task.ex:455: anonymous fn/3 in Mix.Task.run_task/5
  (mix 1.15.7) lib/mix/tasks/app.config.ex:30: Mix.Tasks.App.Config.run/1
  (mix 1.15.7) lib/mix/task.ex:455: anonymous fn/3 in Mix.Task.run_task/5
  (mix 1.15.7) lib/mix/tasks/app.start.ex:50: Mix.Tasks.App.Start.run/1
  (mix 1.15.7) lib/mix/task.ex:455: anonymous fn/3 in Mix.Task.run_task/5
  (mix 1.15.7) lib/mix/tasks/run.ex:129: Mix.Tasks.Run.run/5
  (mix 1.15.7) lib/mix/tasks/run.ex:85: Mix.Tasks.Run.run/1
  (mix 1.15.7) lib/mix/task.ex:455: anonymous fn/3 in Mix.Task.run_task/5
  (mix 1.15.7) lib/mix/cli.ex:92: Mix.CLI.run_task/2
  /opt/homebrew/bin/mix:2: (file)

==> sample_daisyui
Compiling 14 files (.ex)
Generated sample_daisyui app
[error] Postgrex.Protocol (#PID<0.4159.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4160.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4154.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4152.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4155.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4157.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4158.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4151.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4153.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4156.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[info] Running SampleDaisyuiWeb.Endpoint with cowboy 2.9.0 at 127.0.0.1:4000 (http)
[info] Access SampleDaisyuiWeb.Endpoint at http://localhost:4000
[debug] Downloading tailwind from https://github.com/tailwindlabs/tailwindcss/releases/download/v3.2.4/tailwindcss-macos-arm64
[debug] Downloading esbuild from https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.29.tgz
[error] Postgrex.Protocol (#PID<0.4152.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4155.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4158.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Task #PID<0.4296.0> started from SampleDaisyuiWeb.Endpoint terminating
** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
    (inets 9.0.1) :http_util.timestamp()
    (inets 9.0.1) httpc.erl:750: :httpc.handle_request/9
    (tailwind 0.1.9) lib/tailwind.ex:324: Tailwind.fetch_body!/1
    (tailwind 0.1.9) lib/tailwind.ex:230: Tailwind.install/0
    (tailwind 0.1.9) lib/tailwind.ex:215: Tailwind.install_and_run/2
    (phoenix 1.6.15) lib/phoenix/endpoint/watcher.ex:19: Phoenix.Endpoint.Watcher.watch/2
    (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: &Phoenix.Endpoint.Watcher.watch/2
    Args: ["tailwind", {Tailwind, :install_and_run, [:default, ["--watch"]]}]
[error] Task #PID<0.4295.0> started from SampleDaisyuiWeb.Endpoint terminating
** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
    (inets 9.0.1) :http_util.timestamp()
    (inets 9.0.1) httpc.erl:750: :httpc.handle_request/9
    (esbuild 0.5.0) lib/esbuild.ex:297: Esbuild.fetch_body!/1
    (esbuild 0.5.0) lib/esbuild.ex:209: Esbuild.install/0
    (esbuild 0.5.0) lib/esbuild.ex:189: Esbuild.install_and_run/2
    (phoenix 1.6.15) lib/phoenix/endpoint/watcher.ex:19: Phoenix.Endpoint.Watcher.watch/2
    (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: &Phoenix.Endpoint.Watcher.watch/2
    Args: ["esbuild", {Esbuild, :install_and_run, [:default, ["--sourcemap=inline", "--watch"]]}]
[debug] Downloading tailwind from https://github.com/tailwindlabs/tailwindcss/releases/download/v3.2.4/tailwindcss-macos-arm64
[debug] Downloading esbuild from https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.29.tgz
[error] Postgrex.Protocol (#PID<0.4153.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4154.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4151.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4156.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4160.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4157.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4159.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4152.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4155.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Task #PID<0.4297.0> started from SampleDaisyuiWeb.Endpoint terminating
** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
    (inets 9.0.1) :http_util.timestamp()
    (inets 9.0.1) httpc.erl:750: :httpc.handle_request/9
    (tailwind 0.1.9) lib/tailwind.ex:324: Tailwind.fetch_body!/1
    (tailwind 0.1.9) lib/tailwind.ex:230: Tailwind.install/0
    (tailwind 0.1.9) lib/tailwind.ex:215: Tailwind.install_and_run/2
    (phoenix 1.6.15) lib/phoenix/endpoint/watcher.ex:19: Phoenix.Endpoint.Watcher.watch/2
    (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: &Phoenix.Endpoint.Watcher.watch/2
    Args: ["tailwind", {Tailwind, :install_and_run, [:default, ["--watch"]]}]
[error] Task #PID<0.4298.0> started from SampleDaisyuiWeb.Endpoint terminating
** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
    (inets 9.0.1) :http_util.timestamp()
    (inets 9.0.1) httpc.erl:750: :httpc.handle_request/9
    (esbuild 0.5.0) lib/esbuild.ex:297: Esbuild.fetch_body!/1
    (esbuild 0.5.0) lib/esbuild.ex:209: Esbuild.install/0
    (esbuild 0.5.0) lib/esbuild.ex:189: Esbuild.install_and_run/2
    (phoenix 1.6.15) lib/phoenix/endpoint/watcher.ex:19: Phoenix.Endpoint.Watcher.watch/2
    (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: &Phoenix.Endpoint.Watcher.watch/2
    Args: ["esbuild", {Esbuild, :install_and_run, [:default, ["--sourcemap=inline", "--watch"]]}]
[info] Running SampleDaisyuiWeb.Endpoint with cowboy 2.9.0 at 127.0.0.1:4000 (http)
[info] Access SampleDaisyuiWeb.Endpoint at http://localhost:4000
[debug] Downloading tailwind from https://github.com/tailwindlabs/tailwindcss/releases/download/v3.2.4/tailwindcss-macos-arm64
[debug] Downloading esbuild from https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.29.tgz
[error] Postgrex.Protocol (#PID<0.4158.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Task #PID<0.4425.0> started from SampleDaisyuiWeb.Endpoint terminating
** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
    (inets 9.0.1) :http_util.timestamp()
    (inets 9.0.1) httpc.erl:750: :httpc.handle_request/9
    (tailwind 0.1.9) lib/tailwind.ex:324: Tailwind.fetch_body!/1
    (tailwind 0.1.9) lib/tailwind.ex:230: Tailwind.install/0
    (tailwind 0.1.9) lib/tailwind.ex:215: Tailwind.install_and_run/2
    (phoenix 1.6.15) lib/phoenix/endpoint/watcher.ex:19: Phoenix.Endpoint.Watcher.watch/2
    (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: &Phoenix.Endpoint.Watcher.watch/2
    Args: ["tailwind", {Tailwind, :install_and_run, [:default, ["--watch"]]}]
[error] Task #PID<0.4424.0> started from SampleDaisyuiWeb.Endpoint terminating
** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
    (inets 9.0.1) :http_util.timestamp()
    (inets 9.0.1) httpc.erl:750: :httpc.handle_request/9
    (esbuild 0.5.0) lib/esbuild.ex:297: Esbuild.fetch_body!/1
    (esbuild 0.5.0) lib/esbuild.ex:209: Esbuild.install/0
    (esbuild 0.5.0) lib/esbuild.ex:189: Esbuild.install_and_run/2
    (phoenix 1.6.15) lib/phoenix/endpoint/watcher.ex:19: Phoenix.Endpoint.Watcher.watch/2
    (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: &Phoenix.Endpoint.Watcher.watch/2
    Args: ["esbuild", {Esbuild, :install_and_run, [:default, ["--sourcemap=inline", "--watch"]]}]
[debug] Downloading tailwind from https://github.com/tailwindlabs/tailwindcss/releases/download/v3.2.4/tailwindcss-macos-arm64
[debug] Downloading esbuild from https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.29.tgz
[error] Postgrex.Protocol (#PID<0.4157.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4159.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4153.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4152.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Task #PID<0.4426.0> started from SampleDaisyuiWeb.Endpoint terminating
** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
    (inets 9.0.1) :http_util.timestamp()
    (inets 9.0.1) httpc.erl:750: :httpc.handle_request/9
    (tailwind 0.1.9) lib/tailwind.ex:324: Tailwind.fetch_body!/1
    (tailwind 0.1.9) lib/tailwind.ex:230: Tailwind.install/0
    (tailwind 0.1.9) lib/tailwind.ex:215: Tailwind.install_and_run/2
    (phoenix 1.6.15) lib/phoenix/endpoint/watcher.ex:19: Phoenix.Endpoint.Watcher.watch/2
    (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: &Phoenix.Endpoint.Watcher.watch/2
    Args: ["tailwind", {Tailwind, :install_and_run, [:default, ["--watch"]]}]
[error] Task #PID<0.4427.0> started from SampleDaisyuiWeb.Endpoint terminating
** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
    (inets 9.0.1) :http_util.timestamp()
    (inets 9.0.1) httpc.erl:750: :httpc.handle_request/9
    (esbuild 0.5.0) lib/esbuild.ex:297: Esbuild.fetch_body!/1
    (esbuild 0.5.0) lib/esbuild.ex:209: Esbuild.install/0
    (esbuild 0.5.0) lib/esbuild.ex:189: Esbuild.install_and_run/2
    (phoenix 1.6.15) lib/phoenix/endpoint/watcher.ex:19: Phoenix.Endpoint.Watcher.watch/2
    (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: &Phoenix.Endpoint.Watcher.watch/2
    Args: ["esbuild", {Esbuild, :install_and_run, [:default, ["--sourcemap=inline", "--watch"]]}]
[debug] Downloading tailwind from https://github.com/tailwindlabs/tailwindcss/releases/download/v3.2.4/tailwindcss-macos-arm64
[info] Running SampleDaisyuiWeb.Endpoint with cowboy 2.9.0 at 127.0.0.1:4000 (http)
[info] Access SampleDaisyuiWeb.Endpoint at http://localhost:4000
[debug] Downloading tailwind from https://github.com/tailwindlabs/tailwindcss/releases/download/v3.2.4/tailwindcss-macos-arm64
[debug] Downloading esbuild from https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.29.tgz
[error] Postgrex.Protocol (#PID<0.4160.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4151.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4154.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.4156.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Task #PID<0.4554.0> started from SampleDaisyuiWeb.Endpoint terminating
** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
    (inets 9.0.1) :http_util.timestamp()
    (inets 9.0.1) httpc.erl:750: :httpc.handle_request/9
    (tailwind 0.1.9) lib/tailwind.ex:324: Tailwind.fetch_body!/1
    (tailwind 0.1.9) lib/tailwind.ex:230: Tailwind.install/0
    (tailwind 0.1.9) lib/tailwind.ex:215: Tailwind.install_and_run/2
    (phoenix 1.6.15) lib/phoenix/endpoint/watcher.ex:19: Phoenix.Endpoint.Watcher.watch/2
    (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: &Phoenix.Endpoint.Watcher.watch/2
    Args: ["tailwind", {Tailwind, :install_and_run, [:default, ["--watch"]]}]
[error] Task #PID<0.4553.0> started from SampleDaisyuiWeb.Endpoint terminating
** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
    (inets 9.0.1) :http_util.timestamp()
    (inets 9.0.1) httpc.erl:750: :httpc.handle_request/9
    (esbuild 0.5.0) lib/esbuild.ex:297: Esbuild.fetch_body!/1
    (esbuild 0.5.0) lib/esbuild.ex:209: Esbuild.install/0
    (esbuild 0.5.0) lib/esbuild.ex:189: Esbuild.install_and_run/2
    (phoenix 1.6.15) lib/phoenix/endpoint/watcher.ex:19: Phoenix.Endpoint.Watcher.watch/2
    (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: &Phoenix.Endpoint.Watcher.watch/2
    Args: ["esbuild", {Esbuild, :install_and_run, [:default, ["--sourcemap=inline", "--watch"]]}]
[error] Postgrex.Protocol (#PID<0.4158.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[debug] Downloading tailwind from https://github.com/tailwindlabs/tailwindcss/releases/download/v3.2.4/tailwindcss-macos-arm64
[debug] Downloading esbuild from https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.29.tgz
[error] Postgrex.Protocol (#PID<0.4155.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Task #PID<0.4555.0> started from SampleDaisyuiWeb.Endpoint terminating
** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
    (inets 9.0.1) :http_util.timestamp()
    (inets 9.0.1) httpc.erl:750: :httpc.handle_request/9
    (tailwind 0.1.9) lib/tailwind.ex:324: Tailwind.fetch_body!/1
    (tailwind 0.1.9) lib/tailwind.ex:230: Tailwind.install/0
    (tailwind 0.1.9) lib/tailwind.ex:215: Tailwind.install_and_run/2
    (phoenix 1.6.15) lib/phoenix/endpoint/watcher.ex:19: Phoenix.Endpoint.Watcher.watch/2
    (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: &Phoenix.Endpoint.Watcher.watch/2
    Args: ["tailwind", {Tailwind, :install_and_run, [:default, ["--watch"]]}]
[error] Task #PID<0.4556.0> started from SampleDaisyuiWeb.Endpoint terminating
** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
    (inets 9.0.1) :http_util.timestamp()
    (inets 9.0.1) httpc.erl:750: :httpc.handle_request/9
    (esbuild 0.5.0) lib/esbuild.ex:297: Esbuild.fetch_body!/1
    (esbuild 0.5.0) lib/esbuild.ex:209: Esbuild.install/0
    (esbuild 0.5.0) lib/esbuild.ex:189: Esbuild.install_and_run/2
    (phoenix 1.6.15) lib/phoenix/endpoint/watcher.ex:19: Phoenix.Endpoint.Watcher.watch/2
    (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: &Phoenix.Endpoint.Watcher.watch/2
    Args: ["esbuild", {Esbuild, :install_and_run, [:default, ["--sourcemap=inline", "--watch"]]}]
[info] Running SampleDaisyuiWeb.Endpoint with cowboy 2.9.0 at 127.0.0.1:4000 (http)
[info] Access SampleDaisyuiWeb.Endpoint at http://localhost:4000
[debug] Downloading tailwind from https://github.com/tailwindlabs/tailwindcss/releases/download/v3.2.4/tailwindcss-macos-arm64
[debug] Downloading esbuild from https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.29.tgz
zacky1972 commented 11 months ago

Then, when I run mix pox.server, I get this error:

I guess pox.server may be misspelled.

shu-0-lycorish commented 11 months ago

Sorry, I found that I made a misspelling when writing in the comment. In fact, it is running in mix phx.server.

zacky1972 commented 11 months ago

I guess it may need mix ecto.create before mix phx.server.

zacky1972 commented 11 months ago

After run mix ecto.create, the following error occurred:

== Compilation error in file lib/ecto/query.ex ==
** (Kernel.TypespecError) lib/ecto/query.ex:430: type dynamic/0 is a built-in type and it cannot be redefined
    (elixir 1.15.7) lib/kernel/typespec.ex:961: Kernel.Typespec.compile_error/2
    (stdlib 5.1.1) lists.erl:1599: :lists.foldl_1/3
    (elixir 1.15.7) lib/kernel/typespec.ex:226: Kernel.Typespec.translate_typespecs_for_module/2
could not compile dependency :ecto, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile ecto --force", update it with "mix deps.update ecto" or clean it with "mix deps.clean ecto"

It seems OTP 26 issue:

https://elixirforum.com/t/compilation-error-caused-by-ecto-after-upgrading-to-otp-26/57848

Use OTP 25 instead of OTP 26.

zacky1972 commented 11 months ago

@shu-0-lycorish Is this issue solved?

shu-0-lycorish commented 11 months ago

Sorry for the delay in responding.

I have made the following changes to my environment based on what you have told me:

elixir -v 
Erlang/OTP 25 [erts-13.2.2.4] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]

I then ran mix deps.get, mix eco.create, and mix phx.server in that order and got the following output:

% mix deps.get

Resolving Hex dependencies...
Resolution completed in 0.164s
Unchanged:
  castore 0.1.19
  connection 1.1.0
  cowboy 2.9.0
  cowboy_telemetry 0.4.0
  cowlib 2.11.0
  db_connection 2.4.2
  decimal 2.0.0
  ecto 3.9.2
  ecto_sql 3.9.1
  esbuild 0.5.0
  file_system 0.2.10
  floki 0.34.0
  gettext 0.20.0
  jason 1.4.0
  mime 2.0.3
  phoenix 1.6.15
  phoenix_ecto 4.4.0
  phoenix_html 3.2.0
  phoenix_live_dashboard 0.6.5
  phoenix_live_reload 1.4.0
  phoenix_live_view 0.17.12
  phoenix_pubsub 2.1.1
  phoenix_template 1.0.0
  phoenix_view 2.0.2
  phx_gen_tailwind 0.1.3
  plug 1.14.0
  plug_cowboy 2.6.0
  plug_crypto 1.2.3
  postgrex 0.16.5
  ranch 1.8.0
  swoosh 1.8.2
  tailwind 0.1.9
  telemetry 1.1.0
  telemetry_metrics 0.6.1
  telemetry_poller 1.0.0
All dependencies are up to date

 % mix ecto.create

warning: the :gettext compiler is no longer required in your mix.exs.

Please find the following line in your mix.exs and remove the :gettext entry:

    compilers: [..., :gettext, ...] ++ Mix.compilers(),

  (gettext 0.20.0) lib/mix/tasks/compile.gettext.ex:5: Mix.Tasks.Compile.Gettext.run/1
  (mix 1.15.7) lib/mix/task.ex:455: anonymous fn/3 in Mix.Task.run_task/5
  (mix 1.15.7) lib/mix/tasks/compile.all.ex:124: Mix.Tasks.Compile.All.run_compiler/2
  (mix 1.15.7) lib/mix/tasks/compile.all.ex:104: Mix.Tasks.Compile.All.compile/4
  (mix 1.15.7) lib/mix/tasks/compile.all.ex:93: Mix.Tasks.Compile.All.with_logger_app/2
  (mix 1.15.7) lib/mix/tasks/compile.all.ex:56: Mix.Tasks.Compile.All.run/1

Compiling 14 files (.ex)
Generated sample_daisyui app

01:29:16.035 [error] GenServer #PID<0.328.0> terminating
** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
    (db_connection 2.4.2) lib/db_connection/connection.ex:100: DBConnection.Connection.connect/2
    (connection 1.1.0) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib 4.3.1.3) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol

01:29:16.038 [error] GenServer #PID<0.334.0> terminating
** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
    (db_connection 2.4.2) lib/db_connection/connection.ex:100: DBConnection.Connection.connect/2
    (connection 1.1.0) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib 4.3.1.3) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol
** (Mix) The database for SampleDaisyui.Repo couldn't be created: killed

% mix deps.get   

Resolving Hex dependencies...
Resolution completed in 0.169s
Unchanged:
  castore 0.1.19
  connection 1.1.0
  cowboy 2.9.0
  cowboy_telemetry 0.4.0
  cowlib 2.11.0
  db_connection 2.4.2
  decimal 2.0.0
  ecto 3.9.2
  ecto_sql 3.9.1
  esbuild 0.5.0
  file_system 0.2.10
  floki 0.34.0
  gettext 0.20.0
  jason 1.4.0
  mime 2.0.3
  phoenix 1.6.15
  phoenix_ecto 4.4.0
  phoenix_html 3.2.0
  phoenix_live_dashboard 0.6.5
  phoenix_live_reload 1.4.0
  phoenix_live_view 0.17.12
  phoenix_pubsub 2.1.1
  phoenix_template 1.0.0
  phoenix_view 2.0.2
  phx_gen_tailwind 0.1.3
  plug 1.14.0
  plug_cowboy 2.6.0
  plug_crypto 1.2.3
  postgrex 0.16.5
  ranch 1.8.0
  swoosh 1.8.2
  tailwind 0.1.9
  telemetry 1.1.0
  telemetry_metrics 0.6.1
  telemetry_poller 1.0.0
All dependencies are up to date

% mix phx.server 

warning: the :gettext compiler is no longer required in your mix.exs.

Please find the following line in your mix.exs and remove the :gettext entry:

    compilers: [..., :gettext, ...] ++ Mix.compilers(),

  (gettext 0.20.0) lib/mix/tasks/compile.gettext.ex:5: Mix.Tasks.Compile.Gettext.run/1
  (mix 1.15.7) lib/mix/task.ex:455: anonymous fn/3 in Mix.Task.run_task/5
  (mix 1.15.7) lib/mix/tasks/compile.all.ex:124: Mix.Tasks.Compile.All.run_compiler/2
  (mix 1.15.7) lib/mix/tasks/compile.all.ex:104: Mix.Tasks.Compile.All.compile/4
  (mix 1.15.7) lib/mix/tasks/compile.all.ex:93: Mix.Tasks.Compile.All.with_logger_app/2
  (mix 1.15.7) lib/mix/tasks/compile.all.ex:56: Mix.Tasks.Compile.All.run/1

[error] Postgrex.Protocol (#PID<0.326.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.324.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.328.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.322.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.321.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.329.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.325.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.327.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.320.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.323.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[info] Running SampleDaisyuiWeb.Endpoint with cowboy 2.9.0 at 127.0.0.1:4000 (http)
[debug] Downloading tailwind from https://github.com/tailwindlabs/tailwindcss/releases/download/v3.2.4/tailwindcss-macos-arm64
[debug] Downloading esbuild from https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.29.tgz
[info] Access SampleDaisyuiWeb.Endpoint at http://localhost:4000
[error] Postgrex.Protocol (#PID<0.321.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.327.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.328.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.329.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.322.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.323.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused

warn - You have enabled the JIT engine which is currently in preview.
warn - Preview features are not covered by semver, may introduce breaking changes, and can change at any time.

Rebuilding...

🌼   daisyUI 4.4.20
[error] Task #PID<0.465.0> started from SampleDaisyuiWeb.Endpoint terminating
** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
    (inets 8.3.1.2) :http_util.timestamp()
    (inets 8.3.1.2) httpc.erl:749: :httpc.handle_request/9
    (esbuild 0.5.0) lib/esbuild.ex:297: Esbuild.fetch_body!/1
    (esbuild 0.5.0) lib/esbuild.ex:209: Esbuild.install/0
    (esbuild 0.5.0) lib/esbuild.ex:189: Esbuild.install_and_run/2
    (phoenix 1.6.15) lib/phoenix/endpoint/watcher.ex:19: Phoenix.Endpoint.Watcher.watch/2
    (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: &Phoenix.Endpoint.Watcher.watch/2
    Args: ["esbuild", {Esbuild, :install_and_run, [:default, ["--sourcemap=inline", "--watch"]]}]
[error] Task #PID<0.467.0> started from SampleDaisyuiWeb.Endpoint terminating
** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
    (inets 8.3.1.2) :http_util.timestamp()
    (inets 8.3.1.2) httpc.erl:749: :httpc.handle_request/9
    (tailwind 0.1.9) lib/tailwind.ex:324: Tailwind.fetch_body!/1
    (tailwind 0.1.9) lib/tailwind.ex:230: Tailwind.install/0
    (tailwind 0.1.9) lib/tailwind.ex:215: Tailwind.install_and_run/2
    (phoenix 1.6.15) lib/phoenix/endpoint/watcher.ex:19: Phoenix.Endpoint.Watcher.watch/2
    (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: &Phoenix.Endpoint.Watcher.watch/2
    Args: ["tailwind", {Tailwind, :install_and_run, [:default, ["--watch"]]}]
[debug] Downloading tailwind from https://github.com/tailwindlabs/tailwindcss/releases/download/v3.2.4/tailwindcss-macos-arm64
[debug] Downloading esbuild from https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.29.tgz
├─ ✔︎ 2 themes added        https://daisyui.com/docs/themes
╰─ ★ Star daisyUI on GitHub https://github.com/saadeghi/daisyui

Done in 256ms.
[error] Postgrex.Protocol (#PID<0.324.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.326.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.320.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.325.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.321.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Postgrex.Protocol (#PID<0.322.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
[error] Task #PID<0.469.0> started from SampleDaisyuiWeb.Endpoint terminating
** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
    (inets 8.3.1.2) :http_util.timestamp()
    (inets 8.3.1.2) httpc.erl:749: :httpc.handle_request/9
    (tailwind 0.1.9) lib/tailwind.ex:324: Tailwind.fetch_body!/1
    (tailwind 0.1.9) lib/tailwind.ex:230: Tailwind.install/0
    (tailwind 0.1.9) lib/tailwind.ex:215: Tailwind.install_and_run/2
    (phoenix 1.6.15) lib/phoenix/endpoint/watcher.ex:19: Phoenix.Endpoint.Watcher.watch/2
    (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: &Phoenix.Endpoint.Watcher.watch/2
    Args: ["tailwind", {Tailwind, :install_and_run, [:default, ["--watch"]]}]
[error] Task #PID<0.468.0> started from SampleDaisyuiWeb.Endpoint terminating
** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
    (inets 8.3.1.2) :http_util.timestamp()
    (inets 8.3.1.2) httpc.erl:749: :httpc.handle_request/9
    (esbuild 0.5.0) lib/esbuild.ex:297: Esbuild.fetch_body!/1
    (esbuild 0.5.0) lib/esbuild.ex:209: Esbuild.install/0
    (esbuild 0.5.0) lib/esbuild.ex:189: Esbuild.install_and_run/2
    (phoenix 1.6.15) lib/phoenix/endpoint/watcher.ex:19: Phoenix.Endpoint.Watcher.watch/2
    (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: &Phoenix.Endpoint.Watcher.watch/2
    Args: ["esbuild", {Esbuild, :install_and_run, [:default, ["--sourcemap=inline", "--watch"]]}]
^C
zacky1972 commented 11 months ago

Try this article: https://seiya-typ.hatenablog.com/entry/phoenix-server-error/

shu-0-lycorish commented 10 months ago

I tried to upgrade Postgresql based on the article you told me about, but it outputs an error:

% brew postgresql-upgrade-database
Warning: Calling brew postgresql_upgrade_database is deprecated! Use using new, versioned e.g. `var/postgres@14` datadir and `pg_upgrade` instead.
Error: No such file or directory @ rb_sysopen - /opt/homebrew/var/postgres/PG_VERSION

The status of Postgresql is as follows:

% brew info postgresql
==> postgresql@14: stable 14.10 (bottled)
Object-relational database system
https://www.postgresql.org/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/p/postgresql@14.rb
License: PostgreSQL
==> Dependencies
Build: pkg-config ✔
Required: icu4c ✔, krb5 ✘, lz4 ✔, openssl@3 ✔, readline ✔
==> Caveats
This formula has created a default database cluster with:
  initdb --locale=C -E UTF-8 /opt/homebrew/var/postgresql@14
For more details, read:
  https://www.postgresql.org/docs/14/app-initdb.html

To start postgresql@14 now and restart at login:
  brew services start postgresql@14
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/postgresql@14/bin/postgres -D /opt/homebrew/var/postgresql@14
==> Analytics
install: 51,660 (30 days), 149,123 (90 days), 448,973 (365 days)
install-on-request: 50,437 (30 days), 145,244 (90 days), 437,897 (365 days)
build-error: 32 (30 days)
zacky1972 commented 10 months ago

Did you read the warning?

Warning: Calling brew postgresql_upgrade_database is deprecated! Use using new, versioned e.g. `var/postgres@14` datadir and `pg_upgrade` instead.

This implies that the way is deprecated, so you should seek and try some new ways to fix the issue.