brocaar / chirpstack-network-server

ChirpStack Network Server is an open-source LoRaWAN network-server.
https://www.chirpstack.io
MIT License
1.49k stars 546 forks source link

Multicast Downlink Enqueue not working while 2 NS configured in AS #490

Open sagar-patel-sls opened 4 years ago

sagar-patel-sls commented 4 years ago

What happened?

Setup: I have installed 2 Network Server on IN865 and 1 AS

  1. NS1 is on Default Configuration
  2. NS2 all the configuration is the same as NS1 but change only RX2DR=5

we have added 1 GW in NS1, and CLASS C device added in NS2.

We have created a Multicast group of 1 device and which is added in NS2 (Multicast group is successfully created)

Now we are trying to send Downlink using Multicast Queue using AS Swagger API, but API returns an error POST /api/multicast-groups/{multicast_queue_item.multicast_group_id}/queue

I have debugged the NS source and found the issue in DB Schema of NS (Foreign key issue) while Creating a Multicast_Queue item because Gateway Not found in NS2 (GW registered in NS1)

Foreign Key Name: multicast_queue_gateway_id_fkey Parent: multicast_queue.gateway_id Child: gateway.gateway_id

What did you expect?

Can we remove foreign_key between the multicast_queue and gateway table of the NS database?

Could you share your log output?

API Response

enqueue multicast-group queue-item error: enqueue multicast-queue item error: rpc error: code = NotFound desc = object does not exist (code: 13)

Your Environment

Component Version
Application Server v3.10.0
Network Server (NS1 & NS2) v3.9.0
Gateway Bridge v3.8.0
LA-STM commented 4 years ago

Hi !

I have exactly the same error as you when I try to enqueue payload for multicast downlink, but I only have one Network Server.

My environment is the same as your's with the same version of the components.

Also, my gateway status is tag as Never Seen in the AS view, but I can send and receive data from my Application Server to my devices without any problem in unicast.

Thank in advance for your help !