Recovered from crash => fail to start weewx

76 views
Skip to first unread message

Juha U

unread,
May 18, 2022, 8:11:37 AM5/18/22
to weewx-user

Hello!

I had a long running WeeWx on Raspberry. Unfortunately it died in the middle of running apt upgrade so finally resorted to reinstall OS and WeeWx. Well, not so big deal I thought, had backups of configs & database files on NAS.

However, now WeeWx fails to start and I can't get my head around what's the real issue behind this error:

MySQLdb._exceptions.InternalError: (29, 'File \'./weewx/archive.TRG\' not found (Errcode: 13 "Permission denied")')

Tried with my previously working config as well as the one that install script created modifying necessities into that. No difference. MySQL credentials are fine, connection works using cmd line mysql client. WEEWX_ROOT is /home/weewx and all owned by root. If I run sudo bin/weewxd, I still get the same.

Any thoughts? Longer crash report below.

Thanks a lot for any insights on where to dig or what to try next!

BR, Juha


------------------------

Traceback (most recent call last):
  File "/home/weewx/bin/weedb/mysql.py", line 54, in guarded_fn
    return fn(*args, **kwargs)
  File "/home/weewx/bin/weedb/mysql.py", line 210, in columnsOf
    column_list = [row[1] for row in self.genSchemaOf(table)]
  File "/home/weewx/bin/weedb/mysql.py", line 210, in <listcomp>
    column_list = [row[1] for row in self.genSchemaOf(table)]
  File "/home/weewx/bin/weedb/mysql.py", line 183, in genSchemaOf
    cursor.execute("""SHOW COLUMNS IN %s;""" % table)
  File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 209, in execute
    res = self._query(query)
  File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 315, in _query
    db.query(q)
  File "/usr/lib/python3/dist-packages/MySQLdb/connections.py", line 226, in query
    _mysql.connection.query(self, query)
MySQLdb._exceptions.InternalError: (29, 'File \'./weewx/archive.TRG\' not found (Errcode: 13 "Permission denied")')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/weewx/bin/weewxd", line 248, in <module>
    main()
  File "/home/weewx/bin/weewxd", line 147, in main
    engine = weewx.engine.StdEngine(config_dict)
  File "/home/weewx/bin/weewx/engine.py", line 93, in __init__
    self.loadServices(config_dict)
  File "/home/weewx/bin/weewx/engine.py", line 161, in loadServices
    obj = weeutil.weeutil.get_object(svc)(self, config_dict)
  File "/home/weewx/bin/weewx/wxservices.py", line 104, in __init__
    self.db_manager = engine.db_binder.get_manager(data_binding=data_binding,
  File "/home/weewx/bin/weewx/manager.py", line 597, in get_manager
    self.manager_cache[data_binding] = open_manager(manager_dict, initialize)
  File "/home/weewx/bin/weewx/manager.py", line 745, in open_manager
    return manager_cls.open_with_create(manager_dict['database_dict'],
  File "/home/weewx/bin/weewx/manager.py", line 164, in open_with_create
    dbmanager = cls(connection, table_name=table_name, schema=schema)
  File "/home/weewx/bin/weewx/manager.py", line 884, in __init__
    super(DaySummaryManager, self).__init__(connection, table_name, schema)
  File "/home/weewx/bin/weewx/manager.py", line 83, in __init__
    self.sqlkeys = self.connection.columnsOf(self.table_name)
  File "/home/weewx/bin/weedb/mysql.py", line 63, in guarded_fn
    raise klass(e)
weedb.DatabaseError: (29, 'File \'./weewx/archive.TRG\' not found (Errcode: 13 "Permission denied")')

Tom Keffer

unread,
May 18, 2022, 8:38:25 AM5/18/22
to weewx-user
The suffix ".TRG" is a trigger file. Why a trigger file would be associated with WeeWX, I have no idea --- they are not used anywhere in WeeWX.

Were you using some custom code that uses triggers? Perhaps when you restored things, you didn't restore the trigger files? I'm not an expert at this, but I believe they live in /var/lib/mysql-files.

You should be able to see them using "SHOW TRIGGERS IN weewx;"

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/abefdd2d-663a-4486-a10b-11f7023fb523n%40googlegroups.com.

Juha Utriainen

unread,
May 18, 2022, 10:48:29 AM5/18/22
to weewx...@googlegroups.com

Hello Tom and big thanks for your fast reply!

Bit of a face palm moment: Most probably you pointed out my mistake. I indeed have a trigger to calculate daily averages and heatsums as per Finnish standard (tried to do that in reports but eventually gave up temporarily :/ ) I was thinking that all mysql db stuff is on mounted fs. Checking the suffix did not cross my simple mind.

Anyways, once back at desk I'll surely check that.

Thanks a lot for great pointer!

BR,
Juha



You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/GVrR7eWpFNI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAPq0zEDsKzgeRcz8rUoyGx346uWkwksc%3DcyRj%3DdPCMn_DBD4Yw%40mail.gmail.com.

Juha Utriainen

unread,
May 19, 2022, 11:23:37 AM5/19/22
to weewx...@googlegroups.com
Hello again!

Turned out to be great pointer. The issue was in weird mix of UIDs in
file ownerships in the mysql data dir. Fixed those and all good.

Thanks a lot for all the great work & help with WeeWx!

Have a great spring!

BR,
Juha

Tom Keffer

unread,
May 19, 2022, 11:27:52 AM5/19/22
to weewx-user
Glad to hear it ended well.

Reply all
Reply to author
Forward
0 new messages