Global variables - error when attempting to delete

@bravenel

I just upgraded to 2.1.0 but happened to discover this issue earlier today under 2.0.9.133

See screenshots. I have a single global variable (integer) that I no longer need to use. None of my rules currently reference it. However, when I attempt to delete the global variable I receive the following error. Any suggestions on how to resolve this?

That's not good. First thing is you have to restore to your last backup. Then delete the global variable using the Delete Global Variable on the GV page. Don't use Remove All. I will track down the problem.

Thanks Bruce,

Unfortunately I'm not sure if a restore from last backup will help me as I discovered this error earlier today while I was running version 2.0.9.133. I don't think I have a backup version earlier than 2.0.9.133 to restore to. Fwiw, I'm not experiencing any performance issues with this. However, I can confirm I can no longer even create a new global variable either. I get the same error.

I haven't used this global variable for at least a month, I was just trying to do a little maintenance/cleanup of unused stuff...

Check your backups, you should have one from last night. You need to restore from a backup or you will never be able to use Global Variables (or we would have to fix your database). Please check and let me know.

Well this doesn't look good! I'm unable to restore using last night's backup. See screenshot. I attempted this twice. Same result both times.

Good news is that everything continues to work fine under 2.1.0.117 except for the global variables issue. I may be a candidate for having a database fix, whatever that entails. :frowning:

This is the global variable that's causing the mayhem... Like I said previously, I haven't used this for about a month or so. Just can't delete it!

@bravenel

Here's a final update on this issue.

(TL/DR: I fixed it, no further assistance needed.)

I ended up removing the entire instance of Rule Machine, which blew away every one of my existing rules (all 45 of them), but it also completely eliminated all these "phantom" references to global variables I no longer used.

I wish I had a better understanding of how/why this problem manifested itself in the first place! It turns out there were references to not one but three old GVs, ones that I briefly created, used and abandoned well over a month ago (definitely prior to the release of RM 3.0). I discovered these old GV references by clicking the gear icon under my previously installed instance of RM. Anyway, I removed RM completely and rebooted the hub for good measure, then installed a brand new instance of RM.

Yes, it was a pain to re-create all the rules from scratch but: 1) it's allowed me to now have every rule be a RM 3.0 version and 2) it forced me to revisit everything, giving me a good opportunity to consolidate and reduce the overall number of rules (thanks to the big improvements in RM 3.0).

Thanks all, carry on!

3 Likes

That's the spirit!