glennmckechnie / weewx-wxobs

extracts archival data from the weewx database using php
GNU General Public License v3.0
7 stars 1 forks source link

Unrecoverable exception #6

Closed petercoxphoto closed 4 years ago

petercoxphoto commented 4 years ago

I've installed this, restarted weewx and get the following error in syslog: Nov 20 10:01:00 weatherpi weewx[3462]: reportengine: Caught unrecoverable exception in generator 'weewx.cheetahgenerator.Che etahGenerator' Nov 20 10:01:00 weatherpi weewx[3462]: **** [Errno 2] No such file or directory: '/usr/share/php/wxobs_weewx.inc' Nov 20 10:01:00 weatherpi weewx[3462]: **** Traceback (most recent call last): Nov 20 10:01:00 weatherpi weewx[3462]: **** File "/usr/share/weewx/weewx/reportengine.py", line 204, in run Nov 20 10:01:00 weatherpi weewx[3462]: **** obj.start() Nov 20 10:01:00 weatherpi weewx[3462]: **** File "/usr/share/weewx/weewx/reportengine.py", line 300, in start Nov 20 10:01:00 weatherpi weewx[3462]: **** self.run() Nov 20 10:01:00 weatherpi weewx[3462]: **** File "/usr/share/weewx/weewx/cheetahgenerator.py", line 157, in run Nov 20 10:01:00 weatherpi weewx[3462]: **** self.initExtensions(gen_dict[section_name]) Nov 20 10:01:00 weatherpi weewx[3462]: **** File "/usr/share/weewx/weewx/cheetahgenerator.py", line 201, in initE xtensions Nov 20 10:01:00 weatherpi weewx[3462]: **** self.search_list_objs.append(class_(self)) Nov 20 10:01:00 weatherpi weewx[3462]: **** File "/usr/share/weewx/user/wxobs.py", line 461, in __init__ Nov 20 10:01:00 weatherpi weewx[3462]: **** php_inc = open(self.include_file, 'w') Nov 20 10:01:00 weatherpi weewx[3462]: **** IOError: [Errno 2] No such file or directory: '/usr/share/php/wxobs_wee wx.inc' Nov 20 10:01:00 weatherpi weewx[3462]: **** Generator terminated Nov 20 10:01:00 weatherpi weewx[3462]: copygenerator: copied 0 files to /var/www/html/weewx/wxobs

Any ideas?

glennmckechnie commented 4 years ago
Nov 20 10:01:00 weatherpi weewx[3462]: reportengine: Caught unrecoverable exception in generator 'weewx.cheetahgenerator.Che etahGenerator' 
Nov 20 10:01:00 weatherpi weewx[3462]: **** [Errno 2] No such file or directory: '/usr/share/php/wxobs_weewx.inc' 
Nov 20 10:01:00 weatherpi weewx[3462]: **** Traceback (most recent call last): 
Nov 20 10:01:00 weatherpi weewx[3462]: **** File "/usr/share/weewx/weewx/reportengine.py", line 204, in run 
Nov 20 10:01:00 weatherpi weewx[3462]: **** obj.start() 
Nov 20 10:01:00 weatherpi weewx[3462]: **** File "/usr/share/weewx/weewx/reportengine.py", line 300, in start 
Nov 20 10:01:00 weatherpi weewx[3462]: **** self.run() 
Nov 20 10:01:00 weatherpi weewx[3462]: **** File "/usr/share/weewx/weewx/cheetahgenerator.py", line 157, in run 
Nov 20 10:01:00 weatherpi weewx[3462]: **** self.initExtensions(gen_dict[section_name]) 
Nov 20 10:01:00 weatherpi weewx[3462]: **** File "/usr/share/weewx/weewx/cheetahgenerator.py", line 201, in initE xtensions 
Nov 20 10:01:00 weatherpi weewx[3462]: **** self.search_list_objs.append(class_(self)) 
Nov 20 10:01:00 weatherpi weewx[3462]: **** File "/usr/share/weewx/user/wxobs.py", line 461, in __init__ 
Nov 20 10:01:00 weatherpi weewx[3462]: **** php_inc = open(self.include_file, 'w') 
Nov 20 10:01:00 weatherpi weewx[3462]: **** IOError: [Errno 2] No such file or directory: '/usr/share/php/wxobs_wee wx.inc' 
Nov 20 10:01:00 weatherpi weewx[3462]: **** Generator terminated 
Nov 20 10:01:00 weatherpi weewx[3462]: copygenerator: copied 0 files to /var/www/html/weewx/wxobs 

What's the weewx version that you are running, and what's the linux installation / flavor? (eg: Raspian, CentOS, Debian etc ??)

[Errno 2] No such file or directory: '/usr/share/php/wxobs_weewx.inc'

Basically, the include file is missing. Either it's not being generated (unlikely), or... File write permissions may be preventing it from being written to that location ( at /usr/share/php), (more likely). The directory also may not exist (unlikely but some variations of linux may have dropped the base directory).

There is a directive within the wxobs/skin.conf file that allows it to be relocated...

[wxobs]
        # This shouldn't need changing, but if it does then /tmp is a good
        # starting point. This will most likely be used with remote servers
        # using sqlite databases, see [Remote] below
#        include_path = '/tmp'

If you uncomment (remove the '#') on the include _path entry above (about line number 30) then the include file will be written to /tmp

        include_path = '/tmp'

You can put the file virtually anywhere but it also needs to be visible to the webserver which means that /var/www/html is also a valid location (but possibly less secure for an exposed, to the internet, webserver.)

glennmckechnie commented 4 years ago

v0.7.1 has been released.

This will fix a missing /usr/share/php directory that some installations have, assuming that was the cause in this case.

A default installation should now go back to its 'working out of the box' state.