Spaces:
Sleeping

axeronis commited on
Commit
35d2e8f
Β·
1 Parent(s): f5c6732

fix: add traceback to startup script for precise debugging

Browse files
Files changed (1) hide show
  1. backend/start.py +3 -6
backend/start.py CHANGED
@@ -3,6 +3,7 @@ import os
3
  import sys
4
  import logging
5
  import time
 
6
 
7
  # Configure logging
8
  logging.basicConfig(
@@ -32,7 +33,6 @@ def main():
32
  logger.info("πŸš€ STARTUP SCRIPT INITIALIZED")
33
  logger.info(f"πŸ“‚ CWD: {os.getcwd()}")
34
  logger.info(f"🐍 Python: {sys.version}")
35
- logger.info(f"πŸ“š PYTHONPATH: {sys.path}")
36
 
37
  # 0. Debug Check: Can we trace the app?
38
  logger.info("πŸ” Checking if 'app.main' is importable...")
@@ -41,14 +41,11 @@ def main():
41
  logger.info("βœ… 'app.main' imported successfully!")
42
  except ImportError as e:
43
  logger.error(f"❌ Failed to import app.main: {e}")
44
- # List files to see where we are
45
- logger.info("πŸ“‚ File listing:")
46
- for root, dirs, files in os.walk("."):
47
- for name in files:
48
- logger.info(os.path.join(root, name))
49
  sys.exit(1)
50
  except Exception as e:
51
  logger.error(f"❌ Unexpected error importing app.main: {e}")
 
52
  sys.exit(1)
53
 
54
  # 1. Run Migrations
 
3
  import sys
4
  import logging
5
  import time
6
+ import traceback
7
 
8
  # Configure logging
9
  logging.basicConfig(
 
33
  logger.info("πŸš€ STARTUP SCRIPT INITIALIZED")
34
  logger.info(f"πŸ“‚ CWD: {os.getcwd()}")
35
  logger.info(f"🐍 Python: {sys.version}")
 
36
 
37
  # 0. Debug Check: Can we trace the app?
38
  logger.info("πŸ” Checking if 'app.main' is importable...")
 
41
  logger.info("βœ… 'app.main' imported successfully!")
42
  except ImportError as e:
43
  logger.error(f"❌ Failed to import app.main: {e}")
44
+ logger.error(traceback.format_exc())
 
 
 
 
45
  sys.exit(1)
46
  except Exception as e:
47
  logger.error(f"❌ Unexpected error importing app.main: {e}")
48
+ logger.error(traceback.format_exc())
49
  sys.exit(1)
50
 
51
  # 1. Run Migrations