Skip to content

Cannot start FCM adapter when build for Production #247

@hNhat195

Description

@hNhat195

Environment

  • Elixir & Erlang/OTP versions (elixir --version): 1.15.5
  • Operating system: linux
  • Pigeon version: 2.0.0-rc.1

Current behavior

I have problem when build my project in production, that here: Kernel pid terminated (application_controller) ({application_start_failure,k_gates,{{shutdown,{failed_to_start_child,'Elixir.KGates.FCM',{shutdown,{failed_to_start_child,1,{{case_clause,{stop,{{{badmatch,{error,{{badmatch,{error,{bad_return_value,{error,etimedout}}}},[{'Elixir.Kadabra.Connection',init,1,[{file,"lib/connection.ex"},{line,44}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,848}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,811}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]}}},[{'Elixir.Kadabra.ConnectionPool',init,1,[{file,"lib/connection_pool.ex"},{line,59}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,848}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,811}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]},{child,undefined,#Ref<0.2086631506.426246145.164154>,{'Elixir.Kadabra.ConnectionPool',start_link,[#{'__struct__' => 'Elixir.URI',authority => <<"fcm.googleapis.com">>,fragment => nil,host => <<"fcm.googleapis.com">>...
When I run on my local machine, it all works well. Can you explain to me what problem I have when I build, that is my setup for FCM in config.exs:

config :k_gates, KGates.FCM,
  adapter: Pigeon.FCM,
  project_id: System.get_env("FCM_APP_NAME", ""),
  service_account_json: File.read!(Path.join(File.cwd!(), "/service-account.json"))

and I added it in application.ex, besides setup

defmodule KGates.FCM do
  use Pigeon.Dispatcher, otp_app: :k_gates
end

Expected behavior

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions