cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Very important! Connection server and IoT hub connector with two important ERROR. Don't work correctly!

mvolanti
8-Gravel

Very important! Connection server and IoT hub connector with two important ERROR. Don't work correctly!

Hi,

I Installed connction server and iothub connector.

The web socket opening right in both case, but in logs are 2 big problems which cause the inability to read data from azure IoThub (with iothub connector).

Error:

CONNECTION SERVER:


1) Unable to dispatch [ uri = /Things/AlwaysOn-cxserver-a6536aa4-dbbe-4d15-bb0b-ad2b768c1e4d/Services/GetMetadata/]: Entity AlwaysOn-cxserver-a6536aa4-dbbe-4d15-bb0b-ad2b768c1e4d does not exist or is not yet associated with a Thing


2) error executing APIRequest Message: Entity AlwaysOn-cxserver-a6536aa4-dbbe-4d15-bb0b-ad2b768c1e4d does not exist or is not yet associated with a Thing, sending ERROR ResponseMessage to caller!



AZURE IOT HUB CONNECTOR

1) Unable to dispatch [ uri = /Things/iothub-ehub-iotesttw-72157-cf300d5f35/Properties/partitionTable/]: Entity iothub-ehub-iotesttw-72157-cf300d5f35 does not exist or is not yet associated with a Thing

2) error executing APIRequest Message: Entity iothub-ehub-iotesttw-72157-cf300d5f35 does not exist or is not yet associated with a Thing, sending ERROR ResponseMessage to caller!



​Thingworx 7.2.

Help me!! is Very important !

9 REPLIES 9
ttielebein
14-Alexandrite
(To:mvolanti)

What is this "iothub-ehub-iotesttw-72157-cf300d5f35​" that it says does not exist? Can you find this in the system? I wonder what this is supposed to do...

Is there some additional library or extension you are supposed to also import? Are there any installation steps that require running services which may generate these things which you might have missed?

Hi,

I correct 2  problem that i mentioned up, I have a issue in the .conf  file.

So..

The azure iot connector opening web socket corectly. I'm able to create, delete, import, device from IoThub.

BUT I can't read messages/values from that device !! I'm using the demo( in the documentation of setup iot connector) to create random values.

My configuration is:

cx-server {

    protocol {

        port=8081

        // You can find the configuration parameters for your IoT Hub by logging into portal.azure.com and following the hints below.

        // If necessary, create a new IoT Hub: https://azure.microsoft.com/en-us/documentation/articles/iot-hub-java-java-getstarted/

        // A policy name that is related to a key specified below.  This policy is typically a built in, pre defined policy called "service",

        // but it is possible to use a custom policy if you add it to your hub.

        // All resources > your-hub > Settings > Shared access policies > service (or custom service with "service connect" permission

        consumerPolicyName = "service"

        // A key that supplies credentials to access services specified in the related policy.

        // All resources > your-hub > Settings  > Shared access policies > {consumerPolicyName} > Primary (or Secondary) key

        consumerPolicyKey = "t3/l93hMmHKQMKLFFH3q9qVGMTcucpRGbwu+QZgmQSA="

        // A name that defines the IoT Hub related to this adapter, which manages your things and their related messages.

        // Hubs can be scaled via hub units at different price tiers per unit.  Hubs are related to a resource group, which is

        // related to a subscription Id and a cloud Location.

        hubName = "Myhub"

        // The Event Hub-compatible name utilized by SDKs and integrations that expect to read from Event Hubs.  An Event Hub is an internal

        // component of an IoT Hub that handles device to cloud events for related things. In many cases the IoT Hub name and

        // Event Hub-compatible name are the same, so default to the IoT Hub name.

        // All resources > your-hub > Settings  > Messaging > Event Hub-compatible name

        eventHubName = ${cx-server.protocol.hubName}

        // An endpoint utilized by SDKs and integrations that expect to read from Event Hubs.

        // All resources > your-hub > Settings  > Messaging > Event Hub-compatible endpoint (hostname without ".servicebus.windows.net")

        eventHubNamespace = "ihsuproddbres045dednamespace"

        // The number of partitions that handle device to cloud events.

        // All resources > your-hub > Settings > Message > Partitions

        hubPartitions = 2

        // A consumer group name is required to pull data from the IoT Hub.

        // All resources > your-hub > Settings > Message > Consumer groups

        // null means to use the $Default consumer group

        consumerGroup = null

        // IoT Hubs have a hostname that is defined by the hubName, plus a domain name of Azure's choosing, normally azure-devices.net.

        // All resources > your-hub > Essentials section > Hostname

        hubHostname = ${cx-server.protocol.hubName}".azure-devices.net"

        // Settings for Azure blob storage.  Used for device-export for an Azure IoT Hub.

        // Create a "Storage Account" in the Azure portal, then use the navigation hints below.

        blob-storage {

            // <blob-store> > Settings > Access Keys > Storage account name

            account-name = "myhubblob"

            // <blob-store> > Settings > Access Keys > Primary or secondary key

            account-key = "ROZQfFFQvhSP+R/yNhLrS4rV5WuSmqqXOHcioxpWEIdDirJHdTNh4YkqjyaMdF7Zh102Vn6+KFtzxz/y4mz9uQ=="

        }

    }

    transport.websockets {

        // ThingWorx platform application key

        app-key = "bfbd6a33-c995-40b6-96cc-e4e9f0481a15"

        // One or more platforms can be specified here, comma separated

        platforms = "ws://localhost:8080/Thingworx/WS"

    }

}

below is the iot-connector log part where WARN is located but i don't know if it's the problem.

17:21:58.295 [main] WARN  c.t.c.metrics.MetricsReporterManager - Metrics are enabled but no reporters are configured

17:21:59.349 [azure-eventhub-consumer-1] WARN  c.t.p.azure.iot.EventHubConsumer - partition receiver failed to start: partitionId=1, will-retry=false

com.microsoft.azure.servicebus.IllegalEntityException: The messaging entity 'sb://ihsuproddbres045dednamespace.servicebus.windows.net/iotesttw/consumergroups/$default/partitions/1' could not be found. TrackingId:30c6601b708040599c6c3b2358deb34f_G0, SystemTracker:gateway6, Timestamp:10/17/2016 3:21:57 PM, errorContext[NS: ihsuproddbres045dednamespace.servicebus.windows.net, PATH: IoTestTW/ConsumerGroups/$Default/Partitions/1, REFERENCE_ID: 83888f_30c6601b708040599c6c3b2358deb34f_G0, R_TYPE: NON_EPOCH]

  at com.microsoft.azure.servicebus.ExceptionUtil.toException(ExceptionUtil.java:38) ~[azure-eventhubs-0.7.1.jar:na]

  at com.microsoft.azure.servicebus.MessageReceiver.onError(MessageReceiver.java:379) ~[azure-eventhubs-0.7.1.jar:na]

  at com.microsoft.azure.servicebus.MessageReceiver.onClose(MessageReceiver.java:682) ~[azure-eventhubs-0.7.1.jar:na]

  at com.microsoft.azure.servicebus.amqp.BaseLinkHandler.processOnClose(BaseLinkHandler.java:56) ~[azure-eventhubs-0.7.1.jar:na]

  at com.microsoft.azure.servicebus.amqp.ReceiveLinkHandler.onLinkRemoteClose(ReceiveLinkHandler.java:92) ~[azure-eventhubs-0.7.1.jar:na]

  at org.apache.qpid.proton.engine.BaseHandler.handle(BaseHandler.java:176) ~[proton-j-0.12.2.jar:0.12.2]

  at org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:108) ~[proton-j-0.12.2.jar:0.12.2]

  at org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:304) ~[proton-j-0.12.2.jar:0.12.2]

  at org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:272) ~[proton-j-0.12.2.jar:0.12.2]

  at com.microsoft.azure.servicebus.MessagingFactory$RunReactor.run(MessagingFactory.java:341) ~[azure-eventhubs-0.7.1.jar:na]

  at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_92]

Please can give me your steps !

Thanks

BABA-SHYAM
15-Moonstone
(To:mvolanti)

Hi,

 

I am able to make connection between thingworx composer and thingworx-azure connector. But not sure if I am connected with Azure. My logs doesn't give me that indication. Also I have attached few screenshot which shows thingworx composer is connected with thingworx-azure connector. Can you please suggest how can I make connection IOT hub? Below are my logs details.

 

 

12:44:37.631 [main] WARN c.t.c.p.s.k.impl.StoreServiceImpl - The contents of cache: ThingNameStash will never expire: -1. Consider setting 'default-expire-time' or the cache 'expire-time'.
12:44:38.015 [main] WARN c.t.c.metrics.MetricsReporterManager - Metrics are enabled but no reporters are configured
12:44:39.510 [Thread-11] WARN servicebus.trace - UnHandled exception while processing events in reactor:
java.lang.NullPointerException
org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:112)
org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:309)
org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:276)
com.microsoft.azure.servicebus.MessagingFactory$RunReactor.run(MessagingFactory.java:375)
java.lang.Thread.run(Unknown Source)Cause: null
java.lang.StringBuilder.<init>(Unknown Source)
org.apache.qpid.proton.reactor.impl.ReactorImpl.getConnectionAddress(ReactorImpl.java:445)
com.microsoft.azure.servicebus.amqp.ConnectionHandler.onConnectionInit(ConnectionHandler.java:43)
org.apache.qpid.proton.engine.BaseHandler.handle(BaseHandler.java:116)
org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:108)
org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:309)
org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:276)
com.microsoft.azure.servicebus.MessagingFactory$RunReactor.run(MessagingFactory.java:375)
java.lang.Thread.run(Unknown Source)
12:44:39.525 [pool-5-thread-1] ERROR eventprocessorhost.trace - host AzureIot-2aaa9290-7e55-4b2c-abb5-d9c6a6f71e8e: Exception while initializing stores, not starting partition manager
12:44:39.525 [pool-5-thread-1] ERROR eventprocessorhost.trace - host AzureIot-2aaa9290-7e55-4b2c-abb5-d9c6a6f71e8e: Caught com.microsoft.azure.servicebus.IllegalEntityException: Failure getting partition ids for event hub
12:44:39.525 [pool-5-thread-1] ERROR eventprocessorhost.trace - host AzureIot-2aaa9290-7e55-4b2c-abb5-d9c6a6f71e8e: com.microsoft.azure.eventprocessorhost.PartitionManager.getPartitionIds(PartitionManager.java:71)
12:44:39.525 [pool-5-thread-1] ERROR eventprocessorhost.trace - host AzureIot-2aaa9290-7e55-4b2c-abb5-d9c6a6f71e8e: com.microsoft.azure.eventprocessorhost.PartitionManager.initializeStores(PartitionManager.java:211)
12:44:39.525 [pool-5-thread-1] ERROR eventprocessorhost.trace - host AzureIot-2aaa9290-7e55-4b2c-abb5-d9c6a6f71e8e: com.microsoft.azure.eventprocessorhost.PartitionManager.initialize(PartitionManager.java:106)
12:44:39.525 [pool-5-thread-1] ERROR eventprocessorhost.trace - host AzureIot-2aaa9290-7e55-4b2c-abb5-d9c6a6f71e8e: com.microsoft.azure.eventprocessorhost.EventProcessorHost.lambda$registerEventProcessorFactory$0(EventProcessorHost.java:509)
12:44:39.525 [pool-5-thread-1] ERROR eventprocessorhost.trace - host AzureIot-2aaa9290-7e55-4b2c-abb5-d9c6a6f71e8e: java.util.concurrent.FutureTask.run(Unknown Source)
12:44:39.525 [pool-5-thread-1] ERROR eventprocessorhost.trace - host AzureIot-2aaa9290-7e55-4b2c-abb5-d9c6a6f71e8e: java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
12:44:39.525 [pool-5-thread-1] ERROR eventprocessorhost.trace - host AzureIot-2aaa9290-7e55-4b2c-abb5-d9c6a6f71e8e: java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
12:44:39.525 [pool-5-thread-1] ERROR eventprocessorhost.trace - host AzureIot-2aaa9290-7e55-4b2c-abb5-d9c6a6f71e8e: java.lang.Thread.run(Unknown Source)
12:44:39.525 [pool-5-thread-1] ERROR eventprocessorhost.trace - host AzureIot-2aaa9290-7e55-4b2c-abb5-d9c6a6f71e8e: Inner exception com.microsoft.azure.servicebus.ServiceBusException: java.lang.NullPointerException, TrackingId: 7b47ba83-1d67-496b-bbf0-e0f3f4d752b4, at: 2018-11-16T12:44:39.523+05:30[Asia/Calcutta]
12:44:39.525 [pool-5-thread-1] ERROR eventprocessorhost.trace - host AzureIot-2aaa9290-7e55-4b2c-abb5-d9c6a6f71e8e: com.microsoft.azure.servicebus.MessagingFactory$RunReactor.run(MessagingFactory.java:397)
12:44:39.525 [pool-5-thread-1] ERROR eventprocessorhost.trace - host AzureIot-2aaa9290-7e55-4b2c-abb5-d9c6a6f71e8e: java.lang.Thread.run(Unknown Source)
13:56:52.584 [ConnectedStateListener-executor] WARN c.t.connectionserver.CXThingImpl - Lost connection to platform

Jareval2
4-Participant
(To:BABA-SHYAM)

Hey, did you solve that issue? I 'm having the exact same errors and warnings. Here are my azure-iot.conf and cxserver.log. In addition, I can import my Azure IoT Device, but can't see any data on my thingworx platform.

 

cx-server {
metrics {
enabled = false
}

thing {
name = ConnectorVMServer
}

health-check {
port = 9009
}

protocol {
consumerPolicyName = "iothubowner"
consumerPolicyKey = "fiUMHoEC/qrPm8A0iKktUb3u/m3dCu68WLAflVqENf0="
registryPolicyName = "iothubowner"
registryPolicyKey = "fiUMHoEC/qrPm8A0iKktUb3u/m3dCu68WLAflVqENf0="

hubName = "kepserverexhub"
eventHubName = "kepserverexhub"
eventHubNamespace = "Endpoint=sb://iothub-ns-kepservere-1413800-d6d1c2b2f1/;SharedAccessKeyName=iothubowner;SharedAccessKey=fiUMHoEC/qrPm8A0iKktUb3u/m3dCu68WLAflVqENf0=;EntityPath=kepserverexhub"
consumerGroup = null
hubHostname = "KEPServerEXHub.azure-devices.net"
blob-storage {
accounts {
default {
endpoint-protocol = "https"
account-name = "kepserverexstorage"
account-key = "4qNFrgyt2Jzu/WD8rYh5Y0Zplyh1On/1wInRZ2z8IbjiNRivYX72wFvEjKUL4k1ZYhF7J/P3Gw/liuMHS08uEQ=="
}
}

event-processor-host {
container-name = "eph-storage-"${cx-server.protocol.eventHubName}
account = default
}
}

file-upload-events {
enabled = false
repository-thing-name = "Repository"
}
}

transport {
websockets {
app-key = "12019351-86d8-46ee-89c4-7f575d6527fd"
platforms = "ws://10.0.1.10:8080/Thingworx/WS"
}
}

platform.extensions {
location = "C:\\Thingworx-Azure-IoT-Hub-Connector-2.0.0.141\\extensions"
}
}

 

21:58:30.886 [main] WARN c.t.c.p.s.k.impl.StoreServiceImpl - The contents of cache: ThingNameStash will never expire: -1. Consider setting 'default-expire-time' or the cache 'expire-time'.
21:58:31.980 [Thread-11] WARN servicebus.trace - UnHandled exception while processing events in reactor:
java.lang.NullPointerException
org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:112)
org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:309)
org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:276)
com.microsoft.azure.servicebus.MessagingFactory$RunReactor.run(MessagingFactory.java:375)
java.lang.Thread.run(Unknown Source)Cause: null
java.lang.StringBuilder.<init>(Unknown Source)
org.apache.qpid.proton.reactor.impl.ReactorImpl.getConnectionAddress(ReactorImpl.java:445)
com.microsoft.azure.servicebus.amqp.ConnectionHandler.onConnectionInit(ConnectionHandler.java:43)
org.apache.qpid.proton.engine.BaseHandler.handle(BaseHandler.java:116)
org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:108)
org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:309)
org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:276)
com.microsoft.azure.servicebus.MessagingFactory$RunReactor.run(MessagingFactory.java:375)
java.lang.Thread.run(Unknown Source)
21:58:31.995 [pool-4-thread-1] ERROR eventprocessorhost.trace - host AzureIot-01832f49-b6f8-440d-92f2-d7003460d8b2: Exception while initializing stores, not starting partition manager
21:58:31.995 [pool-4-thread-1] ERROR eventprocessorhost.trace - host AzureIot-01832f49-b6f8-440d-92f2-d7003460d8b2: Caught com.microsoft.azure.servicebus.IllegalEntityException: Failure getting partition ids for event hub
21:58:31.995 [pool-4-thread-1] ERROR eventprocessorhost.trace - host AzureIot-01832f49-b6f8-440d-92f2-d7003460d8b2: com.microsoft.azure.eventprocessorhost.PartitionManager.getPartitionIds(PartitionManager.java:71)
21:58:31.995 [pool-4-thread-1] ERROR eventprocessorhost.trace - host AzureIot-01832f49-b6f8-440d-92f2-d7003460d8b2: com.microsoft.azure.eventprocessorhost.PartitionManager.initializeStores(PartitionManager.java:211)
21:58:31.995 [pool-4-thread-1] ERROR eventprocessorhost.trace - host AzureIot-01832f49-b6f8-440d-92f2-d7003460d8b2: com.microsoft.azure.eventprocessorhost.PartitionManager.initialize(PartitionManager.java:106)
21:58:31.995 [pool-4-thread-1] ERROR eventprocessorhost.trace - host AzureIot-01832f49-b6f8-440d-92f2-d7003460d8b2: com.microsoft.azure.eventprocessorhost.EventProcessorHost.lambda$registerEventProcessorFactory$0(EventProcessorHost.java:509)
21:58:31.995 [pool-4-thread-1] ERROR eventprocessorhost.trace - host AzureIot-01832f49-b6f8-440d-92f2-d7003460d8b2: java.util.concurrent.FutureTask.run(Unknown Source)
21:58:31.995 [pool-4-thread-1] ERROR eventprocessorhost.trace - host AzureIot-01832f49-b6f8-440d-92f2-d7003460d8b2: java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
21:58:31.995 [pool-4-thread-1] ERROR eventprocessorhost.trace - host AzureIot-01832f49-b6f8-440d-92f2-d7003460d8b2: java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
21:58:31.995 [pool-4-thread-1] ERROR eventprocessorhost.trace - host AzureIot-01832f49-b6f8-440d-92f2-d7003460d8b2: java.lang.Thread.run(Unknown Source)
21:58:31.995 [pool-4-thread-1] ERROR eventprocessorhost.trace - host AzureIot-01832f49-b6f8-440d-92f2-d7003460d8b2: Inner exception com.microsoft.azure.servicebus.ServiceBusException: java.lang.NullPointerException, TrackingId: d448bfde-cd73-41c2-9a81-fdb85bb710a6, at: 2019-03-19T21:58:31.995Z[UTC]
21:58:31.995 [pool-4-thread-1] ERROR eventprocessorhost.trace - host AzureIot-01832f49-b6f8-440d-92f2-d7003460d8b2: com.microsoft.azure.servicebus.MessagingFactory$RunReactor.run(MessagingFactory.java:397)
21:58:31.995 [pool-4-thread-1] ERROR eventprocessorhost.trace - host AzureIot-01832f49-b6f8-440d-92f2-d7003460d8b2: java.lang.Thread.run(Unknown Source)

BABA-SHYAM
15-Moonstone
(To:Jareval2)

The issue was related to the accessibility. Since I was approaching the deadline I created a remote thing and connected it with Azure subscription. Whenever they is an event on Azure name space my remotething got notified and I update the value here in thingworx.

Jareval2
4-Participant
(To:BABA-SHYAM)

Hi, can you guide me through the process? My deadline is also close and I'm a little bit new in this subject. 

BABA-SHYAM
15-Moonstone
(To:Jareval2)

Go and download Stream Sensor Project in .Net Using this link
https://marketplace.ptc.com/apps/193548#!overview

Follow This document to use it.
http://support.ptc.com/help/thingworx_hc/thingworx_edge/#page/thingworx_edge_sdks_ems%2Fdotnet_sdk%2Fc_new_steamsensor_example.html%23

 

Also use this code of subscription and try to call Scan method every time subscription come.

https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-dotnet-standard-getstarted-receive-eph

Try making these changes to azure-iot.conf:

eventHubNamespace = "iothub-ns-kepservere-1413800-d6d1c2b2f1"
hubHostname = "kepserverexhub.azure-devices.net" 

This error is innocuous. It does not interfere with operation of connector or platform. see discussion here I am getting some errors in the error logs while starting the Azure IoT Hub connector

Announcements


Top Tags