bcrypt_elixir icon indicating copy to clipboard operation
bcrypt_elixir copied to clipboard

Mix deps.get hanging

Open lukashambsch opened this issue 6 years ago • 22 comments
trafficstars

I'm trying to upgrade from elixir 1.8.1 to 1.9.2. After upgrading, I get this error when running mix test:

could not compile dependency :bcrypt_elixir, "mix compile" failed. You can recompile this dependency with "mix deps.compile bcrypt_elixir", update it with "mix deps.update bcrypt_elixir" or clean it with "mix deps.clean bcrypt_elixir"
==> any_gym_planner
** (Mix) Could not compile with "make" (exit status: 69).
You need to have gcc and make installed. Try running the
commands "gcc --version" and / or "make --version". If these programs
are not installed, you will be prompted to install them.

So I checked the versions of bcrypt_elixir and noticed that there is now a version 2. So I tried upgrading to version 2 and when I run mix deps.get it just hangs after outputting Resolving Hex dependencies.... Any ideas on what would cause this?

lukashambsch avatar Nov 02 '19 14:11 lukashambsch

The first error seems to be resolved by accepting the xcode agreement (not sure what effect the elixir upgrade had on this). But it's still hanging when I try to upgrade bcrypt_elixir to 2.0.

lukashambsch avatar Nov 02 '19 15:11 lukashambsch

I am not sure if this will make a difference, but please make sure that comeonin is not in the list of dependencies in the mix.exs file.

I will look into this issue further and get back to as soon as I can.

riverrun avatar Nov 04 '19 00:11 riverrun

It is not in the mix.exs file. But I do see it in the mix.lock file.

lukashambsch avatar Nov 04 '19 23:11 lukashambsch

Ok. I will try to find out more about this problem and get back to you soon.

riverrun avatar Nov 05 '19 01:11 riverrun

In this issue, they suggest upgrading hex to solve a similar problem. Could you try that and let me know if it works?

riverrun avatar Jan 08 '20 06:01 riverrun

It's still just hanging for me even after running mix local.hex --force.

lukashambsch avatar Jan 09 '20 00:01 lukashambsch

Ok. One more suggestion: try running mix deps.clean --unlock --unused, and then run mix deps.get.

riverrun avatar Jan 15 '20 02:01 riverrun

Sorry for the slow response. I tried running mix deps.clean --unlock --unused, then running mix deps.get. Unfortunately it's still hanging when I have {:bcrypt_elixir, "~> 2.0"} in my dependencies.

lukashambsch avatar Feb 04 '20 00:02 lukashambsch

Someone using pbkdf2_elixir solved a similar issue by running HEX_HTTP_CONCURRENCY=1 HEX_HTTP_TIMEOUT=120 mix deps.get.

riverrun avatar Feb 14 '20 06:02 riverrun

Still no luck. Just hanging when I run that command too.

lukashambsch avatar Feb 16 '20 17:02 lukashambsch

Sorry to hear you are still having these issues. I don't really know what to suggest to fix it at the moment, but if I hear of anything, I will let you know.

riverrun avatar Mar 01 '20 04:03 riverrun

That's alright. I appreciate everything you've done to try & help. Thanks!

lukashambsch avatar Mar 01 '20 23:03 lukashambsch

I do have this issue when trying to use version 2.2 in my mix.exs.

My Dockerfile also hang and kill the process, using this setup:

FROM hexpm/elixir:1.9.3-erlang-22.3-alpine-3.11.3 AS otp-builder`

Boubalou avatar Apr 06 '20 17:04 Boubalou

If you are using windows, maybe the problem is related to nmake.exe

in your project elixir try it:

1- is necessary to have installed the vs studio. Check you location of vs is installed.

run cmd /K "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 After this, execute mix deps.compile

See more in: https://stackoverflow.com/questions/49471198/how-to-fix-could-not-compile-dependency-bcrypt-elixir-error-on-windows

rodrigoporcionato avatar May 04 '20 19:05 rodrigoporcionato

I m having similar issue with this image

FROM elixir:1.12.1-alpine 

What I dont understand is that it work on my laptop but not on remote server

tatiesmars avatar Jun 28 '21 13:06 tatiesmars

I m having similar issue with this image

FROM elixir:1.12.1-alpine 

What I dont understand is that it work on my laptop but not on remote server

I'm having the same problem, locally the image is compiling, on my CI is failing with the same error from this issue.

phcurado avatar Jul 06 '21 18:07 phcurado

I have the same issue with elixir:1.12-alpine. It looks like some sort of permission issue because when I have my Dockerfile just get dependencies but not download them and then run with docker run -it my_app:latest "sh" and then run mix deps.compile it gives me this error. But when I do the same thing with docker run -it --privileged my_app:latest "sh" then it compiles like normal. I'm not really sure where to go from there though.

dnsbty avatar Jul 17 '21 02:07 dnsbty

After playing around with this more today, it appears that the issue is with a change in Alpine 3.14. I found that via this issue.

I was able to solve it by updating Docker Desktop. On a remote server, you would probably need to update docker and containerd depending on your exact setup.

The other option would be to switch to a different image that's based on Alpine 3.13.3 (the last version prior to the change). At the moment, I would probably recommend hexpm/elixir:1.12.2-erlang-24.0.3-alpine-3.13.3

dnsbty avatar Jul 17 '21 22:07 dnsbty

Is there a good solution for this for newer hexpm/elixir versions which use a newer version of alpine?

Ch4s3 avatar Nov 12 '21 04:11 Ch4s3

for me what worked was to add this:

RUN apk --no-cache add git make gcc erlang-dev libc-dev

to the docker image

abdul-hamid-achik avatar Mar 12 '22 07:03 abdul-hamid-achik

specifically i think it was libc-dev

abdul-hamid-achik avatar Mar 14 '22 18:03 abdul-hamid-achik

specifically i think it was libc-dev

You totally saved my butt. I thought I'd never be able to upgrade from my old configuration, but it was this tip that helped me. Thanks!

mazz avatar Apr 21 '23 00:04 mazz