You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merging a branch (via a proposed change or infrahubctl branch merge) that removes any schema node fails. Both the Schema Integrity and Data Integrity validators pass and the proposed change is reported "eligible to be merged", but the merge task fails during migration calculation and rolls back:
infrahub.exceptions.SchemaNotFoundError:
Unable to find the schema '<NodeKind>' in the registry
main | <NodeKind>
calculate_migrations builds the post-merge (target) schema, in which the node is already removed, then process_diff calls schema.get(name='<NodeKind>', duplicate=False) against that target schema and fails because the node is gone.
A secondary task also fails while serializing the exception:
The exception is not picklable (its __init__ requires identifier), so Prefect cannot round-trip it, which can mask the real error in some views.
Expected Behavior
The merge removes the node and completes. process_diff should resolve a removed schema element against the pre-merge (source/root) schema, or otherwise handle removals without raising SchemaNotFoundError. (Separately, SchemaNotFoundError should be picklable.)
Steps to Reproduce
Reproduced on a clean instance with fresh schema and zero objects; no inheritance or relationships required.
Component
API Server / GraphQL
Infrahub version
1.10.4 (SDK 1.20.1)
Current Behavior
Merging a branch (via a proposed change or
infrahubctl branch merge) that removes any schema node fails. Both the Schema Integrity and Data Integrity validators pass and the proposed change is reported "eligible to be merged", but the merge task fails during migration calculation and rolls back:Traceback path:
core/branch/tasks.py:_do_merge_branch(~L440) ->core/merge/branch_merger.py:calculate_migrations(L151) ->core/models.py:SchemaUpdateValidationResult.init -> process_diff(L194) ->core/schema/schema_branch.py:get(L405), which raises.calculate_migrationsbuilds the post-merge (target) schema, in which the node is already removed, thenprocess_diffcallsschema.get(name='<NodeKind>', duplicate=False)against that target schema and fails because the node is gone.A secondary task also fails while serializing the exception:
The exception is not picklable (its
__init__requiresidentifier), so Prefect cannot round-trip it, which can mask the real error in some views.Expected Behavior
The merge removes the node and completes.
process_diffshould resolve a removed schema element against the pre-merge (source/root) schema, or otherwise handle removals without raisingSchemaNotFoundError. (Separately,SchemaNotFoundErrorshould be picklable.)Steps to Reproduce
Reproduced on a clean instance with fresh schema and zero objects; no inheritance or relationships required.
main:state: absent(or delete it).main(proposed-change merge orinfrahubctl branch merge).SchemaNotFoundError: Unable to find the schema 'TestingReproSolo' in the registry, then rolls back.Additional Information
infrahubctl schema loaddirectly (not via a merge) works. Only the merge path (calculate_migrations) is affected.