Software > WeeWX
Weewx no genera archivo anual
pachu:
Hola
Me he dado cuenta que desde Junio,Weewx no me genera el archivo anual.
He accedido a la dirección /var/www/html/weewx/NOAA y borrado el archivo 2021.txt,reiniciado la raspi y no lo genera de nuevo.También la plantilla /etc/weewx/skins/neowx/NOAA-YYY.txt.tmpl la he metido de nuevo de una copia de seguridad y nada,en camio los meses sin problema ???
Saludos
jmviper:
Hola pachu.
Has tocado algo del archivo skin.conf o de la plantilla del año NOAA/NOAA-YYYY.txt.tmpl ?? Mira el log de weewx por si sale algún fallo.
En el skin.conf deberás de tener la línea:
[[SummaryByYear]]
# Reports that summarize "by year"
[[[NOAA_year]]]
encoding = strict_ascii
template = NOAA/NOAA-YYYY.txt.tmpl
y mirar que la plantilla esté efectivamente allí y no esté corrupta.
pachu:
Hola
No he tocado nada del skin y la plantilla está en su sitio.
Si veo en el log error pero no consigo descifrar a que se refiere exactamente el problema de la plantilla NOOA.
Saludos y gracias :)
--- Código: ---Oct 6 19:40:14 raspberrypi weewx[1174] INFO weewx.manager: Added record 2021-10-06 19:40:00 CEST (1633542000) to database 'weewx.sdb'
Oct 6 19:40:14 raspberrypi weewx[1174] INFO weewx.manager: Added record 2021-10-06 19:40:00 CEST (1633542000) to daily summary in 'weewx.sdb'
Oct 6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: Generate failed with exception '<type 'exceptions.ValueError'>'
Oct 6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/neowx/NOAA/NOAA-YYYY.txt.tmpl
Oct 6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** Reason: invalid literal for int() with base 10: ''
Oct 6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** Traceback (most recent call last):
Oct 6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** File "/usr/share/weewx/weewx/cheetahgenerator.py", line 322, in generate
Oct 6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** unicode_string = compiled_template.respond()
Oct 6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** File "_etc_weewx_skins_neowx_NOAA_NOAA_YYYY_txt_tmpl.py", line 719, in respond
Oct 6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** File "_etc_weewx_skins_neowx_NOAA_NOAA_YYYY_txt_tmpl.py", line 281, in __errorCatcher23
Oct 6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** File "<string>", line 1, in <module>
Oct 6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** File "/usr/share/weewx/weewx/tags.py", line 347, in __getattr__
Oct 6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** return self._do_query(aggregate_type)
Oct 6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** File "/usr/share/weewx/weewx/tags.py", line 364, in _do_query
Oct 6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** db_manager, val=val, **self.option_dict)
Oct 6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** File "/usr/share/weewx/weewx/xtypes.py", line 102, in get_aggregate
Oct 6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** **option_dict)
Oct 6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** File "/usr/share/weewx/weewx/xtypes.py", line 458, in get_aggregate
Oct 6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** value = int(row[0])
Oct 6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** ValueError: invalid literal for int() with base 10: ''
Oct 6 19:40:18 raspberrypi weewx[1174] INFO weewx.cheetahgenerator: Generated 9 files for report SeasonsReport in 1.76 seconds
Oct 6 19:40:53 raspberrypi weewx[1174] INFO weewx.imagegenerator: Generated 12 images for report SeasonsReport in 35.65 seconds
Oct 6 19:40:53 raspberrypi weewx[1174] INFO weewx.reportengine: Copied 17 files to /var/www/html/weewx
Oct 6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine: ftpgenerator: (0): caught exception '<class 'socket.error'>': [Errno 111] Conexión rehusada
Oct 6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine: **** Traceback (most recent call last):
Oct 6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine: **** File "/usr/share/weewx/weewx/reportengine.py", line 330, in run
Oct 6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine: **** n = ftp_data.run()
Oct 6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine: **** File "/usr/share/weewx/weeutil/ftpupload.py", line 163, in run
Oct 6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine: **** ftp_server.storbinary(stor_cmd, fd)
Oct 6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine: **** File "/usr/lib/python2.7/ftplib.py", line 479, in storbinary
Oct 6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine: **** conn = self.transfercmd(cmd, rest)
Oct 6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine: **** File "/usr/lib/python2.7/ftplib.py", line 378, in transfercmd
Oct 6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine: **** return self.ntransfercmd(cmd, rest)[0]
Oct 6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine: **** File "/usr/lib/python2.7/ftplib.py", line 337, in ntransfercmd
Oct 6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine: **** conn = socket.create_connection((host, port), self.timeout)
Oct 6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine: **** File "/usr/lib/python2.7/socket.py", line 575, in create_connection
Oct 6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine: **** raise err
Oct 6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine: **** error: [Errno 111] Conexión rehusada
--- Fin del código ---
jmviper:
El último error es este:
ERROR weewx.cheetahgenerator: **** ValueError: invalid literal for int() with base 10: ''
Ese error lo da Python si encuentra un string al convertirlo a número. Por ejemplo:
>>> a=''
>>> print(int(a))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: ''
Si en la consola de Python le damos a la variable a (una inventada) el valor vacío de string a = '' al convertirlo a número suelta ese error por lo que sospecho que se habrá quedado algún valor así en la BBDD.
Detén weewx y ejecuta este comando:
sudo wee_database --check-strings
y cuando termine este otro:
sudo wee_database --fix-strings
No sé si te notificará de los errores que haya corregido. Después pon weewx en marcha a ver si se ha solucionado el problema.
pachu:
Hola
Creo que efectivamente el error viene de alguna línea dela BBDD,hace unos meses me dió guerra :;
--- Código: ---root@raspberrypi:~# sudo /etc/init.d/weewx stop
[ ok ] Stopping weewx (via systemctl): weewx.service.
root@raspberrypi:~# sudo wee_database --check-strings
Using configuration file /etc/weewx/weewx.conf
Using database binding 'wx_binding', which is bound to database 'archive_sqlite'
Preparing Null String Fix, this may take a while...
Checking record: 719283; Timestamp: 2021-10-12 10:40:00 CEST (1634028000)
No null strings found.
Completed Null String Check in 179.66 seconds.
root@raspberrypi:~# sudo wee_database --fix-strings
Using configuration file /etc/weewx/weewx.conf
Using database binding 'wx_binding', which is bound to database 'archive_sqlite'
Preparing Null String Fix, this may take a while...
Checking record: 719283; Timestamp: 2021-10-12 10:40:00 CEST (1634028000)
No null strings found.
Applied Null String Fix in 179.80 seconds.
root@raspberrypi:~# sudo /etc/init.d/weewx start
[ ok ] Starting weewx (via systemctl): weewx.service.
root@raspberrypi:~# sudo tail -f /var/log/weewx.log
Oct 7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/neowx/NOAA/NOAA-YYYY.txt.tmpl
Oct 7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** Reason: invalid literal for int() with base 10: ''
Oct 7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** Traceback (most recent call last):
Oct 7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** File "/usr/share/weewx/weewx/cheetahgenerator.py", line 322, in generate
Oct 7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** unicode_string = compiled_template.respond()
Oct 7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** File "_etc_weewx_skins_neowx_NOAA_NOAA_YYYY_txt_tmpl.py", line 719, in respond
Oct 7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** File "_etc_weewx_skins_neowx_NOAA_NOAA_YYYY_txt_tmpl.py", line 281, in __errorCatcher23
Oct 7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** File "<string>", line 1, in <module>
Oct 7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** File "/usr/share/weewx/weewx/tags.py", line 347, in __getattr__
Oct 7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** return se
--- Fin del código ---
Navegación
[#] Página Siguiente
Ir a la versión completa