"Failed to get Azure IoT Hub configuration from the platform" is seen when connecting the Azure IoT Hub Connector 3.0 to ThingWorx Platform 8.5
Applies To
- ThingWorx Platform 8.5 to 9.1
- Azure IoT Hub Connector 3.0
Description
- Cannot get Azure Iot Hub Connector to work with ThingWorx Platform
- Unable to start Azure IoT Hub connector version V3.0.1 for Thingworx version 8.5.1.
- IoT Hub connector stops with following error in the logs due to ssl encryption mismatch in ThingworxStorage/logs/SecurityLog.log:
- No authType or appKey parameter has been specified for Authentication Scheme: AUTH_THINGWORX_APPKEY
- Azure Connector is failing to connect to Platform citing decryption issue
- Completed "Setting Up Encryption for the Azure IoT Hub Credentials" section in the Getting an Azure IoT Hub Connector Up and Running Help Center but the connector is still failing
- Following error is still seen in the CLI when launching <Azure IoT Hub Connector>\connector\bin\azure-iot
- java.lang.IllegalStateException: Failed to get Azure IoT Hub configuration from the platform
at com.thingworx.protocol.azure.iot.AzureIotProtocolAdapter.initialize(AzureIotProtocolAdapter.java:336)
at com.thingworx.connectionserver.ConnectionServerDataPlane.initProtocol(ConnectionServerDataPlane.java:152)
at com.thingworx.statemachine.DispatchingEventChannel.doEvent(DispatchingEventChannel.java:36)
at com.thingworx.statemachine.AbstractEventChannel.apply(AbstractEventChannel.java:50)
at rx.internal.util.ActionSubscriber.onNext(ActionSubscriber.java:39)
at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:134)
at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.call(OperatorObserveOn.java:224)
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
at rx.internal.schedulers.ExecutorScheduler$ExecutorSchedulerWorker.run(ExecutorScheduler.java:107)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Exception: error decrypting secure bytes: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
at com.thingworx.security.encryption.SecureBytes.cipherData(SecureBytes.java:184)
at com.thingworx.security.encryption.SecureString.decrypt(SecureString.java:70)
at com.thingworx.security.encryption.SecureString.decrypt(SecureString.java:55)
at com.thingworx.protocol.azure.iot.util.SecurityUtils.decryptWithKey(SecurityUtils.java:20)
at com.thingworx.protocol.azure.iot.AzureConfiguration.<init>(AzureConfiguration.java:90)
at com.thingworx.protocol.azure.iot.AzureIotProtocolAdapter.getHubConfiguration(AzureIotProtocolAdapter.java:375)
at com.thingworx.protocol.azure.iot.AzureIotProtocolAdapter.initialize(AzureIotProtocolAdapter.java:326)
... 11 more
Caused by: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
at com.sun.crypto.provider.CipherCore.unpad(CipherCore.java:975)
at com.sun.crypto.provider.CipherCore.fillOutputBuffer(CipherCore.java:1056)
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:941)
at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:491)
at javax.crypto.Cipher.doFinal(Cipher.java:2111)
at com.thingworx.security.encryption.SecureBytes.cipherData(SecureBytes.java:172)
... 17 more
- java.lang.IllegalStateException: Failed to get Azure IoT Hub configuration from the platform