sdn-sense / siterm

Apache License 2.0
3 stars 5 forks source link

DB Reset in case of mistaken removal #430

Closed juztas closed 8 months ago

juztas commented 8 months ago

The startup should precheck if db is available, if not - then pre-create it again.

│ Host 2605:d9c0:0:fe06::1 not found in ~/.ssh/known_hosts. Running ssh-keyscan                                                                                                                                                                                              │
│ Traceback (most recent call last):                                                                                                                                                                                                                                         │
│   File "<string>", line 1, in <module>                                                                                                                                                                                                                                     │
│   File "/usr/lib/python3.9/site-packages/SiteRMSiteFE-1.3.12-py3.9.egg/SiteRMLibs/DBBackend.py", line 68, in _createdb                                                                                                                                                     │
│     conn, cursor = self.initialize()                                                                                                                                                                                                                                       │
│   File "/usr/lib/python3.9/site-packages/SiteRMSiteFE-1.3.12-py3.9.egg/SiteRMLibs/DBBackend.py", line 98, in initialize                                                                                                                                                    │
│     conn = mariadb.connect(user=self.muser,                                                                                                                                                                                                                                │
│ mariadb.ProgrammingError: Unknown database 'sitefe'
juztas commented 8 months ago

Having a second thought - this might give more problems, then real solution. Admin restarts FE, but lost db, means if there was anything provisioned - all will be gone, removed. This makes model unstable. It is better for it to complain with database error - and start fresh (once orchestrator is instructed about lost resources)