In modular monolith and containerized architectures, friction caused by environment drift, port collisions, or stale code-generation caches can abruptly halt development progress.
This document provides a verified troubleshooting matrix and rapid remediation commands grounded in the physical reality of the BitzOrcas codebase.
Physical Service & Port Topology Matrix
1. Port Collisions & Process Termination (Address Already in Use)
When startup aborts with System.IO.IOException: Failed to bind to address: address already in use, locate and terminate the conflicting process using the commands below:
| Service | Default Port | macOS / Linux Process Termination | Windows PowerShell Termination |
|---|---|---|---|
| API Host | 6881 / 6883 | lsof -ti :6881,6883 | xargs kill -9 | Get-NetTCPConnection -LocalPort 6881 -ErrorAction SilentlyContinue | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force } |
| YARP Gateway | 6880 | lsof -ti :6880 | xargs kill -9 | Get-NetTCPConnection -LocalPort 6880 -ErrorAction SilentlyContinue | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force } |
| Web Frontend | 6800 | lsof -ti :6800 | xargs kill -9 | Get-NetTCPConnection -LocalPort 6800 -ErrorAction SilentlyContinue | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force } |
| SQL Server | 1433 / 14333 | lsof -ti :1433 | xargs kill -9 | Get-NetTCPConnection -LocalPort 1433 -ErrorAction SilentlyContinue | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force } |
| Redis | 6379 | lsof -ti :6379 | xargs kill -9 | Get-NetTCPConnection -LocalPort 6379 -ErrorAction SilentlyContinue | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force } |
| RabbitMQ | 5672 / 15672 | lsof -ti :5672,15672 | xargs kill -9 | Get-NetTCPConnection -LocalPort 5672 -ErrorAction SilentlyContinue | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force } |
2. Database Connectivity Failures & Handshake Timeouts
Common Exceptions:
Microsoft.Data.SqlClient.SqlException: Cannot open database "BitzOrcas_Dev" requested by the login.A connection was successfully established with the server, but then an error occurred during the pre-login handshake.
Remediation Steps:
- Verify Container Health Probe:
Execute
docker compose psand confirm the SQL Server container indicates(healthy). SQL Server requires 10–15 seconds post-startup to complete internal initialization. Attempting schema creation before health reports ready triggers pre-login timeouts. - Apple Silicon (M1/M2/M3/M4) Emulation Delay:
Official SQL Server images exist solely for
linux/amd64. On macOS running Docker Desktop or OrbStack, execution depends on Rosetta 2 emulation. Initial cold starts can require 30+ seconds. - Database Unprovisioned:
The exception
Cannot open database "BitzOrcas_Dev"indicates the catalog does not yet exist. Run the built-in provisioning command:Terminal window dotnet run --project src/Hosts/BitzOrcas.Api -- --init-schema
3. Roslyn Source Generator Stale Cache
Symptoms:
Adding a [GenerateEndpoint] command or [BitzTable] attribute compiles with missing-symbol errors in the IDE, or returns HTTP 404 at runtime.
Root Cause: IDE background language servers (in Rider or Visual Studio) occasionally cache stale syntax trees, failing to trigger incremental compilation passes.
Remediation:
# 1. Clean bin and obj folders across the entire solutiongit clean -xfd -e "!*.env*" src/ tests/
# 2. Force non-incremental build to re-evaluate syntax treesdotnet build --no-incremental4. HTTPS Developer Certificate Untrusted (SSL Error)
Symptoms:
- Browser network inspectors report
net::ERR_CERT_AUTHORITY_INVALIDwhen frontend requests targethttps://localhost:6883. - Scalar documentation reports untrusted TLS certificate warnings.
Remediation:
# 1. Purge all expired development certificatesdotnet dev-certs https --clean
# 2. Issue and register a new trusted root certificatedotnet dev-certs https --trustOn Linux distributions lacking unified root trust stores, target the plain HTTP endpoint http://localhost:6881 during local development.
5. Double-Underscore Environment Variable Mapping Traps
Symptoms:
Executing export ConnectionStrings:Default="..." results in the host reporting empty connection strings at startup.
Root Cause:
POSIX-compliant shells (Bash, Zsh) prohibit colons : in environment variable identifiers. In the Microsoft configuration system, hierarchical keys must be delimited using double underscores (__):
# Invalid (Colons are truncated or rejected by standard shells)export ConnectionStrings:Default="Server=..."
# Valid (Double underscore maps automatically to ConnectionStrings:Default)export ConnectionStrings__Default="Server=localhost,1433;Database=BitzOrcas_Dev;User Id=sa;Password=YourStrong!Passw0rd;TrustServerCertificate=True;MultipleActiveResultSets=True;"At startup, ConnectionStrings__Default maps seamlessly to IConfiguration["ConnectionStrings:Default"].