[FOLIO-1500] Environment builds fail due to invalid fiscal year sample record Created: 15/Sep/18 Updated: 12/Nov/18 Resolved: 18/Sep/18 |
|
| Status: | Closed |
| Project: | FOLIO |
| Components: | None |
| Affects versions: | None |
| Fix versions: | None |
| Type: | Bug | Priority: | P2 |
| Reporter: | Marc Johnson | Assignee: | Wayne Schneider |
| Resolution: | Done | Votes: | 0 |
| Labels: | ci, devops, sprint46, sprint47 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original estimate: | Not Specified | ||
| Issue links: |
|
||||||||||||||||
| Sprint: | |||||||||||||||||
| Description |
|
Overnight, both the folio-testing and folio-snapshot backend builds failed. Summary The fiscal year schema in mod-finance no longer has properties which are used in the sample record, meaning this fails to be created (with a 422 error, which is ignored). This then leads to other records failing to be created with 500 errors, which stop the build. Temporary Resolution I've raised
Whether this should be the permanent resolution depends upon whether these properties were intentionally removed (in which case, this is a compatibility breaking change rather than a bug). Symptoms Multiple failures similar to the below appear in the logs for the environment builds.
failed: [10.36.1.205] (item=/tmp/ansible.BURDoC/mod-finance/sample-data/budgets/ENDOW-SUBN-FY19.json) => {"accept": "application/json, text/plain", "accept_encoding": "identity", "authtoken_refresh_cache": "true", "changed": false, "connection": "close", "content": "ErrorMessage(fields=Map(Detail -> Key (fiscal_year_id)=(684b5dc5-92f6-4db7-b996-b549d88f5e4e) is not present in table \"fiscal_year\"., s -> diku_mod_finance, n -> budget_fiscal_year_id_fkey, t -> budget, Line -> 3269, File -> ri_triggers.c, SQLSTATE -> 23503, Routine -> ri_ReportViolation, V -> ERROR, Message -> insert or update on table \"budget\" violates foreign key constraint \"budget_fiscal_year_id_fkey\", Severity -> ERROR))", "content_type": "text/plain", "data_file": "/tmp/ansible.BURDoC/mod-finance/sample-data/budgets/ENDOW-SUBN-FY19.json", "failed": true, "host": "10.36.1.205:9130", "msg": "Status code was not [201, 422]: HTTP Error 500: Internal Server Error", "redirected": false, "status": 500, "transfer_encoding": "chunked", "url": "http://10.36.1.205:9130/budget", "user_agent": "ansible-httpget", "x_okapi_permissions": "[\"budget.item.post\"]", "x_okapi_request_id": "322206/budget", "x_okapi_tenant": "diku", "x_okapi_token": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJkaWt1X2FkbWluIiwidXNlcl9pZCI6Ijg3N2MzYTZmLTY2ZjMtNTQzNC04ZGM5LWNmNWYzNTFjZDhjZiIsImlhdCI6MTUzNjk3Njk0NSwidGVuYW50IjoiZGlrdSJ9.YtAKyFzcOjuzpyJTQ6Ag3jtP0BG4mpDDWFwzVX6qUgI", "x_okapi_trace": "POST mod-authtoken-2.0.2-SNAPSHOT.28 http://10.36.1.205:9131/budget : 202 248569us, POST mod-finance-1.0.1-SNAPSHOT.25 http://10.36.1.205:9151/budget : 500 90365us", "x_okapi_url": "http://10.36.1.205:9130", "x_okapi_user_id": "877c3a6f-66f3-5434-8dc9-cf5f351cd8cf"}
Investigation I believe the sample data loading counts 422 status codes as success and so the fiscal year sample record is seen as successful: TASK [folio-ansible/roles/module-sample-data : Load module data to /fiscal_year] *** ok: [10.36.1.205] => (item=/tmp/ansible.BURDoC/mod-finance/sample-data/fiscal-years/fy1.json) Ledgers also have references to fiscal years, however these are not enforced by foreign keys (as these are not supported for arrays at present). Therefore budgets are where this error first appears. |
| Comments |
| Comment by Wayne Schneider [ 15/Sep/18 ] |
|
Thanks for the update and sleuthing, Marc Johnson. Parsing error codes for data loading is problematic, as most RMB endpoints report a 422 for a duplicate record. I've raised
In the meantime, we can temporarily update the build playbook in folio-ansible and folio-infrastructure to omit the finance data load, until
|
| Comment by Wayne Schneider [ 15/Sep/18 ] |
|
We have rebuilt folio-snapshot and folio-testing without finance sample data, for the moment, until
|
| Comment by Marc Johnson [ 17/Sep/18 ] |
|
Wayne Schneider Thanks. The reference to 422 status codes was primarily intended to help my recall (and describe my thought process) if I look back at previous issues, rather than a critique or a prompt to change the behaviour. |
| Comment by Wayne Schneider [ 18/Sep/18 ] |
|
The PR that addresses
|