underground-software / singularity

KDLP: Beyond the event horizon
https://kdlp.underground.software
GNU General Public License v3.0
0 stars 5 forks source link

restoring from backup is broken #179

Closed theyoyojo closed 1 month ago

theyoyojo commented 1 month ago

orbit cannot write to the database, resulting in 502 error.

Orbit logs contain a traceback:

Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/peewee.py", line 3311, in execute_sql
    cursor.execute(sql, params or ())
sqlite3.OperationalError: attempt to write a readonly database
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "radius.py", line 558, in application
    return handle_login(rocket)
           ^^^^^^^^^^^^^^^^^^^^
  File "radius.py", line 343, in handle_login
    if not rocket.launch():
           ^^^^^^^^^^^^^^^
  File "radius.py", line 243, in launch
    new_ses = Session(username=username)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "radius.py", line 98, in init
    .execute())
     ^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/peewee.py", line 2025, in inner
    return method(self, database, *args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/peewee.py", line 2096, in execute
    return self._execute(database)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/peewee.py", line 2901, in _execute
    return super(Insert, self)._execute(database)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/peewee.py", line 2614, in _execute
    cursor = database.execute(self)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/peewee.py", line 3319, in execute
    return self.execute_sql(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/peewee.py", line 3309, in execute_sql
    with exception_wrapper:
  File "/usr/lib/python3.12/site-packages/peewee.py", line 3077, in exit**
    reraise(new_type, new_type(exc_value, *exc_args), traceback)
  File "/usr/lib/python3.12/site-packages/peewee.py", line 196, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3.12/site-packages/peewee.py", line 3311, in execute_sql
    cursor.execute(sql, params or ())
peewee.OperationalError: attempt to write a readonly database
[pid: 1|app: 0|req: 1/1] 10.89.2.37 () {62 vars in 1342 bytes} [Mon Sep 30 03:23:24 2024] POST /login?target=/dashboard => generated 0 bytes in 302 msecs (HTTP/1.0 500) 0 headers in 0 bytes (0 switches on core 0)
charliemirabile commented 1 month ago

Based on conversations had offline, it looks like this occurred while trying to restore while the containers were up because I was not able to reproduce locally. The process should be better documented, but doing so is covered by #162. As such, I am closing this issue