My piston will not load - help please

piston

#18

BTW… If it’s just a single piston, maybe just duplicate it and delete the original.

It’s an option under +new piston


#19

I just tried duplicating it - that didn’t work!

How do I just delete it without loading it as I think it will be quicker to start over.


#20

I just noticed the backup code from the hover area in the ST IDE screens. I’ve managed to make a copy - Now how do I delete without loading it first?


#21

You can delete from the IDE


#22

But if you don’t mind… hold off deleting

@ipaterson might like to try some more debugging to try and solve this for future users.


#23

Ok I’ll wait, I’ll do all that I can to help out.


#24

Can you tell us anymore about what’s in the Piston? Anything noticably different than your others?


#25

I guess as it’s been recovered… you could just post the green snapshot.


#26

Can you go into ide.smartthings.com > My Locations > smartapps then click the piston that is giving you trouble and PM me the value that it shows for the bin? That should be a recovery code that I can use to take a look.

I have a debugging setup that we could use but I’m not sure it will be relevant here, and if the problem can be replicated by copying the piston it would be easiest to debug on my end. Thanks!

P.S. I have to run now but will be back in 2 hours to take a look.


#27

Here you go - hope this helps. Just to confirm this is the duplicate piston I was able to retrieve by using the backup code.

The original code was 7cu6


#28

Thanks, are there any errors in the ST IDE live logging when you load up the original piston? The 7cu6 code came up blank for me. We can try the debugging version to see what is going on, but first if there is an error showing up in ST it might be specific enough to not have to set up that debugging for you.


#29

This is the error (I think) when I try and load the piston.

physicalgraph.exception.StateCharacterLimitExceededException: State cannot be greater than 100000.0 characters


#30

Ah! I’ve seen that a few times, usually with much larger pistons than what you have here though. Please go into the ST mobile app and try SMartApps > webCoRE > Settings > Clean up and rebuild data cache.


#31

I tried that and it didn’t help.


#32

Well… I guess you could go back to My Locations > smartapps and click the piston that is misbehaving. The application state is shown there and my guess is that logging was enabled and filled up the state. If so, we should be able to clear those logs.

If you see a bunch of logs, follow these steps:

  1. Go to dashboard.webcore.co
  2. Open your browser developer console (steps to open it vary by browser, may need to search for your browser)
  3. Paste the following command in the console and change “My Piston Name Here” to the name of the broken piston
~function(name){
    dataService.clearPistonLogs($('td:contains("' + name + '")').scope().piston.id)
}('My Piston Name Here');
  1. Press enter to run the command, you will see a confirmation that the log was cleared
  2. Try to access the piston again

#33

Ok tried that (I’m on chrome) and I get the popup that says cleared piston logs. The piston still will not load same error ‘Sorry, an error occurred while retrieving the piston data.’


#34

Ok I’ll need to see what is filling up the application state, would you copy the Application State segment from IDE and PM it to me please?


#35

A ha! @Egoman thanks for sending the application state, that was very helpful. The problem here is that the time2wait is a device variable rather than a numeric type. webCoRE is going all kinds of crazy over the math that happens in this piston because time2wait is actually represented as an array.

Like seriously :crazy_face: crazy. Here’s a short excerpt of the value of the time2wait variable in the piston.

[0000000000000010[1]0[010[1]]0[0010[1]0[010[1]]]0[00010[1]0[010[1]]0[0010[1]0[010[1]]]]0[000010[1]0[010[1]]0[0010[1]0[010[1]]]0[00010[1]0[010[1]]0[0010[1]0[010[1]]]]]0[0000010[1]0[010[1]]0[0010[1]0[010[1]]]0[00010[1]0[010[1]]0[0010[1]0[010[1]]]]0[000010[1]0[010[1]]0[0010[1]0[010[1]]]0[00010[1]0[010[1]]0[0010[1]0[010[1]]]]]]0[00000010[1]0[010[1]]0[0010[1]0[010[1]]]0[00010[1]0[010[1]]0[0010[1]0[010[1]]]]0[000010[1]0[010[1]]0[0010[1]0[010[1]]]0[00010[1]0[010[1]]0[0010[1]0[010[1]]]]]0[0000010[1]0[010[1]]0[0010[1]0[010[1]]]0[00010[1]0[010[1]]0[0010[1]0[010[1]]]]0[000010[1]0[010[1]]0[0010[1]0[010[1]]]0[00010[1]0[010[1]]0[0010[1]0[010[1]]]]]]]0[000000010[1]0[010[1]]0[0010[1]0[010[1]]]0[00010[1]0[010[1]]0[0010[1]0[010[1]]]]0[000010[1]0[010[1]]0[0010[1]0[010[1]]]0[00010[1]0[010[1]]0[0010[1]0[010[1]]]]]0[0000010[1]0[010[1]]0[0010[1]0[010[1]]]0[00010[1]0[010[1]]0[0010[1]0[010[1]]]]0[000010[1]0[010[1]]0[0010[1]0[010[1]]]0[00010[1]0[010[1]]0[0010[1]0[010[1]]]]]]0[00000010[1]0[010[1]]0[0010[1]0[010[1]]]0[00010[1]0

Let’s modify the command I provided earlier to instead reset the value of this variable:

~function(name){
    dataService.setVariable('time2wait', {}, $('td:contains("' + name + '")').scope().piston.id)
}('My Piston Name Here');

#36

That worked - thank you very much.

I’m confused as to why this happened to this piston but not the one I retrieved by using this pistons backup code?

But thank you for fixing it for me and for explaining where I went wrong, I think i must have just selected it by mistake!


#37

The duplicate piston may just not have been running long enough to build up enough garbage data. The current variable values are not included in backup codes.