Error when trying to send multicast message

Trying to enqueue a multicast message I call the REST API:

POST http://localhost:8090/api/multcast-groups/{my-multicast-group-id-here}/queue

I receive response code 500

{
“code”: 13,
“message”: “insert or update on table "multicast_group_queue_item" violates foreign key constraint "multicast_group_queue_item_gateway_id_fkey"”,
“details”: []
}

I’m guessing this might be somehow related to my setup having two gateways when I created my first multicast group. Then deleted one of the two gateways. Having this error on the multicast group enqueue from there on. Tried deleting the multicast group that existed before I deleted one of two gateways. Then created a new group. Same error.

This worked OK before deleting one of the two gateways from my setup.

Any hints on how to clear this up? I’ve tried restarting (docker installation running on Windows 11). I’d hate to have to reinstall and start over.

My postgres log shows:

2023-02-26 19:18:40 2023-02-26 19:18:40.256 UTC [190] DETAIL: Key (gateway_id)=(\xd3ff1144442a3689) is not present in table “gateway”.
2023-02-26 19:18:40 2023-02-26 19:18:40.256 UTC [190] STATEMENT: INSERT INTO “multicast_group_queue_item” (“id”, “created_at”, “scheduler_run_after”, “multicast_group_id”, “gateway_id”, “f_cnt”, “f_port”, “data”, “emit_at_time_since_gps_epoch”) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, DEFAULT) RETURNING “multicast_group_queue_item”.“id”, “multicast_group_queue_item”.“created_at”, “multicast_group_queue_item”.“scheduler_run_after”, “multicast_group_queue_item”.“multicast_group_id”, “multicast_group_queue_item”.“gateway_id”, “multicast_group_queue_item”.“f_cnt”, “multicast_group_queue_item”.“f_port”, “multicast_group_queue_item”.“data”, “multicast_group_queue_item”.“emit_at_time_since_gps_epoch”

For anyone running into similar issue, I’d like to share that I’ve figured out what’s going on. I had two devices registered for the multicast group. One had not sent an uplink message since before I deleted one of my two gateways. And that message had been received via the now deleted gateway. And since the system apparently will try to deliver multicast messages via the gateway where the device was last seen (which makes total sense), ChirpStack wanted to send my multicast message via a non-existing gateway. Therefore, the send-error was occurring.

As soon as I manually removed the device that had earlier been seen at the deleted gateway from the multicast group, all works well and multicast messages are accepted and delivered by ChirpStack.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.