Problems in deployment - Error I don't understand (1/n)

I am trying to deploy a small phoneix liveview project on gigalixir.

Following this tutorial using distillery : Deploying with Gigalixir (Revised) - ElixirCasts

my prod.exs says


config :live_view_studio, LiveViewStudioWeb.Endpoint,
  load_from_system_env: true,
  http: [port: {:system, "PORT"}],    
  server: true,    # <<<<<< THIS IS LINE 15 (where error occurs)
...

and error is

(SyntaxError) config/prod.exs:15: unexpected expression after keyword list. Keyword lists must always come as the last argument. Therefore, this is not allowed:

   function_call(1, some: :option, 2)

Instead, wrap the keyword in brackets:

   function_call(1, [some: :option], 2)

I don’t understand why is this error even though the line seems fine.

Any help is appreciated.

Maybe it is the trailing , or something that happens directly after line 15. Can you post the lines after line 15?

2 Likes

few lines as requested.

config :live_view_studio, LiveViewStudioWeb.Endpoint,
  load_from_system_env: true,
  http: [port: {:system, "PORT"}],
  server: true,
  secret_key_base= "${SECRET_KEY_BASE}",
  url: [host: "${APP_NAME}.gigalixirapp.com", port: 443 ],
  cache_static_manifest: "priv/static/cache_manifest.json"

# Do not print debug messages in production
config :logger, level: :info

# ## SSL Support
#

Check secret_key_base key, you’ve got = instead of :

3 Likes

Oh. Coming from python, it felt normal.

My bad.

It works now! Thanks a lot!

1 Like

on running

git push gigalixir master
I get

...
Checking Erlang and Elixir versions
       Sorry, an elixir_buildpack.config is required. Please see https://github.com/HashNuke/heroku-buildpack-elixir#configuration
remote: 2021/09/04 07:12:49 exit status 1
remote: Deploy aborted
...

even though I have the file : output of ls -1


Makefile
README.md
_build
assets
config
deps
elixir_buildpack.config <<<<<<<<<<<<<<<<<<<<<<< this file
lib
mix.exs
mix.lock
phoenix_buildpack_static.config
priv
rel
test

and cat elixir_buildpack.config gives

elixir_version=1.12.2
erlang_version=24.0
always_rebuild=true%

You’ve got % char in the last line.

Nah. That just shows in terminal, not in file.

image

Have you commited the buildpack file to git?

yes.

diff --git a/elixir_buildpack.config b/elixir_buildpack.config
new file mode 100644
index 0000000..0a53322
--- /dev/null
+++ b/elixir_buildpack.config


@@ -0,0 +1,3 @@
+elixir_version=1.12.2
+erlang_version=24.0
+always_rebuild=true
\ No newline at end of file


diff --git a/phoenix_buildpack_static.config b/phoenix_buildpack_static.config
new file mode 100644