tjhanley

tjhanley

Installing Elixir on Centos 7 - Mix.Error: Could not decode public key

I am trying to install elixir on our Centos 7 build agents.

I’ve installed erlang 19

$ erl
Erlang/OTP 19 [erts-8.1] [source-77fb4f8] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V8.1  (abort with ^G)
1>

I’ve pulled the tar for 1.4.2 from github. When I run
make clean test

This is the output I am getting.

  1) test installs public keys (Mix.Tasks.Local.PublicKeysTest)
     test/mix/tasks/local.public_keys_test.exs:31
     ** (Mix.Error) Could not decode public key: /home/tomha/elixir-1.4.2/lib/mix/tmp/sample.pub. The public key contents are shown below.

     -----BEGIN PUBLIC KEY-----
     MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmlRL//AgfszL2vkk7G3K
     t+vrI2d3aG+fGD4BZ1k1Qd/mS0EoDNfDQCpqtLzdM7oOjtu0BNCBvG3HC0tlAU92
     i3EFqEC7RSHNIGYrQ4g5WwGQMw8+Qp3D32esw7iRZKvtJu8IpS7l8x4KQq1QbfTh
     s+3yFOQyytnY6of7w2Rv37WtdA3wKAIP6yPgvl8QzwxHRORX4zNcadsJOuZt3ncv
     Bq7pyQN8g2ddF86Ycep/+cU4/onnGW3zHn5pGdvuiHqxGOq+s3+UzljLyLlTCwzz
     ncYdESIw29EEIB5xTcT0Q4qRQEuDwcp8/fASTZ7c6lv8AfpRKb69tGWLoXcx/V9P
     dQIDAQAB
     -----END PUBLIC KEY-----


     Public keys must be valid and be in the PEM format

     stacktrace:
       (mix) lib/mix.ex:276: Mix.raise/1
       (mix) lib/mix/tasks/local.public_keys.ex:63: Mix.Tasks.Local.PublicKeys.install/2
       test/mix/tasks/local.public_keys_test.exs:36: (test)

....................................................................................................................................................................................................................................

  2) test select correct versions from csv (Mix.LocalTest)
     test/mix/local_test.exs:80
     ** (Mix.Error) Could not decode public key: in-memory public key for Elixir v1.4.2. The public key contents are shown below.

     -----BEGIN PUBLIC KEY-----
     MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAslPz1mAfyAvRv8W8xOdv
     HQMbDJkDKfRhsL4JBGwGH7qw0xh+TbaUlNaM3pF+i8VUjS/4FeXjT/OAUEAHu5Y2
     rBVlx00QcH8Dpbyf+H73XiCs0MXnTSecqDgzx6i6NMi8knklHT7yHySHtuuPmPuN
     Po8QTKolCKftwPE/iNDeyZfwufd+hTCoCQdoTVcB01SElfNtvKRtoKbx35q80IPr
     rOcGsALmr58+bWqCTY/51kFeRxzrPJ5LdcLU/AebyWddD4IUfPDxk16jTiCagMWA
     JPSwo8NUrWDIBbD+rEUp06y0ek276rG5Tzm/3Bma56RN/u6nAqBTBE8F2Hu2QBKj
     lQIDAQAB
     -----END PUBLIC KEY-----


     Public keys must be valid and be in the PEM format

     stacktrace:
       (mix) lib/mix.ex:276: Mix.raise/1
       (mix) lib/mix/public_key.ex:56: anonymous fn/4 in Mix.PublicKey.verify/3
       (elixir) lib/enum.ex:2732: Enum.do_any?/2
       (mix) lib/mix/local.ex:125: Mix.Local.find_matching_versions_from_signed_csv!/2
       test/mix/local_test.exs:86: anonymous fn/0 in Mix.LocalTest.test select correct versions from csv/1
       (elixir) lib/file.ex:1162: File.cd!/2
       test/mix/local_test.exs:81: (test)

..................

Finished in 91.4 seconds (6.0s on load, 85.4s on tests)
405 tests, 2 failures

Randomized with seed 941253
make: *** [test_mix] Error 1

Most Liked

tjhanley

tjhanley

Interesting… it seems like yum install erlang-19.3* installs a bad package. If I do yum install esl-erlang-19.3 things are happier.

ChaseGilliam

ChaseGilliam

You should use the erlang solutions erlang install and build elixir from source on CentOS, imho. Try this set of instructions

tjhanley

tjhanley

more specific

Installed Packages
erlang.x86_64                                                       19.3-1.el7.centos

It looks like something may be broken with ssl or crypto?

$ mix
Could not find Hex, which is needed to build dependency :loki
Shall I install Hex? (if running non-interactively, use: "mix local.hex --force") [Yn]

22:30:42.441 [info]  Application crypto exited: :stopped
** (MatchError) no match of right hand side value: {:error, {:asn1, {'no such file or directory', 'asn1.app'}}}
    (mix) lib/mix/utils.ex:432: Mix.Utils.read_httpc/1
    (mix) lib/mix/utils.ex:376: Mix.Utils.read_path/2
    (mix) lib/mix/local.ex:139: Mix.Local.read_path!/2
    (mix) lib/mix/local.ex:118: Mix.Local.find_matching_versions_from_signed_csv!/2
    (mix) lib/mix/tasks/local.hex.ex:29: Mix.Tasks.Local.Hex.run/1
    (mix) lib/mix/dep/loader.ex:143: Mix.Dep.Loader.with_scm_and_app/4
    (mix) lib/mix/dep/loader.ex:99: Mix.Dep.Loader.to_dep/3
    (elixir) lib/enum.ex:1229: Enum."-map/2-lists^map/1-0-"/2
tjhanley

tjhanley

I’ll try the precompiled :thumbsup:

Where Next?

Popular in Questions Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
makeitrein
Hey all, just started picking up Elixir last week and am writing a scraper as a learning project. Baby step #1 is extracting the number ...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
kostonstyle
Hi all I want to have a unix time, from the current time plus 1 hour. DateTime.now + 1 hour How to get it in elixir? Thanks
New
Exadra37
Sometimes I want to check if the input into a function is not a blank string. My first approach: defmodule Example do def do_stuff(s...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
Codball
Mix format works fine if run from the cmd. I’ve followed this to facilitate the implementation into VSC which involves downloading an ext...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
idi527
I’ve been re-reading swift book again and noticed that multiline strings there don’t have a trailing line break, unlike in elixir iex(2)...
New

Other popular topics Top

chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
AstonJ
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New

We're in Beta

About us Mission Statement