Summary
Deploying (or previewing impact for) a node whose (name, namespace) matches a soft-deleted node fails with an unhandled 500: psycopg.errors.UniqueViolation on unique_node_namespace_name. Affects real deploy and the POST /deployments/impact dry-run alike (the INSERT fires inside the SAVEPOINT before rollback).
Repro
- Deploy namespace
default.example containing node default.example.orders.
- Soft-delete
default.example.orders (deactivate — sets deactivated_at; the row remains).
- Re-deploy the namespace including
default.example.orders (or call POST /deployments/impact).
- → 500,
UniqueViolation: duplicate key value violates unique constraint "unique_node_namespace_name".
Root cause (v0.0.193)
_create_deployment_plan loads existing nodes via NodeNamespace.list_all_nodes(...) without include_deactivated=True (datajunction-server/datajunction_server/internal/deployment/orchestrator.py:1214). list_all_nodes defaults to include_deactivated=False, filtering deactivated_at IS NULL (datajunction-server/datajunction_server/database/namespace.py:264). So filter_nodes_to_deploy (orchestrator.py:2960) never sees the soft-deleted
Summary
Deploying (or previewing impact for) a node whose
(name, namespace)matches a soft-deleted node fails with an unhandled 500:psycopg.errors.UniqueViolationonunique_node_namespace_name. Affects real deploy and thePOST /deployments/impactdry-run alike (the INSERT fires inside the SAVEPOINT before rollback).Repro
default.examplecontaining nodedefault.example.orders.default.example.orders(deactivate — setsdeactivated_at; the row remains).default.example.orders(or callPOST /deployments/impact).UniqueViolation: duplicate key value violates unique constraint "unique_node_namespace_name".Root cause (v0.0.193)
_create_deployment_planloads existing nodes viaNodeNamespace.list_all_nodes(...)withoutinclude_deactivated=True(datajunction-server/datajunction_server/internal/deployment/orchestrator.py:1214).list_all_nodesdefaults toinclude_deactivated=False, filteringdeactivated_at IS NULL(datajunction-server/datajunction_server/database/namespace.py:264). Sofilter_nodes_to_deploy(orchestrator.py:2960) never sees the soft-deleted