Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error starting service locally #280

Open
amitcomo opened this issue May 31, 2018 · 5 comments
Open

Error starting service locally #280

amitcomo opened this issue May 31, 2018 · 5 comments

Comments

@amitcomo
Copy link

amitcomo commented May 31, 2018

When trying to work with the annon.api locally i get the following error:

{"timestamp":"2018-05-30T18:38:18.078Z","sourceLocation":{"line":null,"function":null,"file":null},"severity":"INFO","resource":null,"jsonPayload":{"metadata":{"error_logger":"std_info"},"message":"Application annon_api exited: Annon.start(:normal, []) returned an error: shutdown: failed to start child: Annon.AutoClustering\n ** (EXIT) an exception was raised:\n ** (ArgumentError) argument error\n (annon_api) Elixir.Annon.AutoClustering.erl:57: anonymous fn/4 in Annon.AutoClustering.do_reload_config/0\n (annon_api) Elixir.Annon.AutoClustering.erl:34: Annon.AutoClustering.init/1"}}
** (EXIT from #PID<0.73.0>) an exception was raised:
** (Mix.Error) Could not start application annon_api: Annon.start(:normal, []) returned an error: shutdown: failed to start child: Annon.AutoClustering
** (EXIT) an exception was raised:
** (ArgumentError) argument error
(annon_api) Elixir.Annon.AutoClustering.erl:57: anonymous fn/4 in Annon.AutoClustering.do_reload_config/0
(annon_api) Elixir.Annon.AutoClustering.erl:34: Annon.AutoClustering.init/1
(mix) lib/mix.ex:291: Mix.raise/1
(elixir) lib/enum.ex:737: Enum."-each/2-lists^foreach/1-0-"/2
(elixir) lib/enum.ex:737: Enum.each/2
(mix) lib/mix/tasks/app.start.ex:114: Mix.Tasks.App.Start.start/2
(mix) lib/mix/tasks/app.start.ex:86: Mix.Tasks.App.Start.run/1
(mix) lib/mix/task.ex:314: Mix.Task.run_task/3
(mix) lib/mix/tasks/run.ex:119: Mix.Tasks.Run.run/5
(mix) lib/mix/tasks/run.ex:76: Mix.Tasks.Run.run/1

{"timestamp":"2018-05-30T18:38:18.085Z","sourceLocation":{"line":null,"function":null,"file":null},"severity":"ERROR","resource":null,"jsonPayload":{"metadata":{"error_logger":"format"},"message":"Process #PID<0.1072.0> raised an exception\n** (Mix.Error) Could not start application annon_api: Annon.start(:normal, []) returned an error: shutdown: failed to start child: Annon.AutoClustering\n ** (EXIT) an exception was raised:\n ** (ArgumentError) argument error\n (annon_api) Elixir.Annon.AutoClustering.erl:57: anonymous fn/4 in Annon.AutoClustering.do_reload_config/0\n (annon_api) Elixir.Annon.AutoClustering.erl:34: Annon.AutoClustering.init/1\n (mix) lib/mix.ex:291: Mix.raise/1\n (elixir) lib/enum.ex:737: Enum."-each/2-lists^foreach/1-0-"/2\n (elixir) lib/enum.ex:737: Enum.each/2\n (mix) lib/mix/tasks/app.start.ex:114: Mix.Tasks.App.Start.start/2\n (mix) lib/mix/tasks/app.start.ex:86: Mix.Tasks.App.Start.run/1\n (mix) lib/mix/task.ex:314: Mix.Task.run_task/3\n (mix) lib/mix/tasks/run.ex:119: Mix.Tasks.Run.run/5\n (mix) lib/mix/tasks/run.ex:76: Mix.Tasks.Run.run/1"}}

Environment info:

  1. Erlang/OTP 20 [erts-9.3.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
    Elixir 1.6.5 (compiled with OTP 20)
  2. postgres - docker 'nebo15/alpine-postgre:9.6.2'
  3. annon-web - docker 'nebo15/annon.web'
  4. i use the .env file that in the project (after modifying the postgres parameters)
  5. MacOS 10.13.4
    Thanks
@AndrewDryga
Copy link
Member

Hello @amitcomo. Can you show the exact Bash command which you used to start the containers? Also, did you override any options in .env regarding nodes discovery?

Looks like it crashed because the distribution layer failed to start (the one which is responsible configuration invalidation/synchronization if you have more than one instance deployed).

@amitcomo
Copy link
Author

amitcomo commented Jun 4, 2018

  1. I use the following docker-compose.yml to start the app & db containers:

version: '2'
services:
app:
image: "nebo15/annon.web"
links:
- "api:api"
depends_on:
- api
environment:
- MANAGEMENT_ENDPOINT=http://api:4001
- PUBLIC_ENDPOINT=http://api:4000
ports:
- "8080:8080"
postgres:
image: "nebo15/alpine-postgre:9.6.2"
ports:
- "5432"
environment:
- POSTGRES_DB=annon
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
# volumes:
# - '.postgres:/var/lib/postgresql/data'

  1. I use intellij plugin to start the api service (the plugin - https://github.com/KronicDeth/intellij-elixir)
  2. nodes discovery - no change here. I used the .env file with DB host & port change.

Appreciate your help

@AndrewDryga
Copy link
Member

AndrewDryga commented Jun 6, 2018

@amitcomo can you try running Annon with script from annon.infra?

I believe that it crashes because, by default, Annon uses Kubernetes for its auto-clustering. If you start the code with IDE plugin, it would start it in dev mode, won't override any defaults and fail. You should either pass environment variables to use different clustering strategy (SKYCLUSTER_STRATEGY=Cluster.Strategy.Epmd) or edit config.ex and replace the default value there with Cluster.Strategy.Epmd.

@amitcomo
Copy link
Author

amitcomo commented Jun 6, 2018

Thanks Andrew.
I use SKYCLUSTER_STRATEGY=Cluster.Strategy.Epmd (verified it)

@AndrewDryga
Copy link
Member

I'll leave this issue open to reconsider defaults later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants