brocaar / chirpstack-application-server

ChirpStack Application Server is an open-source LoRaWAN application-server.
https://www.chirpstack.io
MIT License
497 stars 325 forks source link

Azure Service Bus Integration fails when event="join" #583

Open tomlewis0 opened 3 years ago

tomlewis0 commented 3 years ago

What happened?

When a device joins the network with an Azure Service Bus integration (configured both globally and per application), the "join" event is not received by the topic, the subsequent "up" event is received. Upon inspecting the logs, an error shows up with the HTTP request to ASB context canceled. Enabling a parallel HTTP integration works as expected, sending both the "join" followed by the "up" event.

What did you expect?

I expect all defined events to be sent to the Azure Service Bus Topic or Queue.

Steps to reproduce this issue

Steps:

  1. Enable Azure Service-Bus integration

Could you share your log output?

Mar 25 00:50:59 ynomia-chirpstack-au-trial chirpstack-application-server[468887]: time="2021-03-25T00:50:59Z" level=info msg="integration/logger: logging event" ctx_id=89dec2f7-565b-4b8c-8e06-8daaf5c452aa dev_eui=0000d89790000148 type=join
Mar 25 00:50:59 ynomia-chirpstack-au-trial chirpstack-application-server[468887]: time="2021-03-25T00:50:59Z" level=info msg="finished unary call with code OK" ctx_id=89dec2f7-565b-4b8c-8e06-8daaf5c452aa grpc.code=OK grpc.method=HandleUplinkData grpc.request.deadline="2021-03-25T00:51:00Z" grpc.service=as.ApplicationServerService grpc.start_time="2021-03-25T00:50:59Z" grpc.time_ms=38.597 peer.address="127.0.0.1:41774" span.kind=server system=grpc
Mar 25 00:50:59 ynomia-chirpstack-au-trial chirpstack-application-server[468887]: time="2021-03-25T00:50:59Z" level=error msg="integration/multi: integration error" ctx_id=89dec2f7-565b-4b8c-8e06-8daaf5c452aa error="http request error: Post \"https://<redacted-service-bus-namespace>.servicebus.windows.net/testing.device-events/messages\": context canceled" integration="*azureservicebus.Integration"
Mar 25 00:50:59 ynomia-chirpstack-au-trial chirpstack-application-server[468887]: time="2021-03-25T00:50:59Z" level=info msg="integration/logger: logging event" ctx_id=89dec2f7-565b-4b8c-8e06-8daaf5c452aa dev_eui=0000d89790000148 type=up
Mar 25 00:50:59 ynomia-chirpstack-au-trial chirpstack-application-server[468887]: time="2021-03-25T00:50:59Z" level=info msg="integration/azureservicebus: event published" ctx_id=89dec2f7-565b-4b8c-8e06-8daaf5c452aa dev_eui=0000d89790000148 event=up

Your Environment

Component Version
Application Server v3.14.0
Network Server v3.12.2
Gateway Bridge v3.10.0
Chirpstack API
Geolocation
Concentratord
brocaar commented 3 years ago

The context cancelled occurs when the request times out, see also https://github.com/brocaar/chirpstack-application-server/issues/592. I don' think this is specific to join messages.