Describe your issue here.
Ubuntu 18.04 with Docker
make start
At least the container image can be built
Compilation failed, with all tags that have docker files.
Step 12/14 : RUN mix compile
---> Running in c287b9f280ef
==> ethereum_jsonrpc
Compiling 33 files (.ex)
warning: invalid type annotation. When using the | operator to represent the union of types, make sure to wrap type annotations in parentheses: String.t() | options :: term()
lib/ethereum_jsonrpc/web_socket.ex:40
warning: invalid type annotation. Type annotations cannot be nested: url :: String.t() | options :: term()
lib/ethereum_jsonrpc/web_socket.ex:40
warning: invalid type annotation. When using the | operator to represent the union of types, make sure to wrap type annotations in parentheses: String.t() | options :: term()
lib/ethereum_jsonrpc/web_socket.ex:40
warning: invalid type annotation. When using the | operator to represent the union of types, make sure to wrap type annotations in parentheses: String.t() | options :: term()
lib/ethereum_jsonrpc/web_socket.ex:46
warning: invalid type annotation. Type annotations cannot be nested: url :: String.t() | options :: term()
lib/ethereum_jsonrpc/web_socket.ex:46
warning: invalid type annotation. When using the | operator to represent the union of types, make sure to wrap type annotations in parentheses: String.t() | options :: term()
lib/ethereum_jsonrpc/web_socket.ex:46
warning: invalid type annotation. When using the | operator to represent the union of types, make sure to wrap type annotations in parentheses: {:already_started, pid()} | reason :: term()
lib/ethereum_jsonrpc/web_socket.ex:46
Compilation failed due to warnings while using the --warnings-as-errors option
==> explorer
Compiling 83 files (.ex)
Generated explorer app
==> block_scout_web
Compiling 119 files (.ex)
Generated block_scout_web app
==> indexer
Compiling 44 files (.ex)
Generated indexer app
The command '/bin/sh -c mix compile' returned a non-zero code: 1
Makefile:51: recipe for target 'build' failed
make: *** [build] Error 1
I'm assuming that you're using Elixir 1.8 which we do not support. Please downgrade to 1.7.4. I'll update the Docker Image to use the correct Elixir version.
Anything I can do for a quick fix?
@shisoft You're going to want to use the 1.7.3 version of bitwalker/alpine-elixir-phoenix. That should remove those compiling errors. The other work around is to use MIX_ENV=dev instead of MIX_ENV=prod.
Setting MIX_ENV=dev procedures another error.
** (Code.LoadError) could not load /opt/app/apps/block_scout_web/config/dev.secret.exs
(elixir) lib/code.ex:1147: Code.find_file/2
(elixir) lib/code.ex:706: Code.eval_file/2
(mix) lib/mix/config.ex:187: anonymous fn/2 in Mix.Config.__import__!/2
(elixir) lib/enum.ex:1940: Enum."-reduce/3-lists^foldl/2-0-"/3
(mix) lib/mix/config.ex:186: Mix.Config.__import__!/2
(stdlib) erl_eval.erl:680: :erl_eval.do_apply/6
(elixir) lib/code.ex:232: Code.eval_string/3
The command '/bin/sh -c mix compile' returned a non-zero code: 1
It seems like config file for dev is missing.
I will try the downgrade approach.
Changed to 1.7.3 got following error
Could not find Hex, which is needed to build dependency :distillery
Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn] ** (Mix) Could not find an SCM for dependency :distillery from BlockScout.Mixfile
But 1.7.1 works. I will leave this issue opened for @acravenho to close it once you have fixed the dockerfile. Thank you for the help.
On container startup on am getting another error, which I think is it build process related for it indicates missing static manifest.
WARNING: Published ports are discarded when using host network mode
2019-01-30T20:13:42.877 [warn] The on_load function for module libsecp256k1 returned:
{:error, {:load_failed, 'Failed to load NIF library: \'Error loading shared library /opt/app/_build/prod/lib/libsecp256k1/priv/libsecp256k1_nif.so: No such file or directory\''}}
2019-01-30T20:13:44.063 [warn] The on_load function for module libsecp256k1 returned:
{:error, {:load_failed, 'Failed to load NIF library: \'Error loading shared library /opt/app/_build/prod/lib/libsecp256k1/priv/libsecp256k1_nif.so: No such file or directory\''}}
2019-01-30T20:13:44.467 application=phoenix [info] Running BlockScoutWeb.Endpoint with cowboy 2.6.1 at http://localhost:4000
2019-01-30T20:13:44.468 application=phoenix [error] Could not find static manifest at "/opt/app/_build/prod/lib/block_scout_web/priv/static/cache_manifest.json". Run "mix phx.digest" after building your static files or remove the configuration from "config/prod.exs".
2019-01-30T20:13:44.623 [info] Application indexer exited: Indexer.Application.start(:normal, []) returned an error: shutdown: failed to start child: Indexer.Shrinkable.Supervisor
** (EXIT) shutdown: failed to start child: Indexer.Block.Supervisor
** (EXIT) shutdown: failed to start child: Indexer.Block.Realtime.Supervisor
** (EXIT) shutdown: failed to start child: EthereumJSONRPC.WebSocket.WebSocketClient
** (EXIT) an exception was raised:
** (FunctionClauseError) no function clause matching in EthereumJSONRPC.WebSocket.WebSocketClient.start_link/1
(ethereum_jsonrpc) lib/ethereum_jsonrpc/web_socket/web_socket_client.ex:53: EthereumJSONRPC.WebSocket.WebSocketClient.start_link([nil, [name: Indexer.Block.Realtime.WebSocket]])
(stdlib) supervisor.erl:379: :supervisor.do_start_child_i/3
(stdlib) supervisor.erl:365: :supervisor.do_start_child/2
(stdlib) supervisor.erl:349: anonymous fn/3 in :supervisor.start_children/2
(stdlib) supervisor.erl:1157: :supervisor.children_map/4
(stdlib) supervisor.erl:315: :supervisor.init_children/2
(stdlib) gen_server.erl:374: :gen_server.init_it/2
(stdlib) gen_server.erl:342: :gen_server.init_it/6
** (Mix) Could not start application indexer: Indexer.Application.start(:normal, []) returned an error: shutdown: failed to start child: Indexer.Shrinkable.Supervisor
** (EXIT) shutdown: failed to start child: Indexer.Block.Supervisor
** (EXIT) shutdown: failed to start child: Indexer.Block.Realtime.Supervisor
** (EXIT) shutdown: failed to start child: EthereumJSONRPC.WebSocket.WebSocketClient
** (EXIT) an exception was raised:
** (FunctionClauseError) no function clause matching in EthereumJSONRPC.WebSocket.WebSocketClient.start_link/1
(ethereum_jsonrpc) lib/ethereum_jsonrpc/web_socket/web_socket_client.ex:53: EthereumJSONRPC.WebSocket.WebSocketClient.start_link([nil, [name: Indexer.Block.Realtime.WebSocket]])
(stdlib) supervisor.erl:379: :supervisor.do_start_child_i/3
(stdlib) supervisor.erl:365: :supervisor.do_start_child/2
(stdlib) supervisor.erl:349: anonymous fn/3 in :supervisor.start_children/2
(stdlib) supervisor.erl:1157: :supervisor.children_map/4
(stdlib) supervisor.erl:315: :supervisor.init_children/2
(stdlib) gen_server.erl:374: :gen_server.init_it/2
(stdlib) gen_server.erl:342: :gen_server.init_it/6
Makefile:89: recipe for target 'start' failed
make: *** [start] Error 1
The application is unable to connect to your node. Please make sure WebSockets is enabled in your node configuration and you've defined it as an environment variable correctly.
Most helpful comment
Changed to 1.7.3 got following error
But 1.7.1 works. I will leave this issue opened for @acravenho to close it once you have fixed the dockerfile. Thank you for the help.