Getting error while pushing code to Gigalixir

phoenix
deployment

#1

I am trying to setup a testing environment with Gigalixir platform and receiving error, appreciate your help and thanks.

-----> Fetching app dependencies with mix
remote: ** (ArgumentError) argument error
remote:     (stdlib) eval_bits.erl:101: :eval_bits.eval_exp_field1/6
remote:     (stdlib) eval_bits.erl:92: :eval_bits.eval_field/3
remote:     (stdlib) eval_bits.erl:68: :eval_bits.expr_grp/4
remote:     (stdlib) erl_eval.erl:481: :erl_eval.expr/5
remote:     (stdlib) erl_eval.erl:885: :erl_eval.expr_list/6
remote:     (stdlib) erl_eval.erl:240: :erl_eval.expr/5
remote:     (stdlib) erl_eval.erl:232: :erl_eval.expr/5
remote: Command '[u'docker', u'run', u'--rm', u'-e', u'GIGALIXIR_SHOULD_CLEAN_CACHE=False', u'-v', u'/tmp/tmpyvIMf4/realistic-old-hoiho:/tmp/app', u'-v', u'/tmp/gigalixir/cache/realistic-old-hoiho/:/tmp/cache', u'-v', u'/tmp/tmpyvIMf4/env:/tmp/env', u'--env=USER=www-data', u'us.gcr.io/gigalixir-152404/herokuish:latest']' returned non-zero exit status 1
To https://git.gigalixir.com/realistic-old-hoiho.git
 ! [remote rejected] master -> master (pre-receive hook declined)

Here is complete log from git push:

Total 4452 (delta 1892), reused 2039 (delta 1424)
remote: Setting environment variables.
remote: * LIBCLUSTER_KUBERNETES_SELECTOR
remote: * LIBCLUSTER_KUBERNETES_NODE_BASENAME
remote: * SECRET_KEY_BASE
remote: Cloning into 'realistic-dredf-weee'...
remote: warning: You appear to have cloned an empty repository.
remote: done.
remote: Compiling code and generating slug.
remote: latest: Pulling from gigalixir-152404/herokuish
remote: Digest: sha256:7931524b09043bd2bc691417485af3a8602226f61a857d84d4bbc25267b9a9cb
remote: Status: Image is up to date for us.gcr.io/gigalixir-152404/herokuish:latest
-----> Warning: Multiple default buildpacks reported the ability to handle thisapp. The first buildpack in the list below will be used.
       Detected buildpacks: multi elixir
-----> Multipack app detected
=====> Downloading Buildpack: https://github.com/gigalixir/gigalixir-buildpack-clean-cache.git
=====> Detected Framework: Clean Cache
       Not cleaning cache
=====> Downloading Buildpack: https://github.com/HashNuke/heroku-buildpack-elixir
=====> Detected Framework: Elixir
-----> Checking Erlang and Elixir versions
       Will use the following versions:
       * Stack cedar-14
       * Erlang 21.0
       * Elixir 1.7.4
-----> Will export the following config vars:
       LIBCLUSTER_KUBERNETES_NODE_BASENAME
       LIBCLUSTER_KUBERNETES_SELECTOR
       SECRET_KEY_BASE
       * MIX_ENV=prod
-----> Fetching Erlang 21.0 from https://s3.amazonaws.com/heroku-buildpack-elixir/erlang/cedar-14/OTP-21.0.tar.gz
-----> Installing Erlang 21.0 (changed)

-----> Using cached Elixir v1.7.4
-----> Installing Elixir v1.7.4
-----> Installing Hex
       * creating /app/.mix/archives/hex-0.19.0
-----> Installing rebar
       * creating /app/.mix/rebar
       * creating /app/.mix/rebar3
-----> Fetching app dependencies with mix
remote: ** (ArgumentError) argument error
remote:     (stdlib) eval_bits.erl:101: :eval_bits.eval_exp_field1/6
remote:     (stdlib) eval_bits.erl:92: :eval_bits.eval_field/3
remote:     (stdlib) eval_bits.erl:68: :eval_bits.expr_grp/4
remote:     (stdlib) erl_eval.erl:481: :erl_eval.expr/5
remote:     (stdlib) erl_eval.erl:885: :erl_eval.expr_list/6
remote:     (stdlib) erl_eval.erl:240: :erl_eval.expr/5
remote:     (stdlib) erl_eval.erl:232: :erl_eval.expr/5
remote: Command '[u'docker', u'run', u'--rm', u'-e', u'GIGALIXIR_SHOULD_CLEAN_CACHE=False', u'-v', u'/tmp/tmpyvIMf4/realistic-old-hoiho:/tmp/app', u'-v', u'/tmp/gigalixir/cache/realistic-old-hoiho/:/tmp/cache', u'-v', u'/tmp/tmpyvIMf4/env:/tmp/env', u'--env=USER=www-data', u'us.gcr.io/gigalixir-152404/herokuish:latest']' returned non-zero exit status 1
To https://git.gigalixir.com/realistic-old-hoiho.git
 ! [remote rejected] master -> master (pre-receive hook declined)

My Dependencies look as below:

# Type `mix help deps` for examples and options.
  defp deps do
    [
      {:phoenix, "~> 1.3.2"},
      {:phoenix_pubsub, "~> 1.0"},
      {:phoenix_ecto, "~> 3.2"},
      {:postgrex, ">= 0.0.0"},
      {:gettext, "~> 0.11"},
      {:cowboy, "~> 1.0"},
      {:authex, "~> 0.2.1"},
      {:canary, "~> 1.1.1"},
      {:canada, "~> 1.0.1"},
      {:sage, "~> 0.4.0"},
      {:comeonin, "~> 4.0"},
      {:bcrypt_elixir, "~> 1.0"},
      {:nimble_csv, "~> 0.3"},
      {:geo_postgis, "~> 2.0"},
      {:ex_aws, "~> 1.0"},
      {:timex, "~> 3.3"},
      {:swoosh, "~> 0.13"},
      {:gen_smtp, "~> 0.12.0"},
      {:httpoison, "~> 1.0", override: true},
      {:absinthe, "~> 1.4.0"},
      {:absinthe_plug, "~> 1.4.0"},
      {:absinthe_ecto, "~> 0.1.3"},
      {:plug_id_column, "~> 0.1.3"},
      {:kronky, "~> 0.5.0"},
      {:credo, "~> 0.9.0", only: [:dev, :test], runtime: false},
      {:distillery, "~> 1.0", runtime: false},
      {:edeliver, "~> 1.4.5"},
      {:ex_doc, "~> 0.19.0", only: [:dev], runtime: false},
      {:dialyxir, "~> 0.5", only: [:dev], runtime: false}
    ]
  end

#2

Could it be this one? https://github.com/elixir-lang/elixir/issues/8433


#3

Thanks for pointing to other issue, YES it is to do with env variables, I found solution on Heroku deployment error log and corrected.

Struggled bit as Gigalixir did not provide any logs, will try again soon and post back.


#4

I’m glad you solved the issue, but I’m slightly confused about what logs you saw on heroku that gigalixir didn’t have. Any way you can post what you saw here so we can improve gigalixir?


#5

Here is Heroku ‘activity log’ for failed build push.

-----> Elixir app detected

-----> Checking Erlang and Elixir versions

Will use the following versions:

  • Stack heroku-18

  • Erlang 21.0

  • Elixir 1.7.4

-----> Will export the following config vars:

APP_NAME

  • MIX_ENV=prod

-----> Stack changed, will rebuild

-----> Fetching Erlang 21.0 from https://s3.amazonaws.com/heroku-buildpack-elixir/erlang/cedar-14/OTP-21.0.tar.gz

-----> Installing Erlang 21.0 (changed)

-----> Fetching Elixir v1.7.4 for OTP 21 from https://repo.hex.pm/builds/elixir/v1.7.4-otp-21.zip

-----> Installing Elixir v1.7.4 (changed)

-----> Installing Hex

  • creating /app/.mix/archives/hex-0.19.0

-----> Installing rebar

  • creating /app/.mix/rebar

  • creating /app/.mix/rebar3

-----> Fetching app dependencies with mix

** (KeyError) key “SECRET_KEY_BASE” not found in: %{“APP_NAME” => “quiet-eyrie-96419”, “BINDIR” => “/app/.platform_tools/erlang/erts-10.0/bin”, “BUILDPACK_LOG_FILE” => “/dev/null”, “DYNO” => “run.9098”, “EMU” => “beam”, “HOME” => “/app”, “LANG” => “en_US.UTF-8”, “LC_CTYPE” => “en_US.utf8”, “MIX_ENV” => “prod”, “OLDPWD” =>

…and MORE info

All I was saying was Gigalixir did not provide detailed logs on their website where in I was able to find it on Heroku that helped me that I must maintain these Env Variables upfront before the push.

I am very new to Cloud servers and learning on the go! Hope this answers your question.