Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mfarina1 opened this issue Oct 11, 2024 · 1 comment
Open

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

mfarina1 opened this issue Oct 11, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@mfarina1
Copy link
Collaborator

NOTE: this issue was copied over from the archived anms-camp repo found here

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 #1 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.

@mfarina1 mfarina1 added the bug Something isn't working label Oct 11, 2024
@mfarina1 mfarina1 added this to the CAMP v3.0.0 milestone Oct 11, 2024
@mfarina1
Copy link
Collaborator Author

Will be resolved by SQL API changes being worked on by @njbrunner and @d-linko

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant