-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrun_server.py
More file actions
38 lines (32 loc) · 1.07 KB
/
run_server.py
File metadata and controls
38 lines (32 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python
"""
Wrapper script to run the NLWeb server with better error handling.
This helps diagnose startup issues in containerized environments.
"""
import os
import sys
import traceback
def main():
try:
print("Starting NLWeb server...")
print(f"Python version: {sys.version}")
print(f"Python path: {sys.path}")
# Set the config directory to the current working directory
os.environ['NLWEB_CONFIG_DIR'] = os.getcwd()
print(f"Config directory set to: {os.getcwd()}")
# Import and run the server
from nlweb_network.server import main as server_main
print("Server module imported successfully")
server_main()
except Exception as e:
print(f"\n{'='*60}")
print(f"FATAL ERROR: Server failed to start")
print(f"{'='*60}")
print(f"Error type: {type(e).__name__}")
print(f"Error message: {str(e)}")
print(f"\nFull traceback:")
traceback.print_exc()
print(f"{'='*60}\n")
sys.exit(1)
if __name__ == '__main__':
main()