Skip to content

Production map_analysis 503 regression: Neo4j fallback on Heroku cache miss #923

@northdpole

Description

@northdpole

Summary

Production GET /rest/v1/map_analysis returns 503 for multiple standard pairs (e.g. ENISAISO 27001, ENISANIST 800-53 v5, Cloud Controls MatrixNIST 800-53 v5).

Heroku logs show:

  1. Cache miss for the pair
  2. Redis/RQ unavailable (connection refused to localhost:6379)
  3. Synchronous fallback attempts Neo4j (c13a6d96.databases.neo4j.io) and fails DNS resolution
  4. Response: 503 Database/graph backend unavailable

Root cause

Commit/PR #823 (d796ff53, merged ~2026-06-09) removed the Heroku cache-only guard (if os.environ.get("HEROKU"): abort(404)) and replaced the Redis-unavailable fallback with a direct db.gap_analysis() Neo4j call.

This regressed a prior fix in #915 (00f1721c) that served precomputed GA from SQL cache only on Heroku. Production was force-updated from the #915 fix back to d796ff53.

Expected behavior

On Heroku/read-only production:

  • Serve material cached GA results from Postgres (gap_analysis_results)
  • On cache miss: return 404 (no Redis queue, no Neo4j computation on web dyno)

Acceptance criteria

  • No 503s from Neo4j DNS failures on Heroku map_analysis
  • Regression tests for Heroku cache-miss → 404 without Redis/Neo4j
  • Monitoring utility to alert on incomplete GA pairs / 503 responses
  • Deploy fix to opencreorg and validate failing pairs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions