Forum Discussion

nataliesta's avatar
nataliesta
Contributor
8 months ago

Why am I sometimes getting 'Validation exception for id' error using LiQL for users?

Here is the error message:
Exception: Validation exception for id in WHERE clause: id <= 490884

Here is my request:
[...]api/2.0/search?q=SELECT  login, id, first_name, last_name, email, join_date FROM users WHERE node.id = 'grouphub:30' AND id <= '500000' LIMIT 1000 CURSOR 'xyz'

We have a Python script that pages through, using the cursor, 1000 at a time. This error comes up for only some id's. Is there any fix for this? Or any idea why this is going wrong?

  • MattV's avatar
    MattV
    Khoros Staff

    Is the ID in your script hard-coded to 500000 (and, on a tangent, curious why you have that constraint)? 

     

    • nataliesta's avatar
      nataliesta
      Contributor

      Hi MattV! We have 2 separate jobs that ingest the the member list of this group in our database. We figured out we can split them in half by the median id. The API connection fails at some point if we try to ingest all members in one go (I think there are 30k+ members). 

      I think I solved this however. I have to order by id desc/asc, then after receiving the cursor,  remove the greater than/less than comparison when using the cursor argument. Cursor argument and the id argument seem to be incompatible.