[2026-09-24 07:07:17] [DEMO] ========================================
[2026-09-24 07:07:17] [DEMO] STARTING DEMO TRADING RUNNER
[2026-09-24 07:07:17] [DEMO] ========================================
[2026-09-24 07:07:17] [DEMO][ERROR] Demo failed {"error":"Database configuration missing in .env","file":"/home/primaryk/public_html/crypto-algo.primarykeytech.in/backup-v2/app/Support/Database.php","line":105}
[2026-09-24 07:07:17] [BOOT] Stale PID lock detected, recovering {"pid":3420944}
[2026-09-24 07:07:17] [BOOT] Market Data Scheduler starting {"pid":4069752,"timeframes":[15,30,45,60,90],"symbols":["BTCUSD"],"trading_enabled":"false"}
[2026-09-24 07:07:17] [BOOT] Market Data Scheduler starting {"timeframes":[15,30,45,60,90],"trading_enabled":"false"}
[2026-09-24 07:07:17] [PERSISTENCE] Selected Driver: File
[2026-09-24 07:07:19] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":1,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:20] [LAUNCHER] Starting all services
[2026-09-24 07:07:20] [LAUNCHER] Started service {"service":"Market Data Runner","script":"/home/primaryk/public_html/crypto-algo.primarykeytech.in/backup-v2/bin/market-data-runner.php"}
[2026-09-24 07:07:20] [BOOT] Market Data Scheduler starting {"pid":4072451,"timeframes":[15,30,45,60,90],"symbols":["BTCUSD"],"trading_enabled":"false"}
[2026-09-24 07:07:20] [BOOT] Market Data Scheduler starting {"timeframes":[15,30,45,60,90],"trading_enabled":"false"}
[2026-09-24 07:07:20] [PERSISTENCE] Selected Driver: File
[2026-09-24 07:07:20] [LAUNCHER] Started service {"service":"Trade Monitor Runner","script":"/home/primaryk/public_html/crypto-algo.primarykeytech.in/backup-v2/bin/trade-monitor-runner.php"}
[2026-09-24 07:07:21] [LAUNCHER] Started service {"service":"Telegram Bot Runner","script":"/home/primaryk/public_html/crypto-algo.primarykeytech.in/backup-v2/bin/telegram-bot-runner.php"}
[2026-09-24 07:07:21] [LAUNCHER] Started service {"service":"Order Status Poller","script":"/home/primaryk/public_html/crypto-algo.primarykeytech.in/backup-v2/bin/order-status-poller.php"}
[2026-09-24 07:07:21] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":1,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:21] [LAUNCHER] Stopping all services
[2026-09-24 07:07:22] [LAUNCHER] Killed process {"service":"order-status-poller.php","pid":"4071907"}
[2026-09-24 07:07:22] [LAUNCHER] Killed process {"service":"order-status-poller.php","pid":"4072331"}
[2026-09-24 07:07:22] [LAUNCHER] Killed process {"service":"order-status-poller.php","pid":"4072332"}
[2026-09-24 07:07:22] [LAUNCHER] Killed process {"service":"order-status-poller.php","pid":"4072473"}
[2026-09-24 07:07:22] [LAUNCHER] Killed process {"service":"order-status-poller.php","pid":"4072481"}
[2026-09-24 07:07:22] [LAUNCHER] All services stopped
[2026-09-24 07:07:22] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":1,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:22] [LAUNCHER] All services started successfully
[2026-09-24 07:07:22] [DEMO] ========================================
[2026-09-24 07:07:22] [DEMO] STARTING DEMO TRADING RUNNER
[2026-09-24 07:07:22] [DEMO] ========================================
[2026-09-24 07:07:22] [DEMO][ERROR] Demo failed {"error":"Database configuration missing in .env","file":"/home/primaryk/public_html/crypto-algo.primarykeytech.in/backup-v2/app/Support/Database.php","line":105}
[2026-09-24 07:07:23] [SERVICES] All services started in foreground mode
[2026-09-24 07:07:23] [BOOT] Market Data Scheduler starting {"pid":4072550,"timeframes":[15,30,45,60,90],"symbols":["BTCUSD"],"trading_enabled":"false"}
[2026-09-24 07:07:23] [BOOT] Market Data Scheduler starting {"timeframes":[15,30,45,60,90],"trading_enabled":"false"}
[2026-09-24 07:07:23] [PERSISTENCE] Selected Driver: File
[2026-09-24 07:07:23] [BOOT] Market Data Scheduler starting {"pid":4070449,"timeframes":[15,30,45,60,90],"symbols":["BTCUSD"],"trading_enabled":"false"}
[2026-09-24 07:07:23] [BOOT] Market Data Scheduler starting {"timeframes":[15,30,45,60,90],"trading_enabled":"false"}
[2026-09-24 07:07:23] [PERSISTENCE] Selected Driver: File
[2026-09-24 07:07:24] [PERSISTENCE] Selected Driver: File
[2026-09-24 07:07:24] [PERSISTENCE] Selected Driver: File
[2026-09-24 07:07:24] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":1,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:25] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":1,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:25] [LAUNCHER] Starting all services
[2026-09-24 07:07:26] [LAUNCHER] Stopping all services
[2026-09-24 07:07:26] [LAUNCHER] All services stopped
[2026-09-24 07:07:26] [WS][CONFIG] Using Delta LIVE WebSocket (fallback) {"environment":"LIVE","url":"wss://socket.delta.exchange"}
[2026-09-24 07:07:26] [WS][LOCK] Lock acquired. PID: 4071935
[2026-09-24 07:07:26] [WS] Starting Main Loop {"state":"DISCONNECTED"}
[2026-09-24 07:07:26] [WS][STATE] Changed to: CONNECTING
[2026-09-24 07:07:26] [WS] Attempting handshake... {"url":"wss://socket.delta.exchange","attempt":1}
[2026-09-24 07:07:26] [WS] Sending subscription {"symbols":["BTCUSD"]}
[2026-09-24 07:07:27] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":2,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:27] == STARTING PIPELINE INTEGRATION TEST ==
[2026-09-24 07:07:27] [BOOT] Market Data Scheduler starting {"pid":4072601,"timeframes":[15,30,45,60,90],"symbols":["BTCUSD"],"trading_enabled":"false"}
[2026-09-24 07:07:27] [BOOT] Market Data Scheduler starting {"timeframes":[15,30,45,60,90],"trading_enabled":"false"}
[2026-09-24 07:07:27] [PERSISTENCE] Selected Driver: File
[2026-09-24 07:07:27] [WS][STATE] Changed to: CONNECTED
[2026-09-24 07:07:27] [WS] ✅ CONNECTED and Subscribed
[2026-09-24 07:07:27] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":1,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:27] [SERVICES] All services started in foreground mode
[2026-09-24 07:07:28] [BOOT] Market Data Scheduler starting {"pid":4072606,"timeframes":[15,30,45,60,90],"symbols":["BTCUSD"],"trading_enabled":"false"}
[2026-09-24 07:07:28] [BOOT] Market Data Scheduler starting {"timeframes":[15,30,45,60,90],"trading_enabled":"false"}
[2026-09-24 07:07:28] [PERSISTENCE] Selected Driver: File
[2026-09-24 07:07:28] [PERSISTENCE] Selected Driver: File
[2026-09-24 07:07:28] [PERSISTENCE] Selected Driver: File
[2026-09-24 07:07:28] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":1,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:28] [PERSISTENCE] Selected Driver: File
[2026-09-24 07:07:29] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":2,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:30] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":2,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:30] [WS][CONFIG] Using Delta LIVE WebSocket (fallback) {"environment":"LIVE","url":"wss://socket.delta.exchange"}
[2026-09-24 07:07:30] [WS][LOCK] 🔒 Could not acquire lock. Another instance is running (or lock is fresh).
[2026-09-24 07:07:30] [WS][FATAL] Another instance is already running. Exiting to prevent parallel connections.
[2026-09-24 07:07:31] == STARTING PIPELINE INTEGRATION TEST ==
[2026-09-24 07:07:31] [BOOT] Market Data Scheduler starting {"pid":4072625,"timeframes":[15,30,45,60,90],"symbols":["BTCUSD"],"trading_enabled":"false"}
[2026-09-24 07:07:31] [BOOT] Market Data Scheduler starting {"timeframes":[15,30,45,60,90],"trading_enabled":"false"}
[2026-09-24 07:07:31] [PERSISTENCE] Selected Driver: File
[2026-09-24 07:07:31] [BOOT] Market Data Scheduler starting {"pid":4072626,"timeframes":[15,30,45,60,90],"symbols":["BTCUSD"],"trading_enabled":"false"}
[2026-09-24 07:07:31] [BOOT] Market Data Scheduler starting {"timeframes":[15,30,45,60,90],"trading_enabled":"false"}
[2026-09-24 07:07:31] [PERSISTENCE] Selected Driver: File
[2026-09-24 07:07:32] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":3,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:32] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":2,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:32] [PERSISTENCE] Selected Driver: File
[2026-09-24 07:07:33] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":2,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:34] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":3,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:34] [BOOT] Market Data Scheduler starting {"pid":4072652,"timeframes":[15,30,45,60,90],"symbols":["BTCUSD"],"trading_enabled":"false"}
[2026-09-24 07:07:34] [BOOT] Market Data Scheduler starting {"timeframes":[15,30,45,60,90],"trading_enabled":"false"}
[2026-09-24 07:07:34] [PERSISTENCE] Selected Driver: File
[2026-09-24 07:07:35] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":3,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:37] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":4,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:37] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":3,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:38] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":3,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:39] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":4,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:40] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":4,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:42] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":5,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:42] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":4,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:43] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":4,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:44] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":5,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:45] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":5,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:47] [ORDER_STATUS_POLLER][FATAL] Could not connect to database after retries. Exiting.
[2026-09-24 07:07:47] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":5,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:48] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":1,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:48] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":5,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:49] [ORDER_STATUS_POLLER][FATAL] Could not connect to database after retries. Exiting.
[2026-09-24 07:07:50] [ORDER_STATUS_POLLER][FATAL] Could not connect to database after retries. Exiting.
[2026-09-24 07:07:51] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":1,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:51] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":1,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:52] [ORDER_STATUS_POLLER][FATAL] Could not connect to database after retries. Exiting.
[2026-09-24 07:07:53] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":2,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:53] [ORDER_STATUS_POLLER][FATAL] Could not connect to database after retries. Exiting.
[2026-09-24 07:07:54] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":1,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:56] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":2,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:56] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":2,"error":"Database configuration missing in .env"}
[2026-09-24 07:07:59] [ORDER_STATUS_POLLER][ERROR] DB Connection failed, retrying... {"attempt":2,"error":"Database configuration missing in .env"}
[2026-09-24 07:09:36] [MIGRATION] Adding broker_account_id to telegram_subscribers table
[2026-09-24 07:09:36] [MIGRATION] Creating many-to-many telegram subscriber-broker mapping
[2026-09-24 07:09:37] [MIGRATION] Creating telegram_subscribers table
[2026-09-24 07:09:40] [EXCHANGE_RATE][SUCCESS] USD to INR rate fetched {"rate":95.81,"source":"API"}
[2026-09-24 07:09:40] [EXCHANGE_RATE][CACHE] Using cached rate {"rate":95.81,"age_sec":0}
[2026-09-24 07:09:40] [EXCHANGE_RATE][CACHE] Using cached rate {"rate":95.81,"age_sec":0}
[2026-09-24 07:09:40] [RATE_LIMIT] Request rate limited {"key":"TEST_KEY","tokens":1.1920928955078125e-5,"capacity":5}
[2026-09-24 07:09:57] [MIGRATION] Adding broker_account_id to telegram_subscribers table
[2026-09-24 07:09:58] [MIGRATION] Creating telegram_subscribers table
[2026-09-24 07:09:59] [MIGRATION] Creating many-to-many telegram subscriber-broker mapping
[2026-09-24 07:10:04] [EXCHANGE_RATE][SUCCESS] USD to INR rate fetched {"rate":95.81,"source":"API"}
[2026-09-24 07:10:04] [EXCHANGE_RATE][CACHE] Using cached rate {"rate":95.81,"age_sec":0}
[2026-09-24 07:10:04] [EXCHANGE_RATE][CACHE] Using cached rate {"rate":95.81,"age_sec":0}
[2026-09-24 07:10:04] [RATE_LIMIT] Request rate limited {"key":"TEST_KEY","tokens":1.0013580322265625e-5,"capacity":5}
