5 Replies Latest reply on Aug 18, 2017 8:40 AM by cdovholuk RSS
    wherget Newbie

    After deleting a thing by script, log full of messages

    After deleting a thing by script, the remote EMS is still trying to connect and try to send data. This lead to many, many error entries in the log

    "Unable to dispatch [ uri = /Things/xxxxx/Services/UpdateSubscribedPropertyValues/]: Entity xxxxx does not exist or is not yet associated with a Thing"

    and

    "error executing APIRequest Message: Entity xxxxx does not exist or is not yet associated with a Thing, sending ERROR ResponseMessage to caller!".

     

    How to stop these messages?

     

    BTW: It is correct, the xxxxx thing is and shall be deleted!

      • Re: After deleting a thing by script, log full of messages
        pchung Collaborator

        Since the EMS is able to connect, it will connect, however maybe it is thinking it is still able to bind.

        otoh depending on how your ems is set up, you might be directly trying to send info to a particular thing.

         

        I would recommend restarting Thingworx to see if some of these go away.

        Regardless of the associated Thing being deleted though, the EMS will connect since that depends on the appkey not the Remote Thing

          • Re: After deleting a thing by script, log full of messages
            cdovholuk Apprentice

            I don't think all of Thingworx needs to be restarted, just the EMS/LSR. I take it you're not stopping the LSR/EMS right?  Can you provide more details about how you have your EMS and LSR setup? Your feedback is useful so I'm curious what you would expect to happen in this scenario. If you stop the LSR I believe the messages will stop. Is that not an option?

            • Re: After deleting a thing by script, log full of messages
              wherget Newbie

              Step 1

              After restart of ThingWorx and the Remote Things the start situation is as follows.

              • Unbound things listed in a table on the mashup.
              • No new entries in application log

               

              Step 2

              After double-click in table on an unbound thing (#1), then service starts a thing deletion script:

              • this script do noting at this time

              Then a thing creation script is started:

              • thing #1 is created, enabled, restarted
              • the remote properties bound
              • the local properties bound

              The mashup shows the data of the thing #1 (now it is not unbound anymore, because the corresponding thing exists)

              At this time no additional entries in the application log.

              Everything looks fine at this step.

               

              Step 3

              After double-click in table on an unbound thing #2, then service starts a thing deletion script:

              • the remote property bounding of thing #1 is removed
              • thing #1 is deleted

              Then a thing creation script is started:

              • thing #2 is created, enabled, restarted
              • the remote properties bound
              • the local properties bound

              The mashup shows the data of the thing #2 (now #1 is unbound)

              Now a lot of entries written to the application log from remote thing #1.

               

              The question is how to come to a situation like end of step 1 or 2 where several remote things running but not logging after deleting a thing (e.g. #1).

                • Re: After deleting a thing by script, log full of messages
                  cdovholuk Apprentice

                  Thanks for those very detailed steps Werner. I think I'm still doing something differently than you are because for me as soon as I turn on my local ThingWorx instance, start the ems (without auto-bind), and then start the luaScriptResource.exe I get the same style error in my log.  What I mean is that for me - Step 1 as you outlined above produces the error message. As soon as I turn off the LSR - the errors stop. 


                  Here are the steps I followed:

                   

                  1. clean ThingWorx (for me this means deleting the "TestingThing" thing
                  2. stop/start ThingWorx (because this is how you are doing it - I did it this way)
                  3. start EMS (without auto_bind) and ensure it attaches properly to ThingWorx
                    1. ensure connected by looking at the EMS log at TRACE level and seeing: [TRACE] 2017-08-18 08:35:26,767 SDK: msgHandlerOnConnect: WEBSOCKET CONNECTED
                    2. observe no errors in the log
                    3. observe no entry in the 'unbound' remote things mashup
                  4. start LSR (luaScriptResource.exe) which will try to bind "TestingThing"
                    1. observe TestingThing is now in the "unbound" list of remote things
                    2. observe the following two errors over and over:
                      1. error executing APIRequest Message: Entity TestingThing does not exist or is not yet associated with a Thing, sending ERROR ResponseMessage to caller!
                      2. Unable to dispatch [ uri = /Things/TestingThing/Services/GetPropertySubscriptions/]: Entity TestingThing does not exist or is not yet associated with a Thing
                      3. Unable to dispatch [ uri = /Things/TestingThing/Services/UpdateSubscribedPropertyValues/]: Entity TestingThing does not exist or is not yet associated with a Thing

                   

                  I am using ThingWorx 7.4.2 and EMS 5.3.2.