summary refs log tree commit diff
path: root/synapse/_scripts
diff options
context:
space:
mode:
authorShay <hillerys@element.io>2023-03-22 08:36:42 -0700
committerGitHub <noreply@github.com>2023-03-22 08:36:42 -0700
commit7f02fafa28b112fe9d136dc3fcb8799f5958fb95 (patch)
tree7f19f8bafc7459b4259dadd5653b67fd52ed3df2 /synapse/_scripts
parentBump dtolnay/rust-toolchain from e12eda571dc9a5ee5d58eecf4738ec291c66f295 to ... (diff)
downloadsynapse-7f02fafa28b112fe9d136dc3fcb8799f5958fb95.tar.xz
Add a check to SQLite port DB script to ensure that the sqlite database passed to the script exists before trying to port from it (#15306)
Diffstat (limited to 'synapse/_scripts')
-rwxr-xr-xsynapse/_scripts/synapse_port_db.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/_scripts/synapse_port_db.py b/synapse/_scripts/synapse_port_db.py
index 78d76d38ad..94b86c1d6f 100755
--- a/synapse/_scripts/synapse_port_db.py
+++ b/synapse/_scripts/synapse_port_db.py
@@ -18,6 +18,7 @@
 import argparse
 import curses
 import logging
+import os
 import sys
 import time
 import traceback
@@ -1326,6 +1327,13 @@ def main() -> None:
         filename="port-synapse.log" if args.curses else None,
     )
 
+    if not os.path.isfile(args.sqlite_database):
+        sys.stderr.write(
+            "The sqlite database you specified does not exist, please check that you have the"
+            "correct path."
+        )
+        sys.exit(1)
+
     sqlite_config = {
         "name": "sqlite3",
         "args": {