[FOLIO-1192] folio-ansible: Empty loan_users list. Zero active patron users in mod-circulation-data role Created: 11/Apr/18 Updated: 12/Nov/18 Resolved: 11/Apr/18 |
|
| Status: | Closed |
| Project: | FOLIO |
| Components: | None |
| Affects versions: | None |
| Fix versions: | None |
| Type: | Task | Priority: | P2 |
| Reporter: | John Malconian | Assignee: | Wayne Schneider |
| Resolution: | Done | Votes: | 0 |
| Labels: | ci, sprint36 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | 2 hours, 30 minutes | ||
| Original estimate: | Not Specified | ||
| Attachments: |
|
| Sprint: |
| Description |
|
I've come across this error a couple of time now: TASK [folio-ansible/roles/mod-circulation-data : Load loans] ******************* |
| Comments |
| Comment by John Malconian [ 11/Apr/18 ] |
|
It appears there are no users designated as 'active': [malc@ip-10-36-20-124 scripts]$ curl -H 'x-okapi-tenant: diku' -H 'x-okapi-token: eyJhbGciOiJIUzUxMiJ9.yJzdWIiOiJkaWt1X2FkbWluIiwidXNlcl9pZCI6IjFhZDczN2IwLWQ4NDctMTFlNi1iZjI2LWNlYzBjOTMyY2UwMSIsInRlbmFudCI6ImRpa3UifQ.tmPkMJ_xhcy_03q2od8xAsuNAeCATPUBFQd2eMr6Y15DJc72wVyFgTgLvVzoVc2qbjV_5_sBQLLG-PQc0zYDpg' "http://10.36.1.77:9130/users?query=active%3D%22true%22%20and%20type%3D%3Dpatron%20sortby%20personal.lastName%20personal.firstName&limit=6" { } 200 users have been loaded: [malc@ip-10-36-20-124 scripts]$ curl -H 'x-okapi-tenant: diku' -H 'x-okapi-token: eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJkaWt1X2FkbWluIiwidXNlcl9pZCI6IjFhZDczN2IwLWQ4NDctMTFlNi1iZjI2LWNlYzBjOTMyY2UwMSIsInRlbmFudCI6ImRpa3UifQ.tmPkMJ_xhcy_03q2od8xAsuNAeCATPUBFQd2eMr6Y15DJc72wVyFgTgLvVzoVc2qbjV_5_sBQLLG-PQc0zYDpg' "http://10.36.1.77:9130/users?query=type%3D%3Dpatron%20sortby%20personal.lastName%20personal.firstName&limit=1" ], } ], |
| Comment by John Malconian [ 11/Apr/18 ] |
|
From gen-folio-users: active => (rand(1) > 0.3 ? JSON::true : JSON::false), So it appears the number active users generated is random though I'm not quite sure what ' > 0.3' does here. |
| Comment by John Malconian [ 11/Apr/18 ] |
|
I'm guessing > 0.3 really means NOT zero if the range for rand is 0-1. it doesn't seem that rand is working properly or at least is not very random. |
| Comment by John Malconian [ 11/Apr/18 ] |
|
It appears the error is caused by a recent commit to mod-users. https://github.com/folio-org/mod-users/commit/15a5ecfaadb6000d66553d58bd0f09b1282e1cf8 |
| Comment by Zak Burke [ 11/Apr/18 ] |
|
|
| Comment by Wayne Schneider [ 11/Apr/18 ] |
|
John Malconian is right, the issue was that mod-users now magically makes users who have expired "inactive" – which in this case was all of them. I changed the script to make users expire a random number of days (up to 2 years) after the date the script is run. |