Announcement plugin unexpected error

Posted on
Thu Mar 24, 2022 10:00 am
tazswe offline
Posts: 211
Joined: Mar 13, 2017
Location: Sweden

Announcement plugin unexpected error

Hi,

I have got the followoing error after an automatic restart of my minimac. Not sure why the mac restarted, havnt done any upgrade or changes during the last month.
Im sure that the plugin worked yesterday.

Code: Select all
Announcements Error             Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 210, in runConcurrentThread
  File "plugin.py", line 707, in announcement_update_states
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 49, in literal_eval
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 37, in parse
SyntaxError: unexpected EOF while parsing (<unknown>, line 0)

   Announcements Error             plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)


I tried to restart both the plugin and the mac without succes.

Posted on
Thu Mar 24, 2022 10:18 am
tazswe offline
Posts: 211
Joined: Mar 13, 2017
Location: Sweden

Re: Announcement plugin unexpected error

Im getting the following when I restart the plugin

Code: Select all
Starting plugin "Announcements 1.0.19" (pid 2425)
   Announcements                   
   Announcements                   =================================================== Initializing New Plugin Session ===================================================
   Announcements                   Plugin name:                    Announcements
   Announcements                   Plugin version:                 1.0.19
   Announcements                   Plugin ID:                      com.fogbert.indigoplugin.announcements
   Announcements                   Indigo version:                 2021.2.0
   Announcements                   Python version:                 2.7.16 (default, Mar 25 2021, 03:11:28) [GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.20) (-macos10.15-objc-
   Announcements                   Mac OS Version:                 10.15.7
   Announcements                   Process ID:                     2425
   Announcements                   =======================================================================================================================================
   Started plugin "Announcements 1.0.19"
   Announcements Error             Error in plugin execution startup:

Traceback (most recent call last):
  File "plugin.py", line 235, in startup
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 49, in literal_eval
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 37, in parse
SyntaxError: ('unexpected EOF while parsing', ('<unknown>', 0, 0, ''))

   Announcements Error             Error in plugin execution CalcDeviceFunc:

Traceback (most recent call last):
  File "plugin.py", line 185, in getDeviceStateList
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 49, in literal_eval
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 37, in parse
SyntaxError: ('unexpected EOF while parsing', ('<unknown>', 0, 0, ''))

   Error                           device "Astro" state key onOffState not defined (ignoring update request)
   Error                           device "Astro" state key onOffState not defined (ignoring update request)
   Announcements Error             Error in plugin execution CalcDeviceFunc:

Traceback (most recent call last):
  File "plugin.py", line 185, in getDeviceStateList
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 49, in literal_eval
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 37, in parse
SyntaxError: ('unexpected EOF while parsing', ('<unknown>', 0, 0, ''))

   Error                           device "Bussavgångar" state key onOffState not defined (ignoring update request)
   Error                           device "Bussavgångar" state key onOffState not defined (ignoring update request)
   Announcements Error             Error in plugin execution CalcDeviceFunc:

Traceback (most recent call last):
  File "plugin.py", line 185, in getDeviceStateList
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 49, in literal_eval
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 37, in parse
SyntaxError: ('unexpected EOF while parsing', ('<unknown>', 0, 0, ''))

   Error                           device "Weather report" state key onOffState not defined (ignoring update request)
   Error                           device "Weather report" state key onOffState not defined (ignoring update request)
   Announcements Error             Error in plugin execution CalcDeviceFunc:

Traceback (most recent call last):
  File "plugin.py", line 185, in getDeviceStateList
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 49, in literal_eval
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 37, in parse
SyntaxError: ('unexpected EOF while parsing', ('<unknown>', 0, 0, ''))

   Error                           device "Weather report short" state key onOffState not defined (ignoring update request)
   Error                           device "Weather report short" state key onOffState not defined (ignoring update request)
   Announcements Error             Error in plugin execution CalcDeviceFunc:

Traceback (most recent call last):
  File "plugin.py", line 185, in getDeviceStateList
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 49, in literal_eval
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 37, in parse
SyntaxError: ('unexpected EOF while parsing', ('<unknown>', 0, 0, ''))

   Error                           device "Weatherforecast" state key onOffState not defined (ignoring update request)
   Error                           device "Weatherforecast" state key onOffState not defined (ignoring update request)
   Announcements Error             Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 210, in runConcurrentThread
  File "plugin.py", line 707, in announcement_update_states
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 49, in literal_eval
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 37, in parse
SyntaxError: unexpected EOF while parsing (<unknown>, line 0)

   Announcements Error             plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   
 
 

Posted on
Thu Mar 24, 2022 11:12 am
DaveL17 offline
User avatar
Posts: 6756
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Announcement plugin unexpected error

Really sorry to hear that you're having trouble. Given the way that Indigo runs plugins (and the simple nature of this plugin in particular) I don't think the Announcements plugin is the cause of the server restart (anything is possible of course).

It sounds like your announcements file may have become corrupted. In thinking through the possible causes, it may be that the server restart occurred during a read/write operation, but that *should* only be possible if you were actively editing an Announcements device at the time of the restart. On your server machine, take a look at this file:

Code: Select all
/Library/Application Support/Perceptive Automation/Indigo X.X/Preferences/Plugins/com.fogbert.indigoplugin.announcements.txt
where X.X is your Indigo server version number.

Does that file seem corrupted? If you're not sure and are comfortable doing so, please feel free to copy and paste that file into a reply (or DM).

Do you have the ability to restore that file from a recent backup? That might be the easiest next step.

(Regardless, I will add some additional code to the plugin to allow it to fail more gracefully in such circumstances.)

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Fri Mar 25, 2022 8:39 am
tazswe offline
Posts: 211
Joined: Mar 13, 2017
Location: Sweden

Re: Announcement plugin unexpected error

Hi Dave,
I have used Timemachine to go back to an earlier backup with no success, still not working.

I found the file and it is empty 0 byte and no text at all, the file was updated yesterday morning.

I also checked earlier version of Indigo.
Version 2021.2 empty file (current version)
Version 2021.1 txt
Code: Select all
  {}

Version 7.5 txt
Code: Select all
{55297992: {4490574232: {'Announcement': u'[[rate 155]]H\xe4r f\xf6ljer en prognos f\xf6r v\xe4derleken', 'nextRefresh': '2021-06-18 18:24:23', 'Name': u'Weatherforecast', 'Refresh': u'1'}, 4490574233: {'Announcement': u'[[rate 145]] %%v:1151773095%% s\xe5 blir det %%v:1686013240%% temperaturen f\xf6rv\xe4ntas bli [[slnc 800]] %%v:748159199%%  [[slnc 400]] grader', 'nextRefresh': '2021-06-18 18:24:23', 'Name': u'First', 'Refresh': u'1'}, 4490574234: {'Announcement': u'[[rate 155]] %%v:703872007%% s\xe5 blir det %%v:1913423697%% med en temperatur av [[slnc 900]] %%v:23391091%% grader', 'nextRefresh': '2021-06-18 18:24:23', 'Name': u'Second', 'Refresh': u'1'}, 4490574235: {'Announcement': u'%%v:1741000124%% f\xf6rv\xe4ntas det att bli %%v:368233614%% och en temperatur av [[slnc 900]] %%v:1475146709%% grader', 'nextRefresh': '2021-06-18 18:24:23', 'Name': u'Third', 'Refresh': u'1'}, 4490574236: {'Announcement': u'[[rate 150]] %%v:1889200675%% f\xf6rv\xe4ntas det %%v:243021263%% och en temperatur p\xe5 [[slnc 900]] %%v:1528778593%% grader.', 'nextRefresh': '2021-06-18 18:24:23', 'Name': u'Fourth', 'Refresh': u'1'}, 4490574237: {'Announcement': u'[[rate 150]]i morgon [[slnc 900]] %%v:119575975%% f\xf6rv\xe4ntas det %%v:1326842159%% samt en temperatur p\xe5 [[slnc 900]] %%v:198468595%% grader', 'nextRefresh': '2021-06-18 18:24:23', 'Name': u'Fifth', 'Refresh': u'1'}}, 1841577602: {4574001560: {'Announcement': u'Buss tidtabell', 'nextRefresh': '2021-06-18 18:24:23', 'Name': u'Bussar', 'Refresh': u'1'}, 4574001561: {'Announcement': u'Till %%v:141515829%% klockan %%v:1216376240%%', 'nextRefresh': '2021-06-18 18:24:23', 'Name': u'Buss 1', 'Refresh': u'1'}, 4574001562: {'Announcement': u'Till %%v:1584879595%% klockan %%v:1966122321%%', 'nextRefresh': '2021-06-18 18:24:23', 'Name': u'Buss 2', 'Refresh': u'1'}, 4574001563: {'Announcement': u'Till %%v:252326151%% klockan %%v:1054143202%%', 'nextRefresh': '2021-06-18 18:24:23', 'Name': u'Buss 3', 'Refresh': u'1'}, 4574001564: {'Announcement': u'Till %%v:1037331457%% klockan %%v:1203993103%%', 'nextRefresh': '2021-06-18 18:24:23', 'Name': u'Buss 4', 'Refresh': u'1'}}, 88990564: {4459321752: {'Announcement': u'Solens uppg\xe5ng \xe4r klockan [[slnc 600]] %%v:414544460%%  [[slnc 1000]] den g\xe5r ner klockan  [[slnc 600]] %%v:1735889739%% ', 'nextRefresh': '2021-06-18 18:24:23', 'Name': u'Sun', 'Refresh': u'1'}, 4459321753: {'Announcement': u'Det \xe4r  %%v:1421657254%% [[slnc 800]] m\xe5nens uppg\xe5ng \xe4r klockan [[slnc 600]] %%v:106548432%%  [[slnc 1000]] den g\xe5r ner klockan  [[slnc 600]] %%v:693862244%%', 'nextRefresh': '2021-06-18 18:24:23', 'Name': u'Moon', 'Refresh': u'1'}}, 1952300390: {4574001560: {'Announcement': u'[[rate 160]] Hej. [[slnc 600]] << Temperaturen \xe4r som f\xf6ljer.>>[[slnc 1000]] Utomhus [[slnc 600]] %%d:210179527:temperature%% grader.[[slnc 600]]uterummet [[slnc 400]] %%d:1431592887:sensorValue%% grader', 'nextRefresh': '2021-06-18 18:24:23', 'Name': u'Weather short', 'Refresh': u'1'}}, 449975430: {4474141080: {'Announcement': u'[[rate140]] Hej<< V\xe4dret \xe4r som f\xf6ljer.>> [[slnc 400]] Temperaturen utomhus \xe4r %%d:210179527:temperature%% grader, och i uterummet %%d:1431592887:sensorValue%% grader,  [[slnc 400]]  , vindstyrkan \xe4r %%d:841041761:wind_average%% meter per sekund med byar upp till  %%d:841041761:wind_gust%% [[slnc 400]] Vindriktningen \xe4r %%v:1996412621%%.  [[slnc 400]] Det har regnat %%d:841041761:rain_accumulated%% millimeter det senaste dygnet.', 'nextRefresh': '2021-06-18 18:24:23', 'Name': u'Weather report', 'Refresh': u'1'}}}

Posted on
Fri Mar 25, 2022 11:27 am
DaveL17 offline
User avatar
Posts: 6756
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Announcement plugin unexpected error

Ok, if those prior backups are also "empty", it has been borked for a while. Hopefully, the following steps will work.

  1. Stop the Announcements plugin.
  2. Replace the Announcements.txt file that is "empty" (empty braces) with the last good version (the one you posted above). Be sure to use a plain text editor.
  3. Restart the plugin.
  4. Wait for it to run through a complete cycle (the time this takes will depend on your refresh settings). You may be able to select "Refresh Announcements" from the plugin menu.
This should refresh the devices to the last healthy state.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sun Mar 27, 2022 1:36 am
tazswe offline
Posts: 211
Joined: Mar 13, 2017
Location: Sweden

Re: Announcement plugin unexpected error

Thanks a lot Dave,

Followed your instructions and it is up and running again.

Posted on
Sun Mar 27, 2022 4:13 am
DaveL17 offline
User avatar
Posts: 6756
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Announcement plugin unexpected error

Glad to hear that worked.

Also a good reminder of how important it is to have backups! :)

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests