From 6c71f7374039bc121b0c4c8b2dfed959bc8e9919 Mon Sep 17 00:00:00 2001 From: Marius Mutu Date: Wed, 12 Nov 2025 02:32:50 +0200 Subject: [PATCH] Fix missing config properties for Windows services: add port, display name, and description MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Bug Fix ### Problem Deployment failed with error: ``` [INSTALLATION FAILED] You cannot call a method on a null-valued expression. at Install-BackendFirstTime, line 611 ``` The error occurred at line 611: ```powershell & nssm install $Config.BackendServiceName $pythonPath "-m" "uvicorn" ... "--port" $Config.BackendPort.ToString() ``` ### Root Cause Global configuration was missing required properties used by service installation functions: - `$Config.BackendPort` - used in NSSM service creation (line 611) - `$Config.BackendServiceDisplayName` - used for service display name (line 612) - `$Config.BackendServiceDescription` - used for service description (line 613) - `$Config.TelegramBotServiceDisplayName` - used in telegram bot service (line 816) - `$Config.TelegramBotServiceDescription` - used in telegram bot service (line 817) - `$Config.TelegramBotPort` - added for consistency (not yet used) When the script tried to call `.ToString()` on `$Config.BackendPort`, it was null, causing the error. ### Solution Added missing properties to `$script:Config` hashtable (lines 63-96): **Backend properties:** - `BackendPort = 8000` - `BackendServiceDisplayName = "ROA2WEB Backend API"` - `BackendServiceDescription = "FastAPI backend service for ROA2WEB application"` **Telegram Bot properties:** - `TelegramBotPort = 8002` - `TelegramBotServiceDisplayName = "ROA2WEB Telegram Bot"` - `TelegramBotServiceDescription = "Telegram bot frontend for ROA2WEB application"` ### Impact - Backend service creation now works correctly with proper port configuration - Service display names and descriptions are properly set in Windows Services - Configuration is now complete and consistent 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- deployment/windows/scripts/ROA2WEB-Console.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deployment/windows/scripts/ROA2WEB-Console.ps1 b/deployment/windows/scripts/ROA2WEB-Console.ps1 index b203ab5..dc05a44 100644 --- a/deployment/windows/scripts/ROA2WEB-Console.ps1 +++ b/deployment/windows/scripts/ROA2WEB-Console.ps1 @@ -69,6 +69,9 @@ $script:Config = @{ # Backend BackendPath = "C:\inetpub\wwwroot\roa2web\backend" BackendServiceName = "ROA2WEB-Backend" + BackendServiceDisplayName = "ROA2WEB Backend API" + BackendServiceDescription = "FastAPI backend service for ROA2WEB application" + BackendPort = 8000 BackendHealthUrl = "http://localhost:8000/health" BackendHealthTimeout = 5 @@ -78,6 +81,9 @@ $script:Config = @{ # Telegram Bot TelegramBotPath = "C:\inetpub\wwwroot\roa2web\telegram-bot" TelegramBotServiceName = "ROA2WEB-TelegramBot" + TelegramBotServiceDisplayName = "ROA2WEB Telegram Bot" + TelegramBotServiceDescription = "Telegram bot frontend for ROA2WEB application" + TelegramBotPort = 8002 TelegramBotHealthUrl = "http://localhost:8002/internal/health" TelegramBotHealthTimeout = 10