Skip to content

Cannot start FCM adapter when build for Production #247

Closed

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

Activity

  1. ice-cap0 commented on Oct 12, 2023

    @ice-cap0

    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.......
    
  2. hpopp commented on Sep 9, 2026

    @hpopp
    Member

    Network issues were probably crashing the workers on boot. Fixed in v2.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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