Azure IoT Hub Connector 3.0 is showing "Missing application key" and "routing-group cannot be blank in configuration file" errors when connecting to ThingWorx Platform 8.5
Applies To
- ThingWorx Platform 8.5
- Azure IoT Hub Connector 3.0
Description
- Cannot connect Azure IoT Hub Connector to ThingWorx Platform
- Azure IoT Hub Connector is not connecting to Connection Server as expected
- Failing to connect to the Platform with Azure IoT Hub Connector
- Application Key errors seem to point to an incorrect Application Key being used by the Azure IoT Hub Connector but this is not the case
- Azure IoT Hub Connector CLI output shows the following:
- <Date Time> ERROR Error refilling connections on [channel: null, endpoint <ws or wss>://<ThingWorx Host>:<Port>/Thingworx/WS, uri: <ws or wss>://<ThingWorx Host>:<Port>/Thingworx/WS] failed : com.thingworx.sdk.api.exception.AuthenticationException: Connection authentication/registration FAILED [channel: NettyBytesChannel [id=<ws or wss>://<ThingWorx Host>:<Port>/Thingworx/WS-5, closed=false], code: STATUS_UNAUTHORIZED, reason: Error [context: authenticating connection][cause: Missing application key!]]
java.util.concurrent.CompletionException: com.thingworx.sdk.api.exception.AuthenticationException: Connection authentication/registration FAILED [channel: NettyBytesChannel [id=<ws or wss>://<ThingWorx Host>:<Port>/Thingworx/WS-5, closed=false], code: STATUS_UNAUTHORIZED, reason: Error [context: authenticating connection][cause: Missing application key!]]
at java.util.concurrent.CompletableFuture.encodeRelay(CompletableFuture.java:326)
at java.util.concurrent.CompletableFuture.completeRelay(CompletableFuture.java:338)
at java.util.concurrent.CompletableFuture.uniRelay(CompletableFuture.java:911)
at java.util.concurrent.CompletableFuture$UniRelay.tryFire(CompletableFuture.java:899)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977)
at
...
Caused by: com.thingworx.sdk.api.exception.AuthenticationException: Connection authentication/registration FAILED [channel: NettyBytesChannel [id=<ws or wss>://<ThingWorx Host>:<Port>/Thingworx/WS-5, closed=false], code: STATUS_UNAUTHORIZED, reason: Error [context: authenticating connection][cause: Missing application key!]]
... 45 common frames omitted
...
<Date Time> ERROR Unable to start ConnectionServer
com.google.inject.CreationException: Unable to create injector, see the following errors:
1) Error injecting constructor, java.lang.RuntimeException: routing-group cannot be blank in configuration file
at com.thingworx.protocol.azure.iot.AzureIotHubBindService.<init>(AzureIotHubBindService.java:41)
at com.thingworx.protocol.azure.iot.AzureIotGuiceModule.configure(AzureIotGuiceModule.java:34)
while locating com.thingworx.protocol.azure.iot.AzureIotHubBindService
for the 6th parameter of com.thingworx.protocol.azure.iot.AzureIotProtocolAdapter.<init>(AzureIotProtocolAdapter.java:94)
while locating com.thingworx.protocol.azure.iot.AzureIotProtocolAdapter
while locating com.thingworx.connectionserver.protocol.Protocol
for the 9th parameter of com.thingworx.connectionserver.ConnectionServerDataPlane.<init>(ConnectionServerDataPlane.java:47)
...
- <Date Time> ERROR Error refilling connections on [channel: null, endpoint <ws or wss>://<ThingWorx Host>:<Port>/Thingworx/WS, uri: <ws or wss>://<ThingWorx Host>:<Port>/Thingworx/WS] failed : com.thingworx.sdk.api.exception.AuthenticationException: Connection authentication/registration FAILED [channel: NettyBytesChannel [id=<ws or wss>://<ThingWorx Host>:<Port>/Thingworx/WS-5, closed=false], code: STATUS_UNAUTHORIZED, reason: Error [context: authenticating connection][cause: Missing application key!]]
- <ThingworxStorage>\logs\ApplicationLog.log shows the following when connecting with Azure IoT Hub Connector
- <Date Time> [L: ERROR] [O: c.t.c.p.m.DispatchingServerCommunicationModule] [I: ] [U: ???] [S: ] [P: ] [T: http-nio-8080-exec-3] Missing application key!
<Date Time> [L: ERROR] [O: c.t.c.s.c.j.Jsr356ServerConnection] [I: ] [U: ???] [S: ] [P: ] [T: http-nio-8080-exec-3] Error [authenticating connection], Server websocket will be closed. cause: Missing application key!
<Date Time> [L: INFO] [O: c.t.c.s.c.j.Jsr356ServerConnection] [I: ] [U: ???] [S: ] [P: ] [T: http-nio-8080-exec-3] Server WebSocket is closing and has already been unregistered from Server Endpoint [ws session id: 26] CloseReason: code [1011], reason [Error [authenticating connection], Server websocket will be closed.]
- <Date Time> [L: ERROR] [O: c.t.c.p.m.DispatchingServerCommunicationModule] [I: ] [U: ???] [S: ] [P: ] [T: http-nio-8080-exec-3] Missing application key!