Troubleshooting Guide
This guide helps you resolve common issues when setting up or running the Qprint platform.
Prerequisites Issues
Node.js/npm Not Installed
Error: npm : The term 'npm' is not recognized
Solution: Install Node.js (which includes npm)
- Download Node.js from: https://nodejs.org/
- Choose the LTS (Long Term Support) version
- Run the installer
- Restart your terminal/PowerShell
- Verify installation:
npm -vandnode -v
Go Not Installed
Error: go: command not found
Solution: Install Go
- Download from: https://golang.org/dl/
- Install Go 1.24 or later
- Verify:
go version
PostgreSQL Not Running
Error: connection refused or database connection failed
Solution:
- Start PostgreSQL service:
- Windows: Check Services, start "postgresql-x64" service
- Linux:
sudo systemctl start postgresql - Mac:
brew services start postgresql
- Verify it's running:
pg_isreadyor check port 5432
Backend Issues
Backend Won't Start
Symptoms: Backend fails to start or crashes immediately
Common Causes:
- PostgreSQL database not running
- Database credentials incorrect in
.envfile - Database doesn't exist
- Port 8080 already in use
Solutions:
-
Check Database Connection:
# Test PostgreSQL connection
psql -U postgres -d filesharing -
Verify
.envConfiguration:DATABASE_URL=postgres://username:password@localhost:5432/filesharing?sslmode=disable
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
PORT=8080 -
Create Database if Missing:
CREATE DATABASE filesharing; -
Check Port Availability:
# Windows
netstat -ano | findstr :8080
# Linux/Mac
lsof -i :8080 -
Manual Backend Test:
cd backend
go run cmd/api/main.goExpected output:
Connected to PostgreSQL database
Server running on port 8080
Database Connection Failed
Error: Unable to connect to database or connection refused
Solutions:
- Verify PostgreSQL is running
- Check connection string format in
.env - Verify database exists:
psql -U postgres -l - Check firewall settings (port 5432)
- Verify credentials (username, password)
JWT Secret Not Set
Error: Authentication fails or tokens are invalid
Solution: Set a strong JWT secret in backend/.env:
JWT_SECRET=your-super-secret-jwt-key-minimum-32-characters-long
Use a strong, random secret in production. Never use default or weak secrets.
Frontend Issues
Frontend Won't Start
Symptoms: npm run dev fails or shows errors
Common Causes:
- Node.js version too old (need 18+)
- Corrupted
node_modules - Port 3000 already in use
- Missing dependencies
Solutions:
-
Check Node.js Version:
node -v # Should be 18.0.0 or higher -
Clean Install:
cd frontend
rm -rf node_modules package-lock.json
npm install -
Check Port Availability:
# Windows
netstat -ano | findstr :3000
# Linux/Mac
lsof -i :3000 -
Use Different Port:
PORT=3001 npm run dev
Build Errors
Error: Build fails on Vercel or during npm run build
Common Causes:
- Missing environment variables
- TypeScript errors
- Missing dependencies
Solutions:
- Check
.env.localfile exists - Verify all required environment variables are set
- Run
npm run buildlocally to catch errors - Check TypeScript errors:
npx tsc --noEmit
Database Issues
Migration Errors
Error: Schema initialization fails
Solutions:
- Ensure database exists
- Check user has CREATE privileges
- Review migration files in
backend/migrations/ - Manually run migrations if needed
Connection Pool Exhausted
Error: too many connections
Solutions:
- Increase PostgreSQL
max_connectionssetting - Reduce connection pool size in Go code
- Close unused connections properly
- Check for connection leaks
Mobile App Issues
Flutter Build Fails
Error: flutter build or flutter run fails
Solutions:
-
Clean Build:
flutter clean
flutter pub get
flutter run -
Check Flutter Version:
flutter --version # Should be 3.10+ -
Check Dependencies:
flutter pub get
flutter pub upgrade
Android Build Issues
Error: Gradle build fails
Solutions:
- Check Android SDK is installed
- Verify
ANDROID_HOMEenvironment variable - Update Gradle wrapper
- Clean build:
flutter clean && flutter build apk
Windows Build Issues (Shopkeeper App)
Error: Windows build fails or printing doesn't work
Solutions:
-
Check SumatraPDF:
- Ensure
SumatraPDF.exeexists inwindows/runner/bin/ - Run
scripts/setup_sumatra.ps1if missing
- Ensure
-
Check LibreOffice (optional, for Word/PPT):
- Run
scripts/setup_libreoffice.ps1if needed
- Run
-
Use Build Script:
cd shopkeeper_app
build_windows.bat -
See Windows Printing Guide for detailed setup
Payment Integration Issues
Razorpay Webhook Not Working
Error: Payment webhooks not received
Solutions:
- Verify webhook URL is publicly accessible
- Check
RAZORPAY_WEBHOOK_SECRETmatches Razorpay dashboard - Use ngrok for local testing:
ngrok http 8080 - Check webhook logs in Razorpay dashboard
Payment Order Creation Fails
Error: Cannot create payment orders
Solutions:
- Verify
RAZORPAY_KEY_IDandRAZORPAY_KEY_SECRETare set - Check Razorpay account is active
- Verify API keys are for correct environment (test/live)
- Check Razorpay API status
Email Service Issues
Emails Not Sending
Error: Password reset emails not received
Solutions:
-
Resend API:
- Verify
RESEND_API_KEYis set - Check
FROM_EMAILis verified in Resend - Review Resend dashboard for errors
- Verify
-
SMTP (if using):
- Verify SMTP credentials
- Check SMTP port is not blocked
- Test SMTP connection
-
Check Logs:
- Review backend logs for email errors
- Check spam folder
File Upload Issues
Upload Fails
Error: File upload returns error
Solutions:
-
Check File Size:
- Max 20MB per file
- Max 100MB total for batch uploads
-
Check File Type:
- Supported: PDF, PNG, JPG, JPEG, DOC, DOCX, PPT, PPTX
-
Check Storage:
- Local: Verify
uploads/directory exists and is writable - S3: Verify AWS credentials and bucket permissions
- Local: Verify
-
Check Permissions:
# Linux/Mac
chmod 755 uploads/
# Windows: Check folder permissions
Files Not Accessible
Error: Cannot download uploaded files
Solutions:
- Verify file exists in storage
- Check file path in database
- Verify storage backend (local/S3) is accessible
- Check file permissions
Deployment Issues
Vercel Build Fails
Error: Frontend build fails on Vercel
Solutions:
- Check build logs for specific errors
- Verify environment variables are set in Vercel
- Check
next.config.jsconfiguration - Ensure all dependencies are in
package.json
Render Deployment Issues
Error: Backend deployment fails on Render
Solutions:
- Verify build command:
cd backend && go build -o backend cmd/api/main.go - Check start command:
./backend - Verify all environment variables are set
- Check database connection string
- Review Render logs for errors
Common Error Messages
"Authorization required"
Cause: Missing or invalid JWT token
Solution:
- Login again to get new token
- Check token is stored correctly
- Verify token hasn't expired
"Invalid credentials"
Cause: Wrong username/password
Solution:
- Verify username and password
- Check if account exists
- Try password reset
"File not found"
Cause: File doesn't exist or code is incorrect
Solution:
- Verify file code is correct
- Check file hasn't been deleted
- Verify file belongs to user
"Payment order not found"
Cause: Order ID doesn't exist or belongs to different user
Solution:
- Verify order ID is correct
- Check order belongs to current user
- Verify payment was completed
Getting More Help
If you're still experiencing issues:
-
Check Logs:
- Backend: Check console output
- Frontend: Check browser console
- Mobile: Check Flutter logs
-
Review Documentation:
-
Common Resources:
-
Verify Configuration:
- Check all environment variables
- Verify database connection
- Ensure all services are running
Last Updated: January 26, 2026