This is a submission for DEV's Summer Bug Smash: Clear the Lineup powered by Sentry.
Project Overview
ArbNet is an automated crypto arbitrage application designed to track P2P trading opportunities across exchange platforms like Binance. The stack consists of an ASP.NET Core (.NET 8) Web API backend paired with a React (Vite) frontend and a PostgreSQL database.
Bug Fix or Performance Improvement
- Bug Description During the transition of the ArbNet project to a local development environment, the system became completely inoperable due to the expiration of the trial subscription on Railway, which triggered a two-level failure:
Backend (.NET 8): API requests failed with a System.InvalidOperationException due to lost connectivity with the cloud-hosted PostgreSQL database (transient failure).
Frontend (React): HTTP requests originating from the authentication component (Welcome.jsx) attempted to reach the inactive Railway URL (arbnet-production.up.railway.app), resulting in an immediate network error (TypeError: Failed to fetch).
- Sentry Telemetry & Capture Thanks to the Sentry SDK integrated across both Backend and Frontend, the following real-time events were captured:
🔹 Backend Event (.NET)
Issue ID: DOTNET-ASPNETCORE-3 (Event ID: 8da4123b)
Exception: System.InvalidOperationException
Message: "An exception has been raised that is likely due to a transient failure."
State: Unhandled
Exact Location: Controllers\UsersController.cs inside asynchronous task Task>
Affected Endpoint: /api/Users/register
🔹 Frontend Event (React)
Issue ID / Message: TypeError: Failed to fetch (arbnet-production.up.railway.app)
User Action (Breadcrumb): Click on button.btn-register-submit
→
Request POST https://arbnet-production.up.railway.app/api/users/register
🔹 Environment
Runtime: .NET 8.0.29 & React (Vite)
OS: Windows 11
Environment: development
Release: 1.0.0 (a6cd6355e101)
Frontend Error Evidence (Sentry)

Direct Link in Sentry:
View Issue ARBNETFRONTEND-1 on Sentry
Backend Error Evidence (Sentry)

Direct Link in Sentry:
View Issue ARBNETBACKEND on Sentry
- Diagnosis & Fix 🔍 Diagnosis with Google AI / Sentry Insights By analyzing network traces, Breadcrumbs, and exception logs captured by Sentry:
Confirmed the remote PostgreSQL database lockup caused by cloud provider trial expiration.
Detected that fetch requests in Welcome.jsx were still targeting the obsolete Railway production URL, interrupting both registration and login flows.
🛠️ Applied Fix (Step by Step)
- Local Database Migration and Setup PostgreSQL was installed locally, the ArbNet database schema was created, and the connection string in the backend's appsettings.json was updated:
"ConnectionStrings": {
"DefaultConnection": "Host=localhost; Database=ArbNet; Username=postgres; Password=your_password"
}
2. Reconfiguring Fetch in Frontend (React)
Re-routed the React client to the local server by updating the environment variable in .env.local:
VITE_API_URL=https://localhost:7039
const response = await fetch(${import.meta.env.VITE_API_URL}/api/users/register, { ... });
- CORS Policy Configuration in .NET builder.Services.AddCors(options => { options.AddPolicy("AllowLocalhost", policy => { policy.WithOrigins("http://localhost:5173", "http://localhost:3000") .AllowAnyHeader() .AllowAnyMethod(); }); }); app.UseCors("AllowLocalhost"); 📌 Version Control All updates and bug fixes were integrated and pushed to the branch: bugfix --- ## Code All code changes, database migrations, and CORS reconfigurations have been merged and submitted via Pull Request to the project repository.
-
Repository Branch:
bugfix
* Pull Request: View Pull Request #1 on GitHub
My Improvements
To restore ArbNet's operational status without breaking project maintainability, I took a systematic, telemetry-driven approach powered by Sentry Insights and Google AI (Gemini):
Key Technical Decisions:
-
Root Cause Analysis via Telemetry & AI:
- Instead of manual log hunting, I analyzed Sentry breadcrumbs and stack traces alongside Google AI to pinpoint the exact failure points: the expired PostgreSQL instance on Railway and the hardcoded production API endpoint in React.
-
Full-Stack Local Migration:
-
Database: Provisioned a local PostgreSQL instance and restored the complete ArbNet schema, updating the connection string in ASP.NET Core (
appsettings.json). -
Environment Variable Decoupling: Replaced hardcoded fetch URLs in React with Vite's
import.meta.env.VITE_API_URLpointing tolocalhost:7039, ensuring clean separation between local development and production configs.
-
Database: Provisioned a local PostgreSQL instance and restored the complete ArbNet schema, updating the connection string in ASP.NET Core (
-
Secure Cross-Origin Policy:
* Configured explicit CORS rules in .NET 8 (
Program.cs) allowing local development origins (localhost:5173andlocalhost:3000) while restricting unauthorized origins.Best Use of Sentry
Yes, this project relies heavily on Sentry Error Monitoring and Breadcrumb Tracing across both the frontend (React) and backend (.NET 8):
-
Full-Stack Error Monitoring: Configured Sentry SDKs on both client and server sides to capture unhandled exceptions during API route requests (
/api/users/register). -
Breadcrumb Analysis: Used Sentry's event breadcrumbs to trace the sequence of user actions—specifically capturing the submit event on
button.btn-register-submitup to the failed network request against the expired Railway host.
* Stack Trace Insights: Analyzed full backend stack traces (identifying System.InvalidOperationException in UsersController.cs) to differentiate between network-level CORS issues and database connection failure.
Best Use of Google AI
Yes! Google AI (Gemini) served as a core AI debugging collaborator during the resolution of this issue:
-
Sentry Log Analysis: Leveraged Google AI to analyze complex Sentry stack traces (
System.InvalidOperationExceptionand CORS preflight failures), quickly isolating the root cause between cloud provider expiration and frontend endpoint misconfiguration. -
Architecture & Migration Design: Used Google AI to structure the local database migration workflow, update
.env.localvariable decoupling in React (Vite), and implement robust CORS policy definitions in ASP.NET Core (.NET 8). - Documentation & Telemetry Integration: Assisted in formatting clear telemetry reports and structuring the Pull Request documentation to align with industry best practices.
Top comments (0)