claude-memory/graph/solutions/paper-dynasty-fixed-card-generation-after-postgresql-migrati-a918ab.md
Cal Corum b140d4d82a migrate: 313 memories from MemoryGraph
- 313 new markdown files created
- 30 relationships embedded
- 313 entries indexed
- State initialized with usage data
2026-02-13 11:11:48 -06:00

2.0 KiB

id type title tags importance confidence created updated relations
a918ab78-70dc-49bf-bcb8-e98e6bdd624e solution Paper Dynasty: Fixed card generation after PostgreSQL migration
paper-dynasty
postgresql
card-generation
jinja2
templates
migration
fix
0.9 0.8 2026-02-02T01:39:08.756078+00:00 2026-02-02T01:39:08.756078+00:00
target type direction strength
2937a962-4a6e-44fb-b7c7-7d472df7fc0e RELATED_TO outgoing 0.5
target type direction strength
4bb882a6-1ef9-4ec4-873d-816881f6670b RELATED_TO incoming 0.5

Problem: After migrating Paper Dynasty database from SQLite to PostgreSQL, card generation endpoints returned 'Internal Server Error' with jinja2.exceptions.TemplateNotFound for 'player_card.html'.

Root Cause: The storage/templates/ directory containing card rendering templates (player_card.html, topright_batter.html, topright_pitcher.html, etc.) was not included in the production deployment. The directory is gitignored and was lost during migration.

Solution:

  1. Recovered templates from old server: scp pd-database:/home/cal/container-data/pd-database/storage/templates/*.html ../database/storage/templates/
  2. Updated .gitignore to allow templates: Add !storage/templates/ after storage/
  3. Force-added to git: git add -f storage/templates/
  4. For immediate fix, SCP'd directly to production: scp -r ../database/storage/templates/ akamai:/root/container-data/paper-dynasty/storage/
  5. Restarted API: ssh akamai 'cd /root/container-data/paper-dynasty && docker compose restart api'

Templates Required:

  • player_card.html (main card template)
  • topright_batter.html, topright_pitcher.html (position-specific headers)
  • results_vl.html, results_vr.html (batting results vs L/R)
  • result_columns.html, style.html (layout/styling)

Prevention: When deploying database container updates, verify storage/templates/ is mounted or included in image.

Related: PostgreSQL migration guide at /mnt/NV2/Development/paper-dynasty/database/docs/POSTGRES_MIGRATION_GUIDE.md