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

astarte_appengine_api fails to start if astarte_events is not declared yet by astarte_data_updater_plant #972

Open
shinnokdisengir opened this issue Jul 11, 2024 · 0 comments
Labels
app:appengine_api This issue or pull request is about astarte_appengine_api application app:data_updater_plant This issue or pull request is about astarte_data_updater_plant application bug Something isn't working

Comments

@shinnokdisengir
Copy link
Contributor

shinnokdisengir commented Jul 11, 2024

Description

The astarte_appengine_api crashes and ingress responds a Bad Gateway in some cases - it is not a systematic problem, but a corner case - caused by the astarte_events exchange present in the DUP (astarte_data_updater_plant) project.

Logs

2024-07-11 09:50:45 level=error ts=2024-07-11T07:50:45.930+00:00 msg="GenServer Astarte.AppEngine.API.Rooms.AMQPClient terminating
** (stop) exited in: :gen_server.call(#PID<0.1116.0>, {:call, {:\"queue.bind\", 0, \"astarte_rooms_events\", \"astarte_events\", \"astarte_rooms\", false, []}, :none, #PID<0.1104.0>}, 70000)
    ** (EXIT) shutdown: {:server_initiated_close, 404, \"NOT_FOUND - no exchange 'astarte_events' in vhost '/'\"}
    (stdlib 5.1) gen_server.erl:401: :gen_server.call/3
    (amqp 3.3.0) lib/amqp/queue.ex:101: AMQP.Queue.bind/4
    (astarte_appengine_api 1.2.0-dev) lib/astarte_appengine_api/rooms/amqp_client.ex:153: Astarte.AppEngine.API.Rooms.AMQPClient.setup_channel/1
    (astarte_appengine_api 1.2.0-dev) lib/astarte_appengine_api/rooms/amqp_client.ex:127: Astarte.AppEngine.API.Rooms.AMQPClient.connect/0
    (astarte_appengine_api 1.2.0-dev) lib/astarte_appengine_api/rooms/amqp_client.ex:94: Astarte.AppEngine.API.Rooms.AMQPClient.handle_info/2
    (stdlib 5.1) gen_server.erl:1077: :gen_server.try_handle_info/3
    (stdlib 5.1) gen_server.erl:1165: :gen_server.handle_msg/6
    (stdlib 5.1) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
Last message: :try_to_connect
State: :not_connected" module=gen_server function=error_info/8
2024-07-11 09:50:45 level=notice ts=2024-07-11T07:50:45.939+00:00 msg="Application astarte_appengine_api exited: shutdown" module=application_controller function=info_exited/3

Steps to Reproduce

  • Start the all astarte services.
  • Ensure the astarte_events exchange has not been declared in the DUP project.
  • Observe the Bad Gateway error in the logs.

Expected Behavior

The astarte_appengine_api should start without errors even if the astarte_events exchange is not pre-declared.

Actual Behavior

The astarte_appengine_api crashes, ingress cannot redirect incoming messages and responds with a Bad Gateway error.


Possible Solution

A possible solution would be declaring the astarte_events exchange also in AppEngine, should it be idempotent.

@shinnokdisengir shinnokdisengir added bug Something isn't working app:appengine_api This issue or pull request is about astarte_appengine_api application app:data_updater_plant This issue or pull request is about astarte_data_updater_plant application labels Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:appengine_api This issue or pull request is about astarte_appengine_api application app:data_updater_plant This issue or pull request is about astarte_data_updater_plant application bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant