Author Topic: stop workflow in race condition  (Read 214 times)

Offline pls90

  • Sr. Member
  • ****
  • Posts: 314
  • Karma: +2/-0
stop workflow in race condition
« on: January 09, 2019, 01:27:02 pm »
Without changing anything on my setup I found I could not load AltUI on my openluup pi.
Looking into this there seems to be a race condition in workflow 151
Code: [Select]
2019-01-09 19:21:07.156   luup_log:3: ALTUI: Wkflow - Workflow: 0-151, Valid Transition found:is_low_, Active State:no_sun=>low_altitude
2019-01-09 19:21:07.160   luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.Timers was: [{"expireson":1547059142,"callback":"workflowTimerCB","data":"3#15#9e5f08a2-57ef-4877-aa4a-8179b666b7f1#1a1a947e-7b... now: [{"expireson":1547059142,"callback":"workflowTimerCB","data":"3#15#9e5f08a2-57ef-4877-aa4a-8179b666b7f1#1a1a947e-7b... #hooks:0
2019-01-09 19:21:07.163   luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.WorkflowsActiveState was: {"0-135":"44024446-4329-4a4b-bca4-67c2ba4be490","0-120":"109f8d63-060b-4fbc-9361-493bd827b791","0-31":"7e6a4afa-c55... now: {"0-135":"44024446-4329-4a4b-bca4-67c2ba4be490","0-120":"109f8d63-060b-4fbc-9361-493bd827b791","0-31":"7e6a4afa-c55... #hooks:0
2019-01-09 19:21:07.171   luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.WorkflowsVariableBag was: {"0-135":{"altitude_twilight":-5},"0-71":[],"0-148":[],"0-117":{"no_sun":50,"open_low":55,"high":70,"azimuth_min":1... now: {"0-135":{"altitude_twilight":-5},"0-71":[],"0-148":[],"0-117":{"no_sun":50,"open_low":55,"high":70,"azimuth_min":1... #hooks:0
2019-01-09 19:21:07.214   luup_log:3: ALTUI: Wkflow - Workflow: 0-151, Valid Transition found:wrong_azimut__, Active State:low_altitude=>no_sun
2019-01-09 19:21:07.217   luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.Timers was: [{"expireson":1547059142,"callback":"workflowTimerCB","data":"3#15#9e5f08a2-57ef-4877-aa4a-8179b666b7f1#1a1a947e-7b... now: [{"expireson":1547059142,"callback":"workflowTimerCB","data":"3#15#9e5f08a2-57ef-4877-aa4a-8179b666b7f1#1a1a947e-7b... #hooks:0
2019-01-09 19:21:07.221   luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.WorkflowsActiveState was: {"0-135":"44024446-4329-4a4b-bca4-67c2ba4be490","0-120":"109f8d63-060b-4fbc-9361-493bd827b791","0-31":"7e6a4afa-c55... now: {"0-135":"44024446-4329-4a4b-bca4-67c2ba4be490","0-120":"109f8d63-060b-4fbc-9361-493bd827b791","0-31":"7e6a4afa-c55... #hooks:0
2019-01-09 19:21:07.228   luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.WorkflowsVariableBag was: {"0-135":{"altitude_twilight":-5},"0-71":[],"0-148":[],"0-117":{"no_sun":50,"open_low":55,"high":70,"azimuth_min":1... now: {"0-135":{"altitude_twilight":-5},"0-71":[],"0-148":[],"0-117":{"no_sun":50,"open_low":55,"high":70,"azimuth_min":1... #hooks:0
this goes on forever.
As the gui is not responding anymore, is there a way to disable workflow mode from the command line on my pi?
Any pointer is highly appreciated!

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3164
  • Karma: +209/-8
Re: stop workflow in race condition
« Reply #1 on: January 09, 2019, 04:04:18 pm »
Without changing anything on my setup I found I could not load AltUI on my openluup pi.
Looking into this there seems to be a race condition in workflow 151
Code: [Select]
2019-01-09 19:21:07.156   luup_log:3: ALTUI: Wkflow - Workflow: 0-151, Valid Transition found:is_low_, Active State:no_sun=>low_altitude
2019-01-09 19:21:07.160   luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.Timers was: [{"expireson":1547059142,"callback":"workflowTimerCB","data":"3#15#9e5f08a2-57ef-4877-aa4a-8179b666b7f1#1a1a947e-7b... now: [{"expireson":1547059142,"callback":"workflowTimerCB","data":"3#15#9e5f08a2-57ef-4877-aa4a-8179b666b7f1#1a1a947e-7b... #hooks:0
2019-01-09 19:21:07.163   luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.WorkflowsActiveState was: {"0-135":"44024446-4329-4a4b-bca4-67c2ba4be490","0-120":"109f8d63-060b-4fbc-9361-493bd827b791","0-31":"7e6a4afa-c55... now: {"0-135":"44024446-4329-4a4b-bca4-67c2ba4be490","0-120":"109f8d63-060b-4fbc-9361-493bd827b791","0-31":"7e6a4afa-c55... #hooks:0
2019-01-09 19:21:07.171   luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.WorkflowsVariableBag was: {"0-135":{"altitude_twilight":-5},"0-71":[],"0-148":[],"0-117":{"no_sun":50,"open_low":55,"high":70,"azimuth_min":1... now: {"0-135":{"altitude_twilight":-5},"0-71":[],"0-148":[],"0-117":{"no_sun":50,"open_low":55,"high":70,"azimuth_min":1... #hooks:0
2019-01-09 19:21:07.214   luup_log:3: ALTUI: Wkflow - Workflow: 0-151, Valid Transition found:wrong_azimut__, Active State:low_altitude=>no_sun
2019-01-09 19:21:07.217   luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.Timers was: [{"expireson":1547059142,"callback":"workflowTimerCB","data":"3#15#9e5f08a2-57ef-4877-aa4a-8179b666b7f1#1a1a947e-7b... now: [{"expireson":1547059142,"callback":"workflowTimerCB","data":"3#15#9e5f08a2-57ef-4877-aa4a-8179b666b7f1#1a1a947e-7b... #hooks:0
2019-01-09 19:21:07.221   luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.WorkflowsActiveState was: {"0-135":"44024446-4329-4a4b-bca4-67c2ba4be490","0-120":"109f8d63-060b-4fbc-9361-493bd827b791","0-31":"7e6a4afa-c55... now: {"0-135":"44024446-4329-4a4b-bca4-67c2ba4be490","0-120":"109f8d63-060b-4fbc-9361-493bd827b791","0-31":"7e6a4afa-c55... #hooks:0
2019-01-09 19:21:07.228   luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.WorkflowsVariableBag was: {"0-135":{"altitude_twilight":-5},"0-71":[],"0-148":[],"0-117":{"no_sun":50,"open_low":55,"high":70,"azimuth_min":1... now: {"0-135":{"altitude_twilight":-5},"0-71":[],"0-148":[],"0-117":{"no_sun":50,"open_low":55,"high":70,"azimuth_min":1... #hooks:0
this goes on forever.
As the gui is not responding anymore, is there a way to disable workflow mode from the command line on my pi?
Any pointer is highly appreciated!

you need to debug the workflow
to disable workflows all together you need to set the variable"EnableWorkflows" of ALTUI device to 0,  there must be a way to do this in openluup from the cmd line but not sure how.


Offline pls90

  • Sr. Member
  • ****
  • Posts: 314
  • Karma: +2/-0
Re: stop workflow in race condition
« Reply #2 on: January 10, 2019, 01:55:27 pm »
I was lucky, the conditions stopped to fire and I was able to deactivate the workflow.
@amg0 would it be possible to find a way to detect race conditions and then automatically deactivate the rouge workflow? Would be a very useful feature.

Gesendet von meinem SM-G930F mit Tapatalk


Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6343
  • Karma: +288/-70
  • "Less is more"
Re: stop workflow in race condition
« Reply #3 on: January 10, 2019, 05:28:09 pm »
to disable workflows all together you need to set the variable"EnableWorkflows" of ALTUI device to 0,  there must be a way to do this in openluup from the cmd line but not sure how.

The system should still be able to respond to HTTP requests, so the &id=setvariable request should have been able to accomplish this.

Not needed now, though...
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline powisquare

  • Full Member
  • ***
  • Posts: 146
  • Karma: +1/-0
Re: stop workflow in race condition
« Reply #4 on: February 11, 2019, 05:54:04 pm »
Hello - looking for advice on how to set the variable "EnableWorkflows" via cmd line if possible? Also on openLuup

Online rigpapa

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1046
  • Karma: +167/-1
Re: stop workflow in race condition
« Reply #5 on: February 11, 2019, 05:57:41 pm »
Hello - looking for advice on how to set the variable "EnableWorkflows" via cmd line if possible? Also on openLuup

Can you not just stop openLuup, open user_data.json in vi or nano, find the variable, and edit it? openLuup seems to keep user_data.json in "pretty" format, so it's straightforward to edit its contents.
Author of Reactor, DelayLight, SiteSensor, Rachio, Deus Ex Machina II, Intesis WMP Gateway, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3, Lite. Hassio, Slapdash.

Offline powisquare

  • Full Member
  • ***
  • Posts: 146
  • Karma: +1/-0
Re: stop workflow in race condition
« Reply #6 on: February 12, 2019, 05:19:00 am »
Great thanks - did the trick.