bryanthowell-tableau / tableau_tools

Package containing Tableau REST API, XML modification, tabcmd and repository tools
Other
214 stars 87 forks source link

Querying workbooks for username only queries first 99 users #10

Closed Kun2210 closed 6 years ago

Kun2210 commented 7 years ago

We've lately upgraded Tableau Server to: Tableau Server Version: 10.3.2 (10300.17.0728.2252) 64-bit Windows

We've started seeing issues with querying list of workbooks by username - only first 99 users are taken in the querying pool, if the user is latter on the user list, the app will throw NoMatchFoundException, since it cannot find the user it's querying the workbooks for.

We're guessing this might be some kind of pagination issue - is there anything on API level that can be set to resolve this? Or is it some kind of server-side settings we need to change?

bryanthowell-tableau commented 7 years ago

Hi, Can you post the version of tableau_tools you are using, as well as the exact code so I can take a look? I just checked the query_users() method itself and it pulls back more than 300 users in my initial test. The pagination code is built into the request methods themselves so if it works for one call it should be working for all of them.

But it's possible there is a lookup method going on if you using later API versions, so that might be the issue.

Kun2210 commented 7 years ago

Well, the sad case is, we're still using very old 1.5.2 tableau_rest_api - as the solution is working fine, no one wants to fund some hours to update that :) Anyways, code wasn't touched since it's first deployment, was working fine on Server 9.0.3 and now we've updated to 10.3.2 it's no longer working.

This is a simple query: workbooks = tab_srv.query_workbooks_by_username(requested_username) if requested_username happens to be in top 99 in All Users group (sorted alphabetically), all is working fine. Otherwise, app is throwing NoMatchFoundException. That made us wondering if there might be some kind of server-side setting. If not, is updating to newest tableau_tools the only solution?

bryanthowell-tableau commented 7 years ago

It just dawned on me what is the likely cause (and yes, upgrading the library would help you here, but you could probably patch in place).

The namespace in the XML changed in one of the versions of Tableau Server (possibly 9.2?) from http://tableausoftware.com/api' to "http://tableau.com/api'. Anywhere in the code you see ns_map= , the references will need to be updated to tableau.com instead of tableausoftware.com. The namespace mapping is actually necessary for XPATH lookup and searching, so it's possible the pagination has broken because it's not finding the tags it expects, which actually include the namespace even though it's not that apparent. You might be able to update those references and get it working.

There are also some other major changes to how Tableau Server works, particularly to the Projects and their Permissions after version 9.2, that could necessitate an upgrade. There are also filter methods on many of the queries (such as users and workbooks) that allow later versions of the tableau_tools library to work far faster and at larger scale. I understand that the old version was working but in the long term you will be far better off on a current release of tableau_tools.

Kun2210 commented 7 years ago

Thanks for the response! I'll check the quick-fix path first.

I understand updating is the best way to go for a long term resolution and will try to recommend that to my team.

Kun2210 commented 7 years ago

So, seems like this might not be an easy change - after changing the urls in source, I'm getting:

File "...\getPermissions.py", line 40, in <module> tab_srv.signin() File "tableau_rest_api.py", line 478, in signin IndexError: list index out of range

Kun2210 commented 6 years ago

Nevermind, just updated the scripts to work with most recent version. It turned out I had to change maybe 2 or 3 lines of code and it went smoothly. Thanks for support!