Compile issue since upgrading lib version

A couple of days ago I updated my HTTPoison dep to 0.11.0, and I’m now struggling to get my lib to compile on my other machine. I have done a fresh clone from GitHub to ensure I was starting from scratch and I’m having no luck.

This is the output I am receiving.

$ mix compile
===> Package certifi-0.7.0 not found. Fetching registry updates and trying again...
===> Updating package registry...
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> When submitting a bug report, please include the output of `rebar3 report "your command"`
** (Mix) Could not compile dependency :hackney, "escript.exe "m:/.mix/rebar3" bare compile 
--paths "<project_path>/cashier/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency 
with "mix deps.compile hackney", update it with "mix deps.update hackney" or clean it with "mix deps.clean hackney"

Any help with this would be greatly appreciated!

1 Like

Please see: :slight_smile:

In essence, make sure Elixir is upgraded to 1.4.1 or higher, if you have a defined applications list in your mix.exs file then make sure that :hackney is in it, and of course delete your _build directory.

And although you did not say, I’m guessing you have a mac as that seems to be a common theme amongst this issue? ^.^

1 Like

Thanks @OvermindDL1, but sadly this is what I have already tried without any luck.

The following are

This machine is running Windows 7

My Elixir version is 1.4.1 (should I be on Erlang/OPT 19 for this?)

$ elixir -v
Erlang/OTP 18 [erts-7.2.1] [64-bit] [smp:4:4] [async-threads:10]

Elixir 1.4.1

And this is my mix file

Also this is my output with DEBUG=1 (I should have pasted that originally!), which looks the same as others I have seen reported that your suggestions fixed.

$ mix compile
===> Expanded command sequence to be run: []
===> Expanded command sequence to be run: [{default,app_discovery},
                                           {bare,compile}]
===> Error loading package registry: {read_error,
                                      {file_error,
                                       "m:/.cache/rebar3/hex/default/registry",
                                       enoent}}
===> Package certifi-0.7.0 not found. Fetching registry updates and trying again...
===> Updating package registry...
===> Fetching registry from "https://repo.hex.pm:443/registry.ets.gz?"
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: {badmatch,
                         {error,{rebar_prv_update,package_index_download}}}
===> Stack trace to the error location:
[{rebar_packages,handle_missing_package,3,
                 [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_packages.erl"},
                  {line,85}]},
 {rebar_app_utils,update_source,3,
                  [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_app_utils.erl"},
                   {line,198}]},
 {rebar_app_utils,dep_to_app,7,
                  [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_app_utils.erl"},
                   {line,169}]},
 {rebar_app_utils,'-parse_deps/6-lc$^0/1-0-',6,
                  [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_app_utils.erl"},
                   {line,98}]},
 {rebar_app_discover,'-do/2-fun-0-',3,
                     [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_app_discover.erl"},
                      {line,31}]},
 {lists,foldl,3,[{file,"lists.erl"},{line,1262}]},
 {rebar_app_discover,do,2,
                     [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_app_discover.erl"},
                      {line,27}]},
 {rebar_prv_app_discovery,do,1,
                          [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_prv_app_discovery.erl"},
                           {line,38}]}]
===> When submitting a bug report, please include the output of `rebar3 report "your command"`
** (Mix) Could not compile dependency :hackney, "escript.exe "m:/.mix/rebar3" bare compile 
--paths "<project path>/cashier/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with 
"mix deps.compile hackney", update it with "mix deps.update hackney" or clean it with "mix deps.clean hackney"
1 Like

Fascinating…

And you’ve already done mix local.rebar to make sure your local rebar install is updated too?

I’m unsure what else off-hand then, I use httpoison at work but I’ve not yet updated it, let me clone your https://github.com/swelham/cashier.git repo and see what happens (using Windows 10), mix deps.get works, now doing mix compile and successful. For comparison, my two rebar versions are:

$ ~/.mix/rebar --version
rebar 2.6.2 R15B03 20160628_123811 git 2.6.2

$ ~/.mix/rebar3 --version
rebar 3.3.2 on Erlang/OTP 19 Erts 8.2
3 Likes

Yes I updated rebar and my versions match yours with the exception I appear to be on Erlang/OTP 18 instead.

$ ~/.mix/rebar --version
rebar 2.6.2 R15B03 20160628_123811 git 2.6.2

$ ~/.mix/rebar3 --version
rebar 3.3.2 on Erlang/OTP 18 Erts 7.2.1

I will be home in a few hours, so I will try on my laptop and see if I get any issues.

1 Like

Ooo, definitely update that is what I’d try next!

1 Like

Just to make things really confusing, my laptop at home is also running version 18 and works just fine. I think I might just go for a reinstall of Elixir/Erlang on the other machine and if that resolves it.

Thanks for you help @OvermindDL1

2 Likes

This is the strangest thing ever.

I have update erlang and uninstalled the older version, I have deleted both ~/.mix and ~/.hex, reinstalled elixir and subsequently hex and rebar, deleted and then cloned repo and this project still will not compile on this machine :confused:

Short of throwing it out of the window, I am completely lost on how to sort this.

1 Like

Hmm, are you behind a proxy maybe?

EDIT: And when you re-cloned the repo, you did it into an entirely new path?

1 Like

Yes and I am using the http_proxy/https_proxy variables. I assume the proxy isn’t an issue as this was working just a few days ago, plus I assume mix.deps wouldn’t work if the proxy settings were wrong.

Tried this and ended up at the same result.

1 Like

Except I’m unsure if rebar would use the proxy, I know I’ve heard of issues with that before somewhere…

3 Likes

OK I will have a look into that tomorrow and see what I can find out.

1 Like

You were spot on @OvermindDL1, rebar wasn’t using the proxy env variables.

I had to create a rebar config in ~/.config/rebar3/rebar.config and add the following proxy config.

{http_proxy, "http://<proxy address>"}.
{https_proxy, "https://<proxy address>"}.

Once again, thanks for you help :thumbsup:

4 Likes

Awesome! If that is not documented somewhere in the mix docs you should submit a PR. :slight_smile:

2 Likes

Yes I will take a look and see if there is anything in there!

Thanks again!

1 Like

Find the follow link “Getting started with Erlang and Cowboy on Windows (rebar3 edition)” online
http://www.vultaire.net/blog/2016/01/17/getting-started-with-erlang-and-cowboy-on-windows-rebar3-edition/

Under “For those behind proxy servers” section, there is a detail explanation for issue with rebar3 behind proxy.
I follow the steps to sort out the user profile location and setup the rebar.config and get pass the issue with compile hackney.

3 Likes