Having 2 issues with Elixir mix task after upgrading to Elixir 1.6.6 and Erlang 21

On my dev machine with Windows 10, I have upgraded Elixir to 1.6.6. and Erlang to 21 . No I have 2 issues with mix task:

a) when I run ‘mix deps.get’ with dev.exs referencing to git e.g.
{:phoenix,git: “GitHub - phoenixframework/phoenix: Peace of mind from prototype to production”, branch: “master”, override: true},

… I’m getting following error:

Which basicly says git is not on path, but it is. Former couple Elixir 1.6.5+Erlang 20 worked well .

b) when I start ma app with:

iex --name web@127.0.0.1 --cookie 1234 -S mix phx.server

… it failes with message: -S : Could not find executable mix … which is strange as mix task is runnning fine from the same console.

When I downgrade to Elrang 20, everything is working fine. Upgrading back to Erlang.21, things above don’t work anymore

Any idea/hint whats wrong here?

1 Like

If you run erl to get an Erlang shell, and run os:getenv("PATH"). does that path look right - would it include git and mix?

1> os:getenv(“PATH”).
false

What can be wrong?

This means, that Erlang can’t see your path in the environment.

Can you check with os:getenv(). if OTP sees environment variables at all?

I’ll have a windows PC at hands in about 2 hours, I could do some verification checks there.

1 Like

Runnning os:getenv() returns all variables correctly. Here I can see that path variable has name "Path " … not “PATH” … see case sensitivity. So os:getenv("Path") returns correctly all paths including these to GIT or Elixir bin directory to mix.

I had the same issue with Erlang 21 RC1 and 2 … but thought its some RC installer related issue …

Also have the iex -S mix issue on Win10 since the update to OTP21/Elixir1.6.6.

On my Win10 box, it looks like this:

Erlang/OTP 21 [erts-10.0] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]
Interactive Elixir (1.6.6) - press Ctrl+C to exit (type h() ENTER for help)

iex(1)> :erlang.system_info(:otp_release)
'21'

iex(2)> System.version
"1.6.6"

iex(3)> System.get_env("PATH")
nil

iex(4)> System.get_env("Path") |> String.split(";") |> Enum.filter(&(String.contains?(&1, "Eli") or String.contains?(&1,"erl")))
[
    "C:\\Program Files\\erl10.0\\erts-10.0\\bin",
    "C:\\Program Files\\erl10.0\\bin", 
    "C:\\Program Files (x86)\\Elixir\\bin"
]

While this does not work

iex -S mix

this one does

"C:\Program Files (x86)\Elixir\bin\iex.bat" "C:\Program Files (x86)\Elixir\bin\mix"

Regression of this? https://github.com/elixir-lang/elixir/issues/1202

1 Like

This must be a regression in Erlang/OTP 21, this is (probably) the offending commit: https://github.com/erlang/otp/commit/c2d70945dce9cb09d5d7120d6e9ddf7faac8d230#diff-c74b26b137d05916452fd63150bc0ca0

I’ve created a bug to track the issue: https://bugs.erlang.org/browse/ERL-644

It’s probably enough to do an unconditional “toupper” on the key in convert_value_to_native on Windows, sadly I currently have no working Windows build environment to test this :confused:

2 Likes

Its not necessarily that commit. That commit just added an indirection, but at the end the work is done in a NIF. At least as far as I can tell…

edit Oh, the NIFs sources are touched in that commit as well. But as someone already has picked up the issue according to the bug tracker, I wont dive any further :wink:

It has been fixed already: https://bugs.erlang.org/browse/ERL-644?focusedCommentId=13312

Though (if no one else steps in) we have to wait for 21.1 for a build.

1 Like

It is fixed in the released 21.0.1 Windows build.

1 Like

Well, installed Erlang 21.0.1 with Elixir 1.6.6 and started my simple Phoenix 1.3.3 app. Can’t even see a default homepage :frowning: Raises this …

[error] Ranch protocol #PID<0.946.0> of listener WebWeb.Endpoint.HTTP (cowboy_protocol) terminated
** (exit) an exception was raised:
** (UndefinedFunctionError) function :cowboy_req.new/14 is undefined or private
(cowboy) :cowboy_req.new(#Port<0.2048>, :ranch_tcp, {{127, 0, 0, 1}, 51450}, “GET”, “/”, “”, :“HTTP/1.1”, [{“host”, “localhost:4000”}, {“connection”, “keep-alive”}, {“cache-control”, “max-age=0”}, {“upgrade-insecure-requests”, “1”}, {“user-agent”, “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36”}, {“accept”, “text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8”}, {“accept-encoding”, “gzip, deflate, br”}, {“accept-language”, “cs,en-US;q=0.9,en;q=0.8”}, {“cookie”, “gsScrollPos-302=0; gsScrollPos-53=; ui-auth-localhost%3A8091=ac8ca901c54e5540954148e833faed75; ckCsrfToken=7768fXHMnKvX0JD6ux0ZO8Wg51TKj4Y9Y956FadA; SessionID=FD46D733A08E8D867DFB222FDCF8CC7C5C6D7F9A; org.springframework.web.servlet.i18n.CookieLocaleResolver.LOCALE=cs; grafana_sess=6f50034774bf2fce; __gfp_64b=xJC8fCSjQPU0ZkK_XO_suVxFl5R4X17gMoS1Amj3LT7.q7; gsScrollPos-920=0; gsScrollPos-1765=0; gsScrollPos-1857=0; _ga=GA1.1.789952847.1522819700; DomAuthSessId=C47C262B742E5479892DB8B9E6943FFE; io=Y9bv0KiybyGJv7z2AAAA; JSESSIONID=5AFA7B4E1FA8727E5F43E11A42142B50”}], “localhost”, 4000, “”, true, false, #Function<1.70938636/4 in Plug.Adapters.Cowboy.add_on_response/3>)
c:/eprojects/phoenix13/web_app_ph13/deps/cowboy/src/cowboy_protocol.erl:410: :cowboy_protocol.request/9
[error] Ranch protocol #PID<0.951.0> of listener WebWeb.Endpoint.HTTP (cowboy_protocol) terminated
** (exit) an exception was raised:

Seems like its problem with Cowboy 2.x … switching back to 1.x fixed the issue