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

Cannot start FCM adapter when build for Production #247

Open
hNhat195 opened this issue Sep 27, 2023 · 1 comment
Open

Cannot start FCM adapter when build for Production #247

hNhat195 opened this issue Sep 27, 2023 · 1 comment

Comments

@hNhat195
Copy link

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

@frozencap
Copy link

frozencap commented Oct 12, 2023

getting similar issue for APNS

Kernel pid terminated (application_controller) ({application_start_failure,myapp,{{shutdown,
{failed_to_start_child,'Elixir.MyApp.ExternalServices.APNS',{shutdown,{failed_to_start_child,4,{shutdown,
{'Elixir.GenServer',call,[kadabra,{start_child,#{id => #Ref<0.3758452972.159121434.901>,restart => transient,start => 
{'Elixir.Kadabra.ConnectionPool',start_link,[#{'__struct__' => 'Elixir.URI',authority => 
<<"api.push.apple.com">>,fragment => nil,host => <<"api.push.apple.com">>,path => nil,port => 443,query => 
nil,scheme => <<"https">>,userinfo => nil},<0.2980.0>,[{ssl,[{cert.......

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