Hubs-Foundation / reticulum

Phoenix web server for Hubs
Mozilla Public License 2.0
450 stars 180 forks source link

Error running reticulum on windows 11 #632

Open danflu opened 2 years ago

danflu commented 2 years ago

Hello guys! I'm trying to run reticulum on windows 11.

elixir 1.12.3 / erlang 23.3 instaled.

Steps: mix deps.get mix ecto.create

Done sucessfully.

Directory storage/dev created inside reticulum folder.

Running iex -S mix phx.server on an elevated administrator terminal, and getting error:

Last message: :cachex_warmer
State: {{:cache, :storage_used, %{}, false, {:expiration, nil, 3000, true}, {:fallback, nil, nil}, {:hooks, [], []}, {:limit, nil, Cachex.Policy.LRW, 0.1, []}, [:nonode@nohost], false, [{:warmer, Ret.StorageUsed, nil}]}, nil}
iex(1)> [error] GenServer #PID<0.1081.0> terminating
** (stop) :enoent
    (elixir 1.12.3) lib/system.ex:1041: System.cmd("df", ["-k", "storage/dev"], [])
    (ret 1.0.0) lib/ret/storage_used.ex:27: Ret.StorageUsed.execute/1
    (ret 1.0.0) lib/cachex/warmer.ex:79: Ret.StorageUsed.handle_info/2
    (stdlib 3.14.1) gen_server.erl:689: :gen_server.try_dispatch/4
    (stdlib 3.14.1) gen_server.erl:765: :gen_server.handle_msg/6
    (stdlib 3.14.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: :cachex_warmer
State: {{:cache, :storage_used, %{}, false, {:expiration, nil, 3000, true}, {:fallback, nil, nil}, {:hooks, [], []}, {:limit, nil, Cachex.Policy.LRW, 0.1, []}, [:nonode@nohost], false, [{:warmer, Ret.StorageUsed, nil}]}, nil}
iex(1)> [info] <TheEnd> no more connections
iex(1)> [info] Application ret exited: shutdown
iex(1)>

I also found a closed ticket about this exact issue and added more details there, so feel free to reopen the issue / answer there if you feel more convenient...

https://github.com/mozilla/reticulum/issues/548

Thanks a lot, Daniel

yk-eta commented 2 years ago

having the same issue, I have no idea why, when I try System.cmd("echo", ["hello"]), result Erlang error: :enoent, and System.shell("echo hello") is working, is it System.cmd not supported on Windows 11?

yk-eta commented 2 years ago

I tried on my Windows 10 having same problem.

https://stackoverflow.com/questions/49164534/elixir-system-cmd-isnt-working

look like it is not WIndows version issue, but the command issue?

yk-eta commented 2 years ago

FYI

I added a condition on the check of directory to bypass it on local, and it working

`if Mix.env() == :prod do`

on before this line https://github.com/mozilla/reticulum/blob/master/lib/ret/storage_used.ex#L13