This guide helps diagnose and resolve common issues when running the meeting summaries ingestion pipeline in production.
Symptoms:
- Error:
Failed to connect to database - Error:
connection refusedortimeout
Diagnosis:
# Test database connectivity
psql "$DATABASE_URL" -c "SELECT version();"
# Check network connectivity
ping <database-host>Solutions:
- Verify
DATABASE_URLis correctly formatted:postgresql://user:password@host:port/database - Check database is accessible from deployment environment (firewall rules, network policies)
- Verify database credentials are correct
- Check if database requires SSL/TLS (add
?sslmode=requireto connection string) - Verify database user has necessary permissions (INSERT, UPDATE, SELECT, CREATE)
Symptoms:
- Error:
Failed to download JSON from URL - Error:
HTTP 404orHTTP 403 - Timeout errors
Diagnosis:
# Test URL accessibility
curl -I https://raw.githubusercontent.com/SingularityNET-Archive/SingularityNET-Archive/refs/heads/main/Data/Snet-Ambassador-Program/Meeting-Summaries/2025/meeting-summaries-array.json
# Check DNS resolution
nslookup raw.githubusercontent.comSolutions:
- Verify GitHub URLs are accessible from deployment environment
- Check network firewall rules allow outbound HTTPS connections
- Verify URLs haven't changed (check GitHub repository)
- Check for rate limiting (GitHub may throttle requests)
- Add retry logic or use proxy if behind corporate firewall
Symptoms:
- Error:
Structure validation failed - Error:
Missing required field: workgroup - Error:
Invalid JSON structure
Diagnosis:
# Download and inspect JSON structure
curl https://raw.githubusercontent.com/.../meeting-summaries-array.json | jq '.[0] | keys'
# Check for required fields
curl https://raw.githubusercontent.com/.../meeting-summaries-array.json | jq '.[0] | {workgroup, workgroup_id, meetingInfo, agendaItems, tags, type}'Solutions:
- Verify JSON structure matches expected schema (see
specs/001-meeting-summaries-ingestion/data-model.md) - Check if source JSON format has changed
- Review validation errors in logs for specific missing fields
- Use
--skip-validationflag only for testing (not recommended for production)
Symptoms:
- Error:
Failed to insert record - Error:
Foreign key constraint violation - Error:
Duplicate key violation
Diagnosis:
-- Check for missing workgroups
SELECT DISTINCT workgroup_id FROM meetings WHERE workgroup_id NOT IN (SELECT id FROM workgroups);
-- Check for duplicate records
SELECT id, COUNT(*) FROM meetings GROUP BY id HAVING COUNT(*) > 1;Solutions:
- Verify database schema is up-to-date (run migrations)
- Check referential integrity (workgroups must exist before meetings)
- Verify UPSERT functions are working correctly
- Check for constraint violations in logs
- Ensure database has sufficient storage space
Symptoms:
- Ingestion takes longer than 10 minutes
- High database connection usage
- Memory errors
Diagnosis:
# Monitor database connections
psql "$DATABASE_URL" -c "SELECT count(*) FROM pg_stat_activity WHERE datname = current_database();"
# Check database performance
psql "$DATABASE_URL" -c "SELECT * FROM pg_stat_statements ORDER BY total_time DESC LIMIT 10;"Solutions:
- Verify database indexes are created (especially GIN indexes on JSONB columns)
- Check database connection pool settings
- Monitor database resource usage (CPU, memory, disk I/O)
- Consider batch processing for very large datasets
- Optimize database queries if needed
Symptoms:
- No logs appearing
- Logs not in expected format
- Missing error details
Diagnosis:
# Check environment variables
env | grep -E "(LOG_LEVEL|LOG_FORMAT)"
# Test logging
python -m src.cli.ingest --dry-run --verboseSolutions:
- Verify
LOG_LEVELis set correctly (DEBUG,INFO,WARNING,ERROR) - Check
LOG_FORMATis set tojsonortextas needed - Ensure logs are being captured (stdout/stderr redirection)
- Check log aggregation system configuration (if using)
If ingestion fails partway through:
-
Check what was ingested:
SELECT COUNT(*) FROM meetings; SELECT COUNT(*) FROM workgroups;
-
Re-run ingestion (idempotent, will update existing records):
python -m src.cli.ingest
-
Verify no duplicates:
SELECT id, COUNT(*) FROM meetings GROUP BY id HAVING COUNT(*) > 1;
If schema is out of date:
- Backup database (if possible)
- Run migrations:
psql "$DATABASE_URL" -f scripts/setup_db.sql - Verify schema:
SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';
If data corruption is suspected:
-
Check raw JSON is preserved:
SELECT id, raw_json FROM meetings LIMIT 1;
-
Re-ingest from source (UPSERT will update records)
-
Verify data integrity:
-- Check for NULL in required fields SELECT COUNT(*) FROM meetings WHERE workgroup_id IS NULL; SELECT COUNT(*) FROM meetings WHERE date IS NULL;
-
Ingestion Success Rate
- Track
sources_processedvssources_failed - Alert if failure rate > 5%
- Track
-
Record Counts
- Monitor total records ingested per run
- Alert if count drops significantly
-
Processing Time
- Track ingestion duration
- Alert if exceeds 15 minutes (10-minute goal + buffer)
-
Database Health
- Monitor connection pool usage
- Track query performance
- Monitor disk space
-
Error Rates
- Track validation errors
- Monitor database errors
- Alert on repeated failures
Structured JSON logs can be analyzed with tools like:
jqfor command-line analysis- ELK stack (Elasticsearch, Logstash, Kibana)
- Cloud logging services (CloudWatch, Stackdriver, etc.)
Example log queries:
# Find all errors
jq 'select(.level == "ERROR")' < logs.json
# Find failed sources
jq 'select(.event == "source_processing_failed")' < logs.json
# Count records by source
jq '[.[] | select(.source_url) | .source_url] | group_by(.) | map({url: .[0], count: length})' < logs.jsonIf issues persist:
- Check logs for detailed error messages
- Review
production-checklist.mdfor configuration verification - Consult
specs/001-meeting-summaries-ingestion/spec.mdfor expected behavior - Review test cases in
tests/for examples of correct usage