-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TableauRefreshWorkbookOperator fails when using personal access token (Tableau authentication method) #16669
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
Hey! I can make an investigation on this issue and prepare the first PR! Are you ok with that? |
yes, sure @samgans ! Thanks |
Hello again! I've made a basic investigation on it and found that we actually have a bit weird situation. The thing is that if you are authenticating your Tableau connection with a personal access token, each time you will try to open a parallel connection, the previous one will be invalidated. You can read more about this in the thread: tableau/server-client-python#717. Speaking of our issue and how it is related to the Tableau personal token: in the "blocking" task, we are using the TableauJobStatusSensor that opens another connection, therefore, invalidating the previous one causing the wrapping TableauHook to fail (you can check more in the So, we have two options here:
BUT! It seems like if the user will add one or more Tableau task which will use the same token and run in parallel, we can get some hard-to-debug errors due to parallel invalidation of tokens. Therefore, it seems to me that we shouldn't use this approach and take a look at the next one.
What do you think? |
Great, thanks a lot for investigating this @samgans ! On my side I created a new 'airflow' user in Tableau with 'Site Administrator Explorer' role and will use the username/password authentication then. Could this be a possible 3rd solution though? |
The deprecation will not be related directly to Speaking of the third solution, I've been thinking about some kind of strategy of reusing the existing connection by I know exactly that if we will reuse a connection from a global variable, all will be good if we will have multiple related tasks in one DAG. But if we will have some other Tableau tasks with the same personal token in other DAGs? It seems to me that all the DAG definitions are executed at different processes so we can't guarantee that there will be access to one global variable between all the DAG definitions. We also can't check if there are multiple authentication attempts using the Tableau server client, so it seems to me that deprecation is the best option. Also, if you have some ideas on how the third solution can be implemented, I'm open to trying this out. |
thanks @samgans ! |
Apache Airflow version: 2.0.1
What happened:
The operator fails at the last step, after successfully refreshing the workbook with this error:
What you expected to happen:
It should not fail, like when we use the username/password authentication method (instead of personal_access_token)
Tableau server does not allow concurrent connections when using personal_access_token tableau/server-client-python#717
The solution would be redesigning completely the operator to only call the hook once.
My quick fix was to edit this in TableauHook:
How to reproduce it:
Run this operator TableauRefreshWorkbookOperator using Tableau personal_access_token authentication (token_name, personal_access_token).
The text was updated successfully, but these errors were encountered: