1 Reply Latest reply on Jun 21, 2017 11:40 AM by Dillon Scaduto

    Creating user and Querying User Information throws Error

    Dillon Scaduto

      I am using the latest version (2.5) of the REST api.


      TLDR: When I try to create a user that already exists i get a 409 error, that makes sense, there should not be duplicate users. However when I catch that error and try to query for their information, I get another 409 error, the user can not be found.


      I have to synchronize users between our tableau and another system. When i come across a user that does not exist in Tableau I attempt to create it. After i create it i try to change the users site role. changing the site role queries for the users information and is unable to find the user. so it attempts to create the user instead. As i mentioned before the user already exists so this obviously fails. i catch the failure and try to query for their information instead but this also gives me an error: user not found.


      When i debug it and put breakpoints in the middle of the execution the entire process works as intended. It seems that Tableau has a slight delay after creating a user that it is actually unreachable by the query method, but also conflicts with the create user method. I certainly don't want to put sleep or wait statements in my code to artificially slow it down, but i don't see any other way to give the Tableau server time to catch up.


      Has anyone else experienced this before and found an easier solution?