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

Error for deleting value stream created using CreateThing API in postman

SO_9699370
10-Marble

Error for deleting value stream created using CreateThing API in postman

Hi All,

 

I am using below details to generate value streams using postman. 

 

http://XXX.XXX.XXX.XXX:8080/Thingworx/Resources/EntityServices/Services/CreateThing

{

"name": "MyStream",

 "thingTemplateName": "ValueStream",

“description”:  “<Description of the entity>”,

“projectName” : “MyProject”

}

The value stream gets generated, I use below service-call to enable the value stream from postman.

http://XXX.XXX.XXX.XXX:8080/Thingworx/Things/MyStream/Services/EnableThing

 

Now when I check in composer the value stream exist in the system however I couldn't delete it. I got below error -

Fail - Unable to delete thing: [ValueStream_MyStream] Unable to dispose thing: [ValueStream_MyStream] null 

I checked and found the below link where user has mentioned seeing this error and there was no solution to it. 

https://community.ptc.com/t5/ThingWorx-Developers/Unable-to-delete-Valuestream-from-Composer-which-was-created-via/m-p/667936#M45363

 

Here are some of my findings.

-There are no ghost entites checked it with getghostentities service and I am using Administrator credentials which has access to all the things and services.

- When I try to restart MyStream from composer, it throws an error showing invalid persistence provided (ThingworxPersistenceProvider) or when I try to set persistence provider using SetPersistenceProvider service it throws an error that thing is not running.

- To my surprise this persistence provider is the one which I have used so far and the fun part is, if I remove that persistence provider and re-attach it (manually) followed by saving the thing, I was able to delete it! This I have confirmed 10-15 times. I am using thingworx 9.1

 

Please let me know what to do about this?

 

Kind Regards
SO
11 REPLIES 11

When you create your value stream thing through REST, pass your persistence provider in the body along with other parameters like:

"persistenceProvider": "ThingworxPersistenceProvider"

Once you get 200 for create thing, then execute EnableThing and RestartThing from REST. This way you should not face below issues.

 

 

Hi @SO_9699370 

 

When you create a value stream via postman Persistence provider is not provided by default. If you go to composer and open the newly created VS, it asks you to add to persistence provider, without adding it you cannot delete or edit the thing and that's when you get the error Unable to dispose thing. Mentioned the persistence provider in the body of json when creating the VS.

 

Regards,

Sachin Sharma

Hi @SachinSharma  and @mnarang,

 

Thanks for your input, This time I gave the persistence provider in the body (please check below). Then I enabled and restarted the thing, still no luck. While trying to delete manually it gave the error - "[test1] Unable to dispose thing: [test1] null". I got 200OK for all the services I fired in postman.

 

{
"name""test1",
 "thingTemplateName""ValueStream",
"persistenceProvider""ThingworxPersistenceProvider",
"projectName" : "tProject"
}
 
Kind Regards
SO
Kind Regards
SO

Did you do EnableThing and RestartThing from REST client itself or did it manually from composer after creating the thing ?

Hi @mnarang

 

I did it from REST call using postman. 

 

Kind Regards

SO

Kind Regards
SO

Hi @SO_9699370 

 

Create a new VS with same JSON and then execute EnableThing and RestartThing, all from REST client. Now, open the VS in composer and check if Persistence Provider field is blank or not under General Information tab. If there are no pending action items in To Do section then try to delete the VS and if an error still occurs then please provide the application logs.

SachinSharma_1-1615188006842.png

 

Regards,

Sachin 

 

 

 
 

Hi @SachinSharma 

 

I went as per you suggestion followed the below steps -

1. Created VS (My Stream) with persistence provider defined in the body

2. Enabled the thing 

3. Restarted the thing 

All the above step were done with Postman. 

As per your input I checked todo list there was nothing there (See below screen shot)

SO_9699370_0-1615213176134.png

While trying to delete this thing I got an error. I am attaching logs for your reference. 

 

Hope this helps. Thanks in advance.

 

Kind Regards

SO

Kind Regards
SO

Hi @SO_9699370 

 

I followed the exact same steps on my 9.1 instance and i am able to delete the VS without any error. Can you try restarting tomcat once and then try to delete the value stream and see if it works?

 

Regards,

Sachin

Hi @SachinSharma 

 

I followed your steps and restarted the tomcat but still can't delete it. Got the same null error. For information I am using postgres as my persistence provider. 

 

Kind Regards

SO

Kind Regards
SO

@SO_9699370 

 

I reviewed the logs and noticed that you are trying to delete the VS logged in with user Swarajo.

Can you try logging in with Administrator user and check if you still see the same behavior?

 

Regards,

Sachin

Hi @SachinSharma 

 

I tried deleting the stream using administrator credentials of thingworx, but I got the same null error. 

 

Kind Regards

SO 

Kind Regards
SO
Top Tags