Spaces:
Running
Running
Debug: find all SQLite files and check symlink target
Browse files- 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 |
-
|
| 818 |
-
|
| 819 |
-
|
| 820 |
-
|
| 821 |
-
if
|
| 822 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|