Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

error in camp-generated sql file for ion_bpsec_admin.json #10

Open
karenhaining opened this issue Aug 8, 2024 · 0 comments
Open

error in camp-generated sql file for ion_bpsec_admin.json #10

karenhaining opened this issue Aug 8, 2024 · 0 comments

Comments

@karenhaining
Copy link

The camp-generated sql file for the ion_bpsec_admin.json ADM throws an error when executed in the ANMS database.

Example error messages:

From an integration test in the JHUAPL-DTNMA repo CI/CD:

        with open(sql_file, "r") as f:
>           cursor.execute(f.read())
E           psycopg2.errors.UndefinedTable: relation "public.vw_ari_union" does not exist
E           LINE 1: amp_agent_op_plusuint_aid = (select obj_id FROM public.vw_ar...
E                                                                   ^
E           QUERY:  amp_agent_op_plusuint_aid = (select obj_id FROM public.vw_ari_union WHERE obj_name = 'plusUINT' and adm_name = (select adm_name from public.vw_namespace where name_string = 'Amp/Agent')  and actual = true)
E           CONTEXT:  PL/pgSQL function inline_code_block line 622 at assignment

Same test when ran locally:

        with open(sql_file, "r") as f:
>           cursor.execute(f.read())
E           psycopg2.errors.NotNullViolation: null value in column "obj_actual_definition_id" of relation "ari_collection_actual_entry" violates not-null constraint
E           DETAIL:  Failing row contains (68, null).
E           CONTEXT:  SQL statement "INSERT INTO ari_collection_actual_entry(ac_entry_id, obj_actual_definition_id) VALUES(r_ac_entry_id, p_definition_id)"
E           PL/pgSQL function sp__insert_ac_actual_entry(integer,integer,integer,integer) line 5 at SQL statement
E           SQL statement "CALL SP__insert_ac_actual_entry(var_ac_id, amp_agent_op_plusuint_aid, 3, r_ac_entry_id_3 )"
E           PL/pgSQL function inline_code_block line 623 at CALL

where cursor is the cursor of a connection to the ANMS library (using psycopg2), and sql_file is the camp-generated sql file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant