What still exists
- Lambda
sa-dev-orchestrator-chat. - API Gateway
w7jtrco599. - Stage
/dev. - CloudWatch Logs.
- Variables configured inside Lambda.
Operational Guide · Stadium Assistant
How to prepare PowerShell and Node.js again to continue exactly with the Walking Skeleton tests and the diagnosis of the 503 errors.
“Okay, I restarted the machine and obviously PowerShell closed, and I assume it disconnected from the platforms and everything that was connected, since I entered the commands indicated in Phase 1 — Identify exactly the cause of the ten 503s, / Step 1. Review the Lambda logs and in Step 2 it did not return anything; it only showed the command line again. What do I need to do, or what protocol or process do I need to follow in PowerShell and/or Node to reconnect to everything?”
AWS, Lambda, API Gateway, CloudWatch, and OpenAI were not disconnected. Restarting the computer only closed the local PowerShell sessions, Node.js processes, and variables that existed only in memory.
sa-dev-orchestrator-chat.w7jtrco599./dev.$DevBaseUrl, $ApiId, $FunctionName and the other PowerShell variables.$env:OPENAI_API_KEY y $env:OPENAI_MODEL when you run local tests.aws logs tail --since 30m without --follow ends and returns to the command prompt if it finds no events in that period. This does not mean AWS was disconnected.First confirm that the local tools are still available.
aws --version
node -v
npm -vValues confirmed in this environment:
v24.16.0.12.0.1.Put PowerShell back in the working folder.
cd "C:\Users\gerar\Documents\VSFRepositoryLocal\Dev_Platforms\NodeProjects\Project_SA_WalkingSkeleton_V2.0"Confirm that you are in the correct folder:
Get-Location
Get-ChildItemThese variables existed in the previous session and were lost when PowerShell was closed.
$AwsProfile = "sa-dev"
$AwsRegion = "us-east-1"
$AwsAccountId = "TU_AWS_ACCOUNT_ID"
$ApiId = "w7jtrco599"
$FunctionName = "sa-dev-orchestrator-chat"
$DevBaseUrl = "https://w7jtrco599.execute-api.us-east-1.amazonaws.com/dev"
$LambdaLogGroup = "/aws/lambda/sa-dev-orchestrator-chat"
$ApiLogGroup = "/aws/apigateway/sa-dev-http-api"
$ProjectPath = "C:\Users\gerar\Documents\VSFRepositoryLocal\Dev_Platforms\NodeProjects\Project_SA_WalkingSkeleton_V2.0"$AwsAccountId is left as a placeholder so an account identifier is not published on a public page. In your local PowerShell, use your account value.[PSCustomObject]@{
AwsProfile = $AwsProfile
AwsRegion = $AwsRegion
ApiId = $ApiId
FunctionName = $FunctionName
DevBaseUrl = $DevBaseUrl
LambdaLogGroup = $LambdaLogGroup
ApiLogGroup = $ApiLogGroup
ProjectPath = $ProjectPath
}Restarting Windows does not delete profiles saved by the AWS CLI.
Profiles configured with the AWS CLI normally remain in the user configuration and credentials files, so restarting Windows does not delete them. The parameter --profile explicitly selects one of those profiles.
aws configure list-profilesYou should see:
sa-devThen:
aws configure list --profile $AwsProfileIt should show the region and credential source. The key appears partially hidden.
Confirm that the profile can actually authenticate against AWS.
aws sts get-caller-identity `
--profile $AwsProfile `
--region $AwsRegionIt should return an object with UserId, Account y Arn. If this command responds correctly, PowerShell again has valid communication with AWS through the profile sa-dev.
Confirm the actual status of the deployed function.
aws lambda get-function-configuration `
--function-name $FunctionName `
--query "{
FunctionName:FunctionName,
FunctionArn:FunctionArn,
Runtime:Runtime,
Handler:Handler,
Timeout:Timeout,
MemorySize:MemorySize,
State:State,
LastUpdateStatus:LastUpdateStatus
}" `
--profile $AwsProfile `
--region $AwsRegionIt should show:
FunctionName: sa-dev-orchestrator-chat
Runtime: nodejs24.x
Handler: index.handler
Timeout: 15
MemorySize: 512
State: Active
LastUpdateStatus: SuccessfulConfirm that the HTTP API remains deployed.
aws apigatewayv2 get-api `
--api-id $ApiId `
--query "{Name:Name,ApiId:ApiId,ApiEndpoint:ApiEndpoint,ProtocolType:ProtocolType}" `
--profile $AwsProfile `
--region $AwsRegionExpected result:
Name: HTTP API MVP SAVSF
ApiId: w7jtrco599
ApiEndpoint: https://w7jtrco599.execute-api.us-east-1.amazonaws.com
ProtocolType: HTTP/healthVerify API Gateway → Lambda end to end.
$HealthTraceId = "restart-health-" + [guid]::NewGuid().ToString("N")
$HealthResult = Invoke-RestMethod `
-Uri "$DevBaseUrl/health" `
-Method GET `
-Headers @{"x-trace-id" = $HealthTraceId}
$HealthResultIt should show values such as:
ok : True
service : stadium-assistant-orchestrator
environment : dev
version : ws-1.0.0
trace_id : restart-health-...Compare the trace sent with the one received:
$HealthTraceId -eq $HealthResult.trace_idIt should return:
TrueThe errors probably occurred more than 30 minutes ago; therefore, a search limited to --since 30m may show nothing.
chat_failedaws logs tail $LambdaLogGroup `
--since 7d `
--filter-pattern '"chat_failed"' `
--format short `
--profile $AwsProfile `
--region $AwsRegionaws logs tail $LambdaLogGroup `
--since 7d `
--filter-pattern '"upstream_rate_limited"' `
--format short `
--profile $AwsProfile `
--region $AwsRegionaws logs tail $LambdaLogGroup `
--since 7d `
--filter-pattern '"upstream_service_error"' `
--format short `
--profile $AwsProfile `
--region $AwsRegionThis will be the first permanent window for observing the backend.
Open a first window of PowerShell.
Define at least the following there again:
$AwsProfile = "sa-dev"
$AwsRegion = "us-east-1"
$LambdaLogGroup = "/aws/lambda/sa-dev-orchestrator-chat"Then:
aws logs tail `
$LambdaLogGroup `
--since 5m `
--follow `
--format short `
--profile $AwsProfile `
--region $AwsRegionThe window should remain waiting. It will not return to the command prompt until you press:
Ctrl + CThis will be the second permanent window.
Open a second window of PowerShell.
Define:
$AwsProfile = "sa-dev"
$AwsRegion = "us-east-1"
$ApiLogGroup = "/aws/apigateway/sa-dev-http-api"aws logs tail `
$ApiLogGroup `
--since 5m `
--follow `
--format short `
--profile $AwsProfile `
--region $AwsRegionThe window should remain waiting.
While the other two windows monitor the logs, use a third window to generate traffic.
$DevBaseUrl = "https://w7jtrco599.execute-api.us-east-1.amazonaws.com/dev"Invoke-RestMethod `
-Uri "$DevBaseUrl/health" `
-Method GET `
-Headers @{"x-trace-id"="live-health-001"}$ChatBody = @{
message = "Hola"
locale = "es"
session_id = "restart-session-001"
} | ConvertTo-JsonInvoke-RestMethod `
-Uri "$DevBaseUrl/chat" `
-Method POST `
-ContentType "application/json" `
-Headers @{
"x-trace-id"="live-chat-001"
"x-session-id"="restart-session-001"
} `
-Body $ChatBodyWhile running these requests, simultaneously observe the first Lambda window and the second API Gateway window.
Only local tests need to restore the API key inside the new session.
Tests against API Gateway do not need OPENAI_API_KEY locally because OpenAI is called from Lambda and the key is configured inside AWS.
But to run:
npm run test:localyou do need to set the local variables again.
$env:OPENAI_MODEL = "gpt-5.6-luna"
$env:APP_ENV = "dev"
$env:APP_VERSION = "ws-1.0.0"
$env:ASSISTANT_ENABLED = "true"$SecureOpenAIKey = Read-Host `
"Introduce OPENAI_API_KEY" `
-AsSecureString$env:OPENAI_API_KEY = `
[System.Net.NetworkCredential]::new(
"",
$SecureOpenAIKey
).PasswordCheck that it is present without displaying it:
[PSCustomObject]@{
OPENAI_API_KEY_Present =
-not [string]::IsNullOrWhiteSpace(
$env:OPENAI_API_KEY
)
OPENAI_MODEL =
$env:OPENAI_MODEL
}Then you can run again:
npm run test:health
npm run test:injection
npm run test:localTo avoid manually rewriting the context every time you restart, you can save a script in:
scripts/start-dev-session.ps1$Global:AwsProfile = "sa-dev"
$Global:AwsRegion = "us-east-1"
$Global:AwsAccountId = "TU_AWS_ACCOUNT_ID"
$Global:ApiId = "w7jtrco599"
$Global:FunctionName = "sa-dev-orchestrator-chat"
$Global:DevBaseUrl = `
"https://w7jtrco599.execute-api.us-east-1.amazonaws.com/dev"
$Global:LambdaLogGroup = `
"/aws/lambda/sa-dev-orchestrator-chat"
$Global:ApiLogGroup = `
"/aws/apigateway/sa-dev-http-api"
$Global:ProjectPath = `
"C:\Users\gerar\Documents\VSFRepositoryLocal\Dev_Platforms\NodeProjects\Project_SA_WalkingSkeleton_V2.0"
Set-Location $Global:ProjectPath
$env:OPENAI_MODEL = "gpt-5.6-luna"
$env:APP_ENV = "dev"
$env:APP_VERSION = "ws-1.0.0"
$env:ASSISTANT_ENABLED = "true"
Write-Host "Stadium Assistant DEV session loaded"
Write-Host "Project: $Global:ProjectPath"
Write-Host "AWS profile: $Global:AwsProfile"
Write-Host "Region: $Global:AwsRegion"
Write-Host "API: $Global:DevBaseUrl"Load it in a new PowerShell session with:
. .\scripts\start-dev-session.ps1Complete the checklist to confirm that the environment is ready.