Skip to content

update_connection() returned 400033 Bad Request #1305

@rng-spokeo

Description

@rng-spokeo

Describe the bug
I'm trying to loop thru all the datasource/workbook connections and update the connection password. However, it will randomly returned 400033: Bad Request. Sometime, it works for more than 5 connections but sometime only works for 1 connection.

This was working before Oct 13th.

Versions
Tableau Server version (or note if using Tableau Online) - Tableau Online 2023.3.0 (20233.23.1012.1548) 64-bit Linux
Tableau Pod: us-west-2b
Python version: 3.9.13
TSC library version: 0.28

To Reproduce


tableau_auth = TSC.PersonalAccessTokenAuth(<token_name>, <token_pw>, site_id=<tableau_site_id>)
server = TSC.Server(<tableau_server_address>, use_server_version=True)

with server.auth.sign_in(tableau_auth):
    for datasource in TSC.Pager(server.datasources.get):
        for item,conn in enumerate(datasource.connections):
            connection = datasource.connections[item]
            connection.embed_password = True
            connection.server_address = <connection_server_address>
            connection.username = <connection_server_username>
            connection.password = <connection_server_password>
            server.datasources.update_connection(datasource, connection)

    for workbook in TSC.Pager(server.workbooks.get):
        for item,conn in enumerate(workbook.connections):
            connection = workbook.connections[item]
            connection.embed_password = True
            connection.server_address = <connection_server_address>
            connection.username = <connection_server_username>
            connection.password = <connection_server_password>
            server.workbooks.update_connection(workbook, connection)

Results

  File ".../tableauserverclient/server/endpoint/endpoint.py", line 292, in wrapper
    return func(self, *args, **kwargs)
  File ".../tableauserverclient/server/endpoint/datasources_endpoint.py", line 165, in update_connection
    server_response = self.put_request(url, update_req)
  File ".../tableauserverclient/server/endpoint/endpoint.py", line 239, in put_request
    return self._make_request(
  File ".../tableauserverclient/server/endpoint/endpoint.py", line 166, in _make_request
    self._check_status(server_response, url)
  File ".../tableauserverclient/server/endpoint/endpoint.py", line 189, in _check_status
    raise ServerResponseError.from_response(server_response.content, self.parent_srv.namespace, url)
tableauserverclient.server.endpoint.exceptions.ServerResponseError: 

	400033: Bad Request
		There was a problem updating connection information for datasource 'xxxxxxxxxxxxx'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions