-
-
Notifications
You must be signed in to change notification settings - Fork 0
FAQ.md
Common problems and solutions for OpenCashFlow development.
Symptoms:
- Build errors related to missing packages
- Version mismatch errors
Solutions:
-
Verify .NET SDK version:
dotnet --version # Should be 9.0.300 or higher -
Restore packages:
dotnet restore OpenCashFlow.sln
-
Clear NuGet cache:
dotnet nuget locals all --clear dotnet restore
Symptoms:
Npgsql.NpgsqlException: Failed to connect- Connection timeout errors
Solutions:
-
Verify PostgreSQL is running:
# Docker docker ps | grep postgres # Local installation pg_isready
-
Check connection string:
echo $DEFAULT_CONN_STRING
-
Verify database exists:
psql -U opencashflow -d opencashflow_db -c "SELECT 1" -
Check firewall/network settings if using remote database
Symptoms:
- Browser shows "Your connection is not private"
HttpRequestException: The SSL connection could not be established
Solutions:
-
Trust development certificates:
dotnet dev-certs https --trust
-
If that fails, clean and regenerate:
dotnet dev-certs https --clean dotnet dev-certs https --trust
-
On macOS, you may need to manually trust in Keychain Access
Symptoms:
System.IO.IOException: Failed to bind to addressAddress already in use
Solutions:
-
Find process using the port:
# macOS/Linux lsof -i :7001 # Windows netstat -ano | findstr :7001
-
Kill the process:
# macOS/Linux kill -9 <PID> # Windows taskkill /PID <PID> /F
-
Or change port in
launchSettings.json:"applicationUrl": "https://localhost:7010;http://localhost:5010"
Symptoms:
- EF Core tools cannot instantiate the context
- Missing connection string errors
Solutions:
-
Set environment variable:
export DEFAULT_CONN_STRING="Host=localhost;Database=opencashflow_db;..."
-
Ensure API project has appsettings.json with connection string
-
Build the projects first:
dotnet build src/OpenCashFlow.API/OpenCashFlow.API.csproj
Symptoms:
- Database has old schema
-
__EFMigrationsHistoryshows migration applied
Solutions:
-
Check migration history:
SELECT * FROM "__EFMigrationsHistory";
-
If migration was partially applied, reset:
# Remove from history (carefully) DELETE FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240124_AddNewFeature'; # Reapply dotnet ef database update
-
For fresh start (development only):
dotnet ef database drop --force dotnet ef database update
Symptoms:
-
DbUpdateConcurrencyExceptionwhen updating balance - Optimistic locking failures
Solutions:
This is expected behavior for concurrent updates. Handle it:
try
{
await _context.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
// Retry with fresh data
await _context.Entry(balance).ReloadAsync();
balance.Balance += delta;
await _context.SaveChangesAsync();
}Symptoms:
- 401 Unauthorized responses
- "Token expired" errors
Solutions:
-
Check token expiration (default 15 minutes):
// Decode token (client-side debugging) const payload = JSON.parse(atob(token.split('.')[1])); console.log(new Date(payload.exp * 1000));
-
Implement refresh token flow:
if (response.status === 401) { await refreshToken(); // Retry request }
-
Verify JWT configuration matches between App and API
Symptoms:
-
Access-Control-Allow-Originheader missing - Preflight request fails
Solutions:
-
Verify CORS configuration:
echo $CORS__ALLOWEDORIGINS__0
-
Ensure exact URL match (including protocol and port):
# Correct CORS__ALLOWEDORIGINS__0=https://localhost:7001 # Wrong (missing port, different protocol) CORS__ALLOWEDORIGINS__0=http://localhost
-
Check CORS middleware order in
Program.cs:app.UseCors(); // Must be before UseAuthorization app.UseAuthorization();
Symptoms:
- Authentication works but subsequent requests fail
- Cookie visible in browser but not sent
Solutions:
-
Ensure
credentials: 'include'in fetch:fetch(url, { credentials: 'include' });
-
Check SameSite settings match domain configuration:
options.Cookie.SameSite = SameSiteMode.None; // For cross-site options.Cookie.SameSite = SameSiteMode.Lax; // For same-site
-
Verify cookie domain setting
Symptoms:
- Generic error message in production
- No stack trace visible
Solutions:
-
Check Sentry for detailed error
-
Check application logs:
tail -f Logs/log-*.txt -
In development, enable detailed errors:
if (app.Environment.IsDevelopment()) { app.UseDeveloperExceptionPage(); }
Symptoms:
- User is authenticated but access denied
- Subscription middleware blocking
Solutions:
-
Check subscription status:
SELECT * FROM "Company_Subscription" WHERE "TenantID" = 'your-tenant-id';
-
Verify user permissions:
// Check user has required permission var permissions = User.Claims .Where(c => c.Type == "permission") .Select(c => c.Value);
-
Check if tenant ID in token matches resource
Symptoms:
- Page appears unstyled
- 404 errors for CSS files
Solutions:
-
Verify files exist in
wwwroot/vendor/tabler/ -
Check static files middleware:
app.UseStaticFiles(); // Must be called
-
Clear browser cache or hard refresh (Ctrl+Shift+R)
Symptoms:
- Real-time updates not working
- WebSocket connection errors
Solutions:
-
Check SignalR hub is mapped:
app.MapHub<PaymentHub>("/hubs/payment");
-
Verify CORS allows SignalR:
policy.WithOrigins(origins) .AllowCredentials(); // Required for SignalR
-
Check browser console for specific errors
Symptoms:
- Form submit does nothing
- Console shows JavaScript errors
Solutions:
-
Check browser console (F12) for errors
-
Verify jQuery is loaded before custom scripts:
<script src="~/libs/jquery/jquery.min.js"></script> <script src="~/js/site.js"></script>
-
Check for syntax errors in JavaScript files
Symptoms:
- API responses take several seconds
- High CPU usage on database server
Solutions:
-
Enable query logging temporarily:
"Logging": { "LogLevel": { "Microsoft.EntityFrameworkCore.Database.Command": "Information" } }
-
Check for missing indexes:
EXPLAIN ANALYZE SELECT * FROM "Payments" WHERE "TenantID" = '...' AND "PaymentDate" > '...';
-
Add appropriate indexes:
modelBuilder.Entity<Payment>() .HasIndex(p => new { p.TenantID, p.PaymentDate });
Symptoms:
- Application memory increases over time
- Eventually OutOfMemoryException
Solutions:
-
Check for missing
Dispose()calls on DbContext:// Bad - context never disposed var context = new ApplicationDbContext(); // Good - using DI with scoped lifetime services.AddDbContext<ApplicationDbContext>(ServiceLifetime.Scoped);
-
Profile memory usage:
dotnet-counters monitor --process-id <PID>
-
Check for event handler leaks
Symptoms:
- CI workflow shows red X
- Build or test step fails
Solutions:
-
Check workflow logs in GitHub Actions tab
-
Run same commands locally:
dotnet restore dotnet build --no-restore dotnet test --no-build -
Ensure all test dependencies are available
Symptoms:
-
docker buildexits with error - Missing files or packages
Solutions:
-
Check Dockerfile paths are correct
-
Ensure .dockerignore isn't excluding needed files
-
Build with verbose output:
docker build --progress=plain -t opencashflow .
If your issue isn't covered here:
- Search existing GitHub Issues
- Check the Discussions
- Review the detailed documentation in this wiki
- Create a new issue with:
- Steps to reproduce
- Expected vs actual behavior
- Relevant logs/error messages
- Environment details (OS, .NET version, etc.)
Project status
OpenCashFlow is under active development.
APIs, database schema, and UI may change until the first stable release.
Built with
.NET · ASP.NET Core · Entity Framework Core · PostgreSQL · Tabler
© 2026 OpenCashFlow
- Developer Preview
- Not production-ready
- First-run setup included