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

MongoosePush crashes at startup #193

Closed
theanhoo opened this issue Jul 21, 2020 · 2 comments
Closed

MongoosePush crashes at startup #193

theanhoo opened this issue Jul 21, 2020 · 2 comments

Comments

@theanhoo
Copy link

theanhoo commented Jul 21, 2020

MongoosePush 2.1.0, local build

There was no error running mongooseim/mongoose-push:latest but the Docker image I built crashes at startup. Both were started using the same parameters.

Update: Are the token.p8 files mandatory?

Please advise.

Thank you.

Build

docker build . -t mpush:latest

Start

  docker run -v /opt/MongoosePush/priv:/opt/app/priv \
    --name MONGOOSEPUSH \
    -v /etc/localtime:/etc/localtime \
    -v /etc/timezone:/etc/timezone \
    -p 8443:8443 \
    -e PUSH_FCM_APP_KEY=$FCM_APP_KEY \
    -e PUSH_HTTPS_CERTFILE="/opt/app/priv/ssl/self_signed_cert.pem" \
    -e PUSH_HTTPS_KEYFILE="/opt/app/priv/ssl/self_signed_key.pem" \
    -e PUSH_FCM_ENABLED=true \
    -e PUSH_APNS_DEV_USE_2197=false \
    -e PUSH_APNS_DEV_CERT="priv/apns/development_cert.pem" \
    -e PUSH_APNS_DEV_KEY="priv/apns/development_key.pem" \
    -e PUSH_APNS_DEV_POOL_SIZE=5 \
    -e PUSH_APNS_ENABLED=true \
    -e PUSH_LOGLEVEL=debug \
    -it --rm mpush:latest

Error log

when=2020-07-21T19:31:57.304 severity=info what=init text="Starting PoolsWarden" at=Elixir.Sparrow.PoolsWarden.init/1:95 pid=#PID<0.1802.0> result=success worker=pools_warden file=lib/sparrow/pools_warden.ex application=sparrow
{"application":"mongoose_push","at":"Elixir.MongoosePush.Application.check_runtime_configuration_status/0:188","file":"lib/mongoose_push/application.ex","path":"var/config.toml","pid":"#PID<0.1856.0>","reason":"enoent","severity":"info","status":"skipped","text":"Skipping TOML configuration due to file not present","what":"toml_configuration","when":"2020-07-21T19:31:57.335"}
{"application":"mongoose_push","at":"Elixir.MongoosePush.Service.APNS.Supervisor.convert_token_pool_to_sparrow/2:150","file":"lib/mongoose_push/service/apns/supervisor.ex","mode":"dev","p8_file":"/opt/app/lib/mongoose_push-2.1.0/priv/apns/token.p8","pid":"#PID<0.1860.0>","reason":"bad_auth","result":"error","severity":"error","text":"Required configuration missing","what":"configuration","when":"2020-07-21T19:31:57.341"}
{"application":"mongoose_push","at":"Elixir.MongoosePush.Service.APNS.Supervisor.convert_token_pool_to_sparrow/2:150","file":"lib/mongoose_push/service/apns/supervisor.ex","mode":"prod","p8_file":"/opt/app/lib/mongoose_push-2.1.0/priv/apns/token.p8","pid":"#PID<0.1860.0>","reason":"bad_auth","result":"error","severity":"error","text":"Required configuration missing","what":"configuration","when":"2020-07-21T19:31:57.341"}
{"at":"application_controller.info_exited/3:1938","file":"application_controller.erl","pid":"#PID<0.1641.0>","severity":"info","text":"Application mongoose_push exited: MongoosePush.Application.start(:normal, []) returned an error: shutdown: failed to start child: :apns_supervisor\n    ** (EXIT) MongoosePush.Service.APNS.Supervisor.init/1 returned a bad value: {:stop, :bad_auth}","what":"","when":"2020-07-21T19:31:57.349"}
=SUPERVISOR REPORT==== 21-Jul-2020::19:31:57.404208 ===
    supervisor: {local,gr_counter_sup}
    errorContext: child_terminated
    reason: killed
    offender: [{pid,<0.1723.0>},
               {id,gr_lager_default_tracer_counters},
               {mfargs,{gr_counter,start_link,
                                   [gr_lager_default_tracer_counters]}},
               {restart_type,transient},
               {shutdown,brutal_kill},
               {child_type,worker}]
=SUPERVISOR REPORT==== 21-Jul-2020::19:31:57.405043 ===
    supervisor: {local,gr_param_sup}
    errorContext: child_terminated
    reason: killed
    offender: [{pid,<0.1722.0>},
               {id,gr_lager_default_tracer_params},
               {mfargs,{gr_param,start_link,[gr_lager_default_tracer_params]}},
               {restart_type,transient},
               {shutdown,brutal_kill},
               {child_type,worker}]
{"Kernel pid terminated",application_controller,"{application_start_failure,mongoose_push,{{shutdown,{failed_to_start_child,apns_supervisor,{bad_return,{'Elixir.MongoosePush.Service.APNS.Supervisor',init,{stop,bad_auth}}}}},{'Elixir.MongoosePush.Application',start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,mongoose_push,{{shutdown,{failed_to_start_child,apns_supervisor,{bad_return,{'Elixir.MongoosePush.Service.APNS.Supervisor',in

Crash dump is being written to: erl_crash.dump...done

Build warnings

warning: function Poison.EncodeError.exception/1 is undefined (module Poison.EncodeError is not available)
  lib/jose/poison/lexical_encoder.ex:8

warning: String.strip/1 is deprecated. Use String.trim/1 instead
  /opt/app/deps/poison/mix.exs:4

warning: Integer.to_char_list/2 is deprecated. Use Integer.to_charlist/2 instead
  lib/poison/encoder.ex:173

warning: function Mix.Releases.Release.get/1 is undefined (module Mix.Releases.Release is not available)
  lib/mix_docker.ex:193

warning: function :"APNS-Topics".decode/2 is undefined (module :"APNS-Topics" is not available)
  lib/mongoose_push/service/apns/certificate.ex:45

@theanhoo
Copy link
Author

Turns out it's missing the token.json file required for FCM.

@ironman512
Copy link

MongoosePush 2.1.0, local build

There was no error running mongooseim/mongoose-push:latest but the Docker image I built crashes at startup. Both were started using the same parameters.

Update: Are the token.p8 files mandatory?

Please advise.

Thank you.

Build

docker build . -t mpush:latest

Start

  docker run -v /opt/MongoosePush/priv:/opt/app/priv \
    --name MONGOOSEPUSH \
    -v /etc/localtime:/etc/localtime \
    -v /etc/timezone:/etc/timezone \
    -p 8443:8443 \
    -e PUSH_FCM_APP_KEY=$FCM_APP_KEY \
    -e PUSH_HTTPS_CERTFILE="/opt/app/priv/ssl/self_signed_cert.pem" \
    -e PUSH_HTTPS_KEYFILE="/opt/app/priv/ssl/self_signed_key.pem" \
    -e PUSH_FCM_ENABLED=true \
    -e PUSH_APNS_DEV_USE_2197=false \
    -e PUSH_APNS_DEV_CERT="priv/apns/development_cert.pem" \
    -e PUSH_APNS_DEV_KEY="priv/apns/development_key.pem" \
    -e PUSH_APNS_DEV_POOL_SIZE=5 \
    -e PUSH_APNS_ENABLED=true \
    -e PUSH_LOGLEVEL=debug \
    -it --rm mpush:latest

Error log

when=2020-07-21T19:31:57.304 severity=info what=init text="Starting PoolsWarden" at=Elixir.Sparrow.PoolsWarden.init/1:95 pid=#PID<0.1802.0> result=success worker=pools_warden file=lib/sparrow/pools_warden.ex application=sparrow
{"application":"mongoose_push","at":"Elixir.MongoosePush.Application.check_runtime_configuration_status/0:188","file":"lib/mongoose_push/application.ex","path":"var/config.toml","pid":"#PID<0.1856.0>","reason":"enoent","severity":"info","status":"skipped","text":"Skipping TOML configuration due to file not present","what":"toml_configuration","when":"2020-07-21T19:31:57.335"}
{"application":"mongoose_push","at":"Elixir.MongoosePush.Service.APNS.Supervisor.convert_token_pool_to_sparrow/2:150","file":"lib/mongoose_push/service/apns/supervisor.ex","mode":"dev","p8_file":"/opt/app/lib/mongoose_push-2.1.0/priv/apns/token.p8","pid":"#PID<0.1860.0>","reason":"bad_auth","result":"error","severity":"error","text":"Required configuration missing","what":"configuration","when":"2020-07-21T19:31:57.341"}
{"application":"mongoose_push","at":"Elixir.MongoosePush.Service.APNS.Supervisor.convert_token_pool_to_sparrow/2:150","file":"lib/mongoose_push/service/apns/supervisor.ex","mode":"prod","p8_file":"/opt/app/lib/mongoose_push-2.1.0/priv/apns/token.p8","pid":"#PID<0.1860.0>","reason":"bad_auth","result":"error","severity":"error","text":"Required configuration missing","what":"configuration","when":"2020-07-21T19:31:57.341"}
{"at":"application_controller.info_exited/3:1938","file":"application_controller.erl","pid":"#PID<0.1641.0>","severity":"info","text":"Application mongoose_push exited: MongoosePush.Application.start(:normal, []) returned an error: shutdown: failed to start child: :apns_supervisor\n    ** (EXIT) MongoosePush.Service.APNS.Supervisor.init/1 returned a bad value: {:stop, :bad_auth}","what":"","when":"2020-07-21T19:31:57.349"}
=SUPERVISOR REPORT==== 21-Jul-2020::19:31:57.404208 ===
    supervisor: {local,gr_counter_sup}
    errorContext: child_terminated
    reason: killed
    offender: [{pid,<0.1723.0>},
               {id,gr_lager_default_tracer_counters},
               {mfargs,{gr_counter,start_link,
                                   [gr_lager_default_tracer_counters]}},
               {restart_type,transient},
               {shutdown,brutal_kill},
               {child_type,worker}]
=SUPERVISOR REPORT==== 21-Jul-2020::19:31:57.405043 ===
    supervisor: {local,gr_param_sup}
    errorContext: child_terminated
    reason: killed
    offender: [{pid,<0.1722.0>},
               {id,gr_lager_default_tracer_params},
               {mfargs,{gr_param,start_link,[gr_lager_default_tracer_params]}},
               {restart_type,transient},
               {shutdown,brutal_kill},
               {child_type,worker}]
{"Kernel pid terminated",application_controller,"{application_start_failure,mongoose_push,{{shutdown,{failed_to_start_child,apns_supervisor,{bad_return,{'Elixir.MongoosePush.Service.APNS.Supervisor',init,{stop,bad_auth}}}}},{'Elixir.MongoosePush.Application',start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,mongoose_push,{{shutdown,{failed_to_start_child,apns_supervisor,{bad_return,{'Elixir.MongoosePush.Service.APNS.Supervisor',in

Crash dump is being written to: erl_crash.dump...done

Build warnings

warning: function Poison.EncodeError.exception/1 is undefined (module Poison.EncodeError is not available)
  lib/jose/poison/lexical_encoder.ex:8

warning: String.strip/1 is deprecated. Use String.trim/1 instead
  /opt/app/deps/poison/mix.exs:4

warning: Integer.to_char_list/2 is deprecated. Use Integer.to_charlist/2 instead
  lib/poison/encoder.ex:173

warning: function Mix.Releases.Release.get/1 is undefined (module Mix.Releases.Release is not available)
  lib/mix_docker.ex:193

warning: function :"APNS-Topics".decode/2 is undefined (module :"APNS-Topics" is not available)
  lib/mongoose_push/service/apns/certificate.ex:45

Hey your docker build has done successfully? Kidnly help me my docker container have some build errors

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