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

Entire application crashes at startup if folder exists but UID isn't recognized #176

Closed
feld opened this issue Oct 31, 2022 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@feld
Copy link
Contributor

feld commented Oct 31, 2022

[warning] Recieved a 404 from Grafana because: %Finch.Response{body: "{\"message\":\"folder not found\",\"status\":\"not-found\"}", headers: [{"alt-svc", "h3=\":443\"; ma=2592000"}, {"cache-control", "no-cache"}, {"content-length", "51"}, {"content-type", "application/json"}, {"date", "Mon, 31 Oct 2022 19:18:52 GMT"}, {"expires", "-1"}, {"pragma", "no-cache"}, {"server", "Caddy"}, {"x-content-type-options", "nosniff"}, {"x-frame-options", "deny"}, {"x-xss-protection", "1; mode=block"}], status: 404}
[warning] Recieved a 409 from Grafana because: %Finch.Response{body: "{\"message\":\"a folder or dashboard in the general folder with the same name already exists\"}", headers: [{"alt-svc", "h3=\":443\"; ma=2592000"}, {"cache-control", "no-cache"}, {"content-length", "91"}, {"content-type", "application/json"}, {"date", "Mon, 31 Oct 2022 19:18:52 GMT"}, {"expires", "-1"}, {"pragma", "no-cache"}, {"server", "Caddy"}, {"x-content-type-options", "nosniff"}, {"x-frame-options", "deny"}, {"x-xss-protection", "1; mode=block"}], status: 409}
[error] GenServer Testapp.PromEx.DashboardUploader terminating
** (CaseClauseError) no case clause matching: {:error, :unknown}
    (prom_ex 1.7.1) lib/prom_ex/dashboard_uploader.ex:167: PromEx.DashboardUploader.create_folder/3
    (prom_ex 1.7.1) lib/prom_ex/dashboard_uploader.ex:148: PromEx.DashboardUploader.get_folder_id/3
    (prom_ex 1.7.1) lib/prom_ex/dashboard_uploader.ex:56: PromEx.DashboardUploader.handle_continue/2
    (stdlib 4.0.1) gen_server.erl:1120: :gen_server.try_dispatch/4
    (stdlib 4.0.1) gen_server.erl:862: :gen_server.loop/7
    (stdlib 4.0.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {:continue, :upload_grafana_dashboards}
State: %{default_dashboard_opts: [otp_app: :testapp], prom_ex_module: Testapp.PromEx}
@feld feld added the bug Something isn't working label Oct 31, 2022
@feld feld changed the title Entire application crashes at startup of folder exists but UID isn't recognized Entire application crashes at startup if folder exists but UID isn't recognized Oct 31, 2022
@akoutmos akoutmos closed this as completed Nov 1, 2022
@nichita-pasecinic
Copy link

nichita-pasecinic commented Nov 5, 2022

Hi @akoutmos, I do receive the same error on container start-up

Error Stack (docker)!
21:57:05.946 [warning] Recieved a 404 from Grafana because: %Finch.Response{status: 404, body: "{\"message\":\"folder not found\",\"status\":\"not-found\"}", headers: [{"cache-control", "no-cache"}, {"content-type", "application/json"}, {"expires", "-1"}, {"pragma", "no-cache"}, {"x-content-type-options", "nosniff"}, {"x-frame-options", "deny"}, {"x-xss-protection", "1; mode=block"}, {"date", "Sat, 05 Nov 2022 21:57:05 GMT"}, {"content-length", "51"}]}

21:57:05.960 [info] PromEx.LifecycleAnnotator successfully created start annotation in Grafana.

21:57:05.987 [info] PromEx.LifecycleAnnotator successfully created stop annotation in Grafana.

21:57:05.989 [notice] Application acai exited: Acai.Application.start(:normal, []) returned an error: shutdown: failed to start child: AcaiWeb.Endpoint

    ** (EXIT) shutdown: failed to start child: {:ranch_listener_sup, AcaiWeb.Endpoint.HTTP}

        ** (EXIT) an exception was raised:

            ** (ArgumentError) errors were found at the given arguments:


  * 2nd argument: not a key that exists in the table


                (stdlib 4.1.1) :ets.lookup_element(:ranch_server, {:addr, AcaiWeb.Endpoint.HTTP}, 2)

                (ranch 1.8.0) /app/deps/ranch/src/ranch_server.erl:113: :ranch_server.get_addr/1

                (phoenix 1.6.15) lib/phoenix/endpoint/cowboy2_adapter.ex:119: Phoenix.Endpoint.Cowboy2Adapter.bound_address/2

                (phoenix 1.6.15) lib/phoenix/endpoint/cowboy2_adapter.ex:115: Phoenix.Endpoint.Cowboy2Adapter.info/3

                (phoenix 1.6.15) lib/phoenix/endpoint/cowboy2_adapter.ex:101: Phoenix.Endpoint.Cowboy2Adapter.start_link/3

                (stdlib 4.1.1) supervisor.erl:414: :supervisor.do_start_child_i/3

                (stdlib 4.1.1) supervisor.erl:400: :supervisor.do_start_child/2

                (stdlib 4.1.1) supervisor.erl:384: anonymous fn/3 in :supervisor.start_children/2

{"Kernel pid terminated",application_controller,"{application_start_failure,acai,{{shutdown,{failed_to_start_child,'Elixir.AcaiWeb.Endpoint',{shutdown,{failed_to_start_child,{ranch_listener_sup,'Elixir.AcaiWeb.Endpoint.HTTP'},{'EXIT',{badarg,[{ets,lookup_element,[ranch_server,{addr,'Elixir.AcaiWeb.Endpoint.HTTP'},2],[{error_info,#{cause => badkey,module => erl_stdlib_errors}}]},{ranch_server,get_addr,1,[{file,\"/app/deps/ranch/src/ranch_server.erl\"},{line,113}]},{'Elixir.Phoenix.Endpoint.Cowboy2Adapter',bound_address,2,[{file,\"lib/phoenix/endpoint/cowboy2_adapter.ex\"},{line,119}]},{'Elixir.Phoenix.Endpoint.Cowboy2Adapter',info,3,[{file,\"lib/phoenix/endpoint/cowboy2_adapter.ex\"},{line,115}]},{'Elixir.Phoenix.Endpoint.Cowboy2Adapter',start_link,3,[{file,\"lib/phoenix/endpoint/cowboy2_adapter.ex\"},{line,101}]},{supervisor,do_start_child_i,3,[{file,\"supervisor.erl\"},{line,414}]},{supervisor,do_start_child,2,[{file,\"supervisor.erl\"},{line,400}]},{supervisor,'-start_children/2-fun-0-',3,[{file,\"supervisor.erl\"},{line,384}]}]}}}}}},{'Elixir.Acai.Application',start,[normal,[]]}}}"}

[Acai] Inside entrypoint.sh script

21:58:01.792 [info] PromEx is starting a standalone metrics server on port 4000 over http

21:58:01.908 [error] Failed to start Ranch listener AcaiWeb.Endpoint.HTTP in :ranch_tcp:listen([cacerts: :..., key: :..., cert: :..., ip: {0, 0, 0, 0, 0, 0, 0, 0}, port: 4000]) for reason :eaddrinuse (address already in use)


21:58:01.928 [warning] Recieved a 404 from Grafana because: %Finch.Response{status: 404, body: "{\"message\":\"folder not found\",\"status\":\"not-found\"}", headers: [{"cache-control", "no-cache"}, {"content-type", "application/json"}, {"expires", "-1"}, {"pragma", "no-cache"}, {"x-content-type-options", "nosniff"}, {"x-frame-options", "deny"}, {"x-xss-protection", "1; mode=block"}, {"date", "Sat, 05 Nov 2022 21:58:01 GMT"}, {"content-length", "51"}]}

21:58:01.933 [info] PromEx.LifecycleAnnotator successfully created start annotation in Grafana.

21:58:01.972 [info] PromEx.LifecycleAnnotator successfully created stop annotation in Grafana.

21:58:01.974 [notice] Application acai exited: Acai.Application.start(:normal, []) returned an error: shutdown: failed to start child: AcaiWeb.Endpoint

    ** (EXIT) shutdown: failed to start child: {:ranch_listener_sup, AcaiWeb.Endpoint.HTTP}

        ** (EXIT) an exception was raised:

            ** (ArgumentError) errors were found at the given arguments:


  * 2nd argument: not a key that exists in the table


                (stdlib 4.1.1) :ets.lookup_element(:ranch_server, {:addr, AcaiWeb.Endpoint.HTTP}, 2)

                (ranch 1.8.0) /app/deps/ranch/src/ranch_server.erl:113: :ranch_server.get_addr/1

                (phoenix 1.6.15) lib/phoenix/endpoint/cowboy2_adapter.ex:119: Phoenix.Endpoint.Cowboy2Adapter.bound_address/2

                (phoenix 1.6.15) lib/phoenix/endpoint/cowboy2_adapter.ex:115: Phoenix.Endpoint.Cowboy2Adapter.info/3

                (phoenix 1.6.15) lib/phoenix/endpoint/cowboy2_adapter.ex:101: Phoenix.Endpoint.Cowboy2Adapter.start_link/3

                (stdlib 4.1.1) supervisor.erl:414: :supervisor.do_start_child_i/3

                (stdlib 4.1.1) supervisor.erl:400: :supervisor.do_start_child/2

                (stdlib 4.1.1) supervisor.erl:384: anonymous fn/3 in :supervisor.start_children/2

[Acai] Inside entrypoint.sh script

21:58:09.847 [info] PromEx is starting a standalone metrics server on port 4000 over http

21:58:09.961 [error] Failed to start Ranch listener AcaiWeb.Endpoint.HTTP in :ranch_tcp:listen([cacerts: :..., key: :..., cert: :..., ip: {0, 0, 0, 0, 0, 0, 0, 0}, port: 4000]) for reason :eaddrinuse (address already in use)


21:58:09.986 [info] PromEx.LifecycleAnnotator successfully created start annotation in Grafana.

21:58:09.992 [warning] Recieved a 404 from Grafana because: %Finch.Response{status: 404, body: "{\"message\":\"folder not found\",\"status\":\"not-found\"}", headers: [{"cache-control", "no-cache"}, {"content-type", "application/json"}, {"expires", "-1"}, {"pragma", "no-cache"}, {"x-content-type-options", "nosniff"}, {"x-frame-options", "deny"}, {"x-xss-protection", "1; mode=block"}, {"date", "Sat, 05 Nov 2022 21:58:09 GMT"}, {"content-length", "51"}]}

21:58:10.006 [info] PromEx.LifecycleAnnotator successfully created stop annotation in Grafana.

21:58:10.008 [notice] Application acai exited: Acai.Application.start(:normal, []) returned an error: shutdown: failed to start child: AcaiWeb.Endpoint

    ** (EXIT) shutdown: failed to start child: {:ranch_listener_sup, AcaiWeb.Endpoint.HTTP}

        ** (EXIT) an exception was raised:

            ** (ArgumentError) errors were found at the given arguments:


  * 2nd argument: not a key that exists in the table


                (stdlib 4.1.1) :ets.lookup_element(:ranch_server, {:addr, AcaiWeb.Endpoint.HTTP}, 2)

                (ranch 1.8.0) /app/deps/ranch/src/ranch_server.erl:113: :ranch_server.get_addr/1

                (phoenix 1.6.15) lib/phoenix/endpoint/cowboy2_adapter.ex:119: Phoenix.Endpoint.Cowboy2Adapter.bound_address/2

                (phoenix 1.6.15) lib/phoenix/endpoint/cowboy2_adapter.ex:115: Phoenix.Endpoint.Cowboy2Adapter.info/3

                (phoenix 1.6.15) lib/phoenix/endpoint/cowboy2_adapter.ex:101: Phoenix.Endpoint.Cowboy2Adapter.start_link/3

                (stdlib 4.1.1) supervisor.erl:414: :supervisor.do_start_child_i/3

                (stdlib 4.1.1) supervisor.erl:400: :supervisor.do_start_child/2

                (stdlib 4.1.1) supervisor.erl:384: anonymous fn/3 in :supervisor.start_children/2

{"Kernel pid terminated",application_controller,"{application_start_failure,acai,{{shutdown,{failed_to_start_child,'Elixir.AcaiWeb.Endpoint',{shutdown,{failed_to_start_child,{ranch_listener_sup,'Elixir.AcaiWeb.Endpoint.HTTP'},{'EXIT',{badarg,[{ets,lookup_element,[ranch_server,{addr,'Elixir.AcaiWeb.Endpoint.HTTP'},2],[{error_info,#{cause => badkey,module => erl_stdlib_errors}}]},{ranch_server,get_addr,1,[{file,\"/app/deps/ranch/src/ranch_server.erl\"},{line,113}]},{'Elixir.Phoenix.Endpoint.Cowboy2Adapter',bound_address,2,[{file,\"lib/phoenix/endpoint/cowboy2_adapter.ex\"},{line,119}]},{'Elixir.Phoenix.Endpoint.Cowboy2Adapter',info,3,[{file,\"lib/phoenix/endpoint/cowboy2_adapter.ex\"},{line,115}]},{'Elixir.Phoenix.Endpoint.Cowboy2Adapter',start_link,3,[{file,\"lib/phoenix/endpoint/cowboy2_adapter.ex\"},{line,101}]},{supervisor,do_start_child_i,3,[{file,\"supervisor.erl\"},{line,414}]},{supervisor,do_start_child,2,[{file,\"supervisor.erl\"},{line,400}]},{supervisor,'-start_children/2-fun-0-',3,[{file,\"supervisor.erl\"},{line,384}]}]}}}}}},{'Elixir.Acai.Application',start,[normal,[]]}}}"}

Kernel pid terminated (application_controller) ({application_start_failure,acai,{{shutdown,{failed_to_start_child,'Elixir.AcaiWeb.Endpoint',{shutdown,{failed_to_start_child,{ranch_listener_sup,'Elixir.AcaiWeb.Endpoint.HTTP'},{'EXIT',{badarg,[{ets,lookup_element,[ranch_server,{addr,'Elixir.AcaiWeb.Endpoint.HTTP'},2],[{error_info,#{cause => badkey,module => erl_stdlib_errors}}]},{ranch_server,get_addr,1,[{file,"/app/deps/ranch/src/ranch_server.erl"},{line,113}]},{'Elixir.Phoenix.Endpoint.Cowboy2Adapter',bound_address,2,[{file,"lib/phoenix/endpoint/cowboy2_adapter.ex"},{line,119}]},{'Elixir.Phoenix.Endpoint.Cowboy2Adapter',info,3,[{file,"lib/phoenix/endpoint/cowboy2_adapter.ex"},{line,115}]},{'Elixir.Phoenix.Endpoint.Cowboy2Adapter',start_link,3,[{file,"lib/phoenix/endpoint/cowboy2_adapter.ex"},{line,101}]},{supervisor,do_start_child_i,3,[{file,"supervisor.erl"},{line,414}]},{supervisor,do_start_child,2,[{file,"supervisor.erl"},{line,400}]},{supervisor,'-start_children/2-fun-0-',3,[{file,"supervisor.erl"},{line


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

Later Edit: never mind, it was my issue with metrics_server being on the same port as phoenix server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants