Skip to main content

Overview

This guide helps you identify and resolve common issues. The system includes comprehensive logging and error handling based on patterns from utils/logger.js and error handling throughout the codebase.

Logging System

Understanding Log Levels

The system uses Winston logging with multiple levels (from utils/logger.js:14-20):
System errors that prevent normal operation. Always logged to logs/error.log.
Non-critical issues that should be monitored.
Standard operational messages.
Detailed information for troubleshooting. Only shown in development.

Log Files Location

Logs are stored in separate files (from utils/logger.js:23-43):

Viewing Logs

Common Issues

Authentication Failures

YouTube API Authentication Error

Symptoms:
Solutions:
1

Verify credentials file exists

2

Check credentials format

Ensure config/credentials.json matches the example from config/credentials.example.json:1-32:
3

Re-authenticate

Follow the prompts to re-authenticate with YouTube.
4

Verify API is enabled

  • Go to Google Cloud Console
  • Enable YouTube Data API v3
  • Enable YouTube Analytics API

Token Expired

Symptoms:
Solution: Tokens automatically refresh, but if they’re corrupted:

Database Issues

Database Locked

Symptoms:
Solutions:
  1. Check for multiple instances:
  1. Close database connections:
  1. Database corruption:

Missing Tables

Symptoms:
Solution: Reinitialize database (from database/db.js:33-195):

Content Generation Failures

Script Generation Timeout

Symptoms:
Solutions:
  1. Increase timeout in environment:
.env
  1. Check OpenAI API status:
  1. Implement retry logic:

AI Model Quota Exceeded

Symptoms:
Solutions:
1

Check your OpenAI quota

2

Implement rate limiting

3

Switch to cheaper model temporarily

config/credentials.json

Publishing Issues

Upload Failed

Symptoms:
YouTube API Quota Information:
  • Daily quota: 10,000 units
  • Video upload: ~1,600 units
  • Video update: 50 units
  • Analytics: 1 unit per request
Solutions:
  1. Monitor quota usage:
  1. Implement queue system:

Video Processing Stuck

Symptoms:
Solution:

Scheduler Issues

Cron Jobs Not Running

Symptoms:
Debug steps:
schedules/daily-automation.js
Test scheduler:

Performance Issues

High Memory Usage

Symptoms:
Solutions:
  1. Monitor memory:
  1. Clear caches:
  1. Limit concurrent operations:

Slow Response Times

Debug with performance logging:

Error Recovery

Automatic Retry Pattern

Implement throughout your code:
utils/retry-helper.js

Graceful Degradation

Health Monitoring

System Health Check

The automation includes health monitoring (from schedules/daily-automation.js:476-526):

Custom Health Checks

Critical Issues Requiring Immediate Attention:
  • Database corruption
  • API authentication failures
  • Disk space > 90% full
  • Memory usage > 90%
  • Continuous failed content generation
  • YouTube quota consistently exceeded

Getting Help

Collecting Diagnostic Information

When reporting issues:

Debug Mode

Run in debug mode:

Customization

Customize and extend the system

Configuration

Review configuration options