Hodfa71 commited on
Commit
d106603
·
verified ·
1 Parent(s): 1938c78

Debug: find all SQLite files and check symlink target

Browse files
Files changed (1) hide show
  1. ls_proxy_hf.py +12 -6
ls_proxy_hf.py CHANGED
@@ -814,12 +814,18 @@ def proxy_db_projects():
814
  debug["db_files"] = db_files
815
  debug["db_path"] = DB_PATH
816
  debug["db_path_exists"] = os.path.exists(DB_PATH)
817
- wal = DB_PATH + "-wal"
818
- shm = DB_PATH + "-shm"
819
- debug["wal_exists"] = os.path.exists(wal)
820
- debug["shm_exists"] = os.path.exists(shm)
821
- if os.path.exists(wal):
822
- debug["wal_size"] = os.path.getsize(wal)
 
 
 
 
 
 
823
  except Exception as e:
824
  debug["list_error"] = str(e)
825
  # Get journal mode
 
814
  debug["db_files"] = db_files
815
  debug["db_path"] = DB_PATH
816
  debug["db_path_exists"] = os.path.exists(DB_PATH)
817
+ # Find ALL sqlite files in /data/
818
+ import subprocess
819
+ result = subprocess.run(["find", "/data", "-name", "*.sqlite3", "-type", "f"],
820
+ capture_output=True, text=True, timeout=5)
821
+ debug["all_sqlite_files"] = result.stdout.strip().split("\n") if result.stdout.strip() else []
822
+ # Also check /label-studio/data symlink target
823
+ import os.path
824
+ ls_data = "/label-studio/data"
825
+ if os.path.islink(ls_data):
826
+ debug["ls_data_link"] = os.readlink(ls_data)
827
+ elif os.path.isdir(ls_data):
828
+ debug["ls_data_dir"] = "is a directory (not symlink)"
829
  except Exception as e:
830
  debug["list_error"] = str(e)
831
  # Get journal mode