Environment Variables: Errors

I just updated the firezone container to the lastest version and I’m trying to update the environment variables to reflect thier new values. I’m encountering the following error:

22:10:06.653 erl_level=error domain=cowboy pid=<0.500.0> [error] #PID<0.501.0> running FzHttpWeb.Endpoint (connection #PID<0.500.0>, stream id 1) terminated
Server: 127.0.0.1:13000 (http)
Request: GET /
** (exit) an exception was raised:
** (FunctionClauseError) no function clause matching in String.split/3
(elixir 1.14.3) lib/string.ex:479: String.split(%Postgrex.INET{address: {173, 245, 48, 0}, netmask: 20}, “/”, [parts: 2])
(remote_ip 1.1.0) lib/remote_ip/block.ex:35: RemoteIp.Block.parse/1
(remote_ip 1.1.0) lib/remote_ip/block.ex:28: RemoteIp.Block.parse!/1
(elixir 1.14.3) lib/enum.ex:1658: Enum.“-map/2-lists^map/1-0-”/2
(remote_ip 1.1.0) lib/remote_ip/options.ex:311: RemoteIp.Options.pack/1
(fz_http 0.7.14) lib/fz_http_web/proxy_headers.ex:13: FzHttpWeb.ProxyHeaders.call/2
(fz_http 0.7.14) lib/fz_http_web/endpoint.ex:1: FzHttpWeb.Endpoint.plug_builder_call/2
(fz_http 0.7.14) lib/fz_http_web/endpoint.ex:1: FzHttpWeb.Endpoint.call/2

These are the two variables/values I’m updating:

PHOENIX_EXTERNAL_TRUSTED_PROXIES=[“173.245.48.0/20”, “103.21.244.0/22”, “103.22.200.0/22”, “103.31.4.0/22”, “141.101.64.0/18”, “108.162.192.0/18”, “190.93.240.0/20”, “188.114.96.0/20”, “197.234.240.0/22”, “198.41.128.0/17”, “162.158.0.0/15”, “104.16.0.0/13”, “104.24.0.0/14”, “172.64.0.0/13”, “131.0.72.0/22”, “192.168.1.253/32”]
PHOENIX_PRIVATE_CLIENTS=[“192.168.0.0/24”]

Any insight would be helpful, hopefully this is caused by bad input on my part.

Thanks for the report @gobijerboa! A fix is in the works

Excellent, thanks for all the good development work. I’ll keep an eye out for a new image to publish.

If you try wrapping the entire variables in single quotes, does the error go away? We parse these as a JSON-encoded string.

Negative, the single quote becomes the unexpected character. I’m using a .env file so technically speaking I don’t believe the variable needs to be quoted.

Errors:

  • "'[\"173.245.48.0/20\", \"103.21.244.0/22\", \"103.22.200.0/22\", \"103.31.4.0/22\", \"141.101.64.0/18\", \"108.162.192.0/18\", \"190.93.240.0/20\", \"188.114.96.0/20\", \"197.234.240.0/22\", \"198.41.128.0/17\", \"162.158.0.0/15\", \"104.16.0.0/13\", \"104.24.0.0/14\", \"172.64.0.0/13\", \"131.0.72.0/22\", \"192.168.1.253/32\"]'": unexpected byte at position 0: 0x27 (“'”)
    (fz_http 0.7.14) lib/fz_http/config/errors.ex:10: FzHttp.Config.Errors.raise_error!/1
    /app/releases/0.7.14/runtime.exs:62: (file)
    (elixir 1.14.3) src/elixir.erl:309: anonymous fn/4 in :elixir.eval_external_handler/1
    (stdlib 4.2) erl_eval.erl:748: :erl_eval.do_apply/7
    (stdlib 4.2) erl_eval.erl:961: :erl_eval.expr_list/7
    (stdlib 4.2) erl_eval.erl:290: :erl_eval.expr/6
    (stdlib 4.2) erl_eval.erl:282: :erl_eval.expr/6
    (stdlib 4.2) erl_eval.erl:961: :erl_eval.expr_list/7

Pushed a PR to fix this issue: Fix external trusted proxies env usage by AndrewDryga · Pull Request #1450 · firezone/firezone · GitHub

Just pulled the latest image (0.7.18) from docker hub and can verify that the issue has been resolved. Thank you.