Skip to main content

Overview

This guide covers the most frequently encountered issues when using the Resume Generator application and their solutions.

Authentication Issues

This error occurs when the JWT_SECRET environment variable is missing or empty.Error Location: backend/src/controllers/auth.controller.js:39-43, backend/src/middlewares/auth.middleware.js:27Solution:
  1. Create or edit backend/.env file
  2. Add the following line:
    JWT_SECRET=your_long_random_secret_key_here
    
  3. Generate a secure secret using:
    node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
    
  4. Restart the backend server
Never commit your .env file to version control. If you accidentally exposed your JWT secret, rotate it immediately.
Error Message: "Token not provided."Cause: The authentication token cookie is missing from the request.Error Location: backend/src/middlewares/auth.middleware.js:10-14Solutions:
  • Ensure you’re logged in before accessing protected routes
  • Check that cookies are enabled in your browser
  • Verify CORS settings allow credentials:
    cors({
      origin: "http://localhost:5173",
      credentials: true
    })
    
  • Clear browser cache and login again
Error Message: "Invalid token."Cause: The JWT token is malformed, expired, or signed with a different secret.Error Location: backend/src/middlewares/auth.middleware.js:33-37Solutions:
  • Login again to get a fresh token (tokens expire after 1 day)
  • Verify JWT_SECRET hasn’t changed in .env
  • Clear cookies and re-authenticate
Error Message: "token is invalid"Cause: The token has been blacklisted after logout.Error Location: backend/src/middlewares/auth.middleware.js:16-24Solution:
  • This is expected behavior after logout
  • Simply login again to get a new valid token

Registration & Login Issues

Error Message: "Please provide username, email and password"Cause: One or more required fields are missing in the registration request.Error Location: backend/src/controllers/auth.controller.js:15-19Solution: Ensure all three fields are provided in the request body:
{
  "username": "johndoe",
  "email": "[email protected]",
  "password": "securePassword123"
}
Error Message: "Account already exists with this email address or username"Cause: A user with the same email or username already exists in the database.Error Location: backend/src/controllers/auth.controller.js:21-29Solutions:
  • Use a different email address or username
  • If you forgot your password, use the login endpoint with correct credentials
  • Check for typos in email/username
Error Message: "Invalid email or password"Cause: Either the email doesn’t exist or the password is incorrect.Error Location: backend/src/controllers/auth.controller.js:71-74, 79-82Solutions:
  • Verify your email is correctly spelled
  • Check your password (case-sensitive)
  • If you’re a new user, register first
  • Ensure you’re using the email (not username) to login

Interview Report Generation Issues

Error Message: "Job description is required (send as 'jobDescription')."Cause: The jobDescription field is missing or empty.Error Location: backend/src/controllers/interview.controller.js:16-21Solution: Always include a non-empty jobDescription field in your request:
const formData = new FormData();
formData.append('jobDescription', 'Full job description text here');
formData.append('title', 'Senior Developer'); // optional
Error Message: "Either a resume file (field 'resume') or 'selfDescription' is required."Cause: Neither a resume file nor a self-description was provided.Error Location: backend/src/controllers/interview.controller.js:25-29Solution: Provide at least one of the following:
  • Upload a resume file (PDF or DOCX)
  • Include a selfDescription text field
  • Or provide both for best results
// Option 1: Resume file
formData.append('resume', fileBlob, 'resume.pdf');

// Option 2: Self description
formData.append('selfDescription', 'I am a software engineer with 5 years experience...');

// Option 3: Both (recommended)
formData.append('resume', fileBlob, 'resume.pdf');
formData.append('selfDescription', 'Additional context...');
Error Message: "AI service failed to generate interview report. Please try again."Cause: The Google Gemini API returned an error or timed out.Error Location: backend/src/controllers/interview.controller.js:101-105Solutions:
  • Verify GOOGLE_GENAI_API_KEY is set in backend/.env
  • Check your API key is valid and not expired
  • Ensure you have available quota in your Google AI account
  • Check your internet connection
  • Try again after a few moments (temporary API issues)
  • Reduce the size of your job description or resume if they’re very large
Error Message: "Interview report not found."Cause: The requested interview report doesn’t exist or doesn’t belong to your user.Error Location: backend/src/controllers/interview.controller.js:143-147, 177-181Solutions:
  • Verify the interview report ID is correct
  • Ensure you’re logged in as the user who created the report
  • Check that the report wasn’t deleted
  • Use GET /api/interview/ to list all your reports
Error Message: Varies based on missing field (e.g., "Job description is required", "Job title is required")Cause: The AI-generated report is missing required fields for database storage.Error Location: backend/src/controllers/interview.controller.js:119-123Solutions:
  • This is usually an internal error; try generating the report again
  • Ensure your job description is clear and well-formatted
  • Contact support if the issue persists

File Upload Issues

Error: Upload fails silently or returns an errorCause: The uploaded file exceeds the 5MB limit.Limit Location: backend/src/middlewares/file.middleware.js:6-8Solution:
  • Compress your PDF or DOCX file to under 5MB
  • Remove unnecessary images or formatting
  • Use PDF compression tools
  • Convert to a simpler format if possible
Maximum file size: 5MB (5 * 1024 * 1024 bytes)
Error Message: "Unsupported resume file type. Please upload a PDF or DOCX."Cause: The uploaded file is not a PDF or DOCX format.Error Location: backend/src/controllers/interview.controller.js:62-66Detection Logic: The application checks:
  1. Magic bytes (file signature): %PDF for PDF, PK.. for DOCX
  2. MIME type from the browser
  3. File extension
Supported Formats:
  • PDF (.pdf)
  • Microsoft Word (.docx)
Solution:
  • Convert your resume to PDF or DOCX format
  • Avoid uploading .doc (old Word format), .txt, or image files
  • Use “Save As” or “Export to PDF” from your word processor

Server Connection Issues

Symptoms:
  • Frontend shows connection errors
  • API requests fail with network errors
Solutions:
  1. Verify backend is running:
    cd backend
    npm run dev
    
    Should show: "Server is running on port 3000"
  2. Check backend URL in frontend configuration
    • Default: http://localhost:3000
  3. Verify ports are not blocked by firewall
  4. Check for port conflicts (another service using port 3000)
  5. Review CORS configuration in backend/src/app.js:9-12

Next Steps

MongoDB Connection Issues

Resolve MongoDB Atlas connection and authentication problems

Resume Parsing Errors

Fix issues with PDF/DOCX parsing and file format problems

Build docs developers (and LLMs) love