tableau/tableau-migration-sdk

404 on Tableau Cloud /auth/signin, with create_api_simulator=True

Closed this issue · 8 comments

jdub commented

Hello,

I'm getting a 404 from the /auth/signin endpoint when running 1.0.0 or 1.1.0, with and without create_api_simulator=True. The request looks correct enough.

If I make a JSON request with curl to the same URL with the same values, I get a 200.

Worse, if I make an XML request with curl to the same URL with the string below (and correct values), I get a 200. Even if I replicate all the headers in the SDK log, it's happy. See below.

SDK:

2024-02-16 20:15:53,153 - Tableau.Migration.Net.NetworkTraceLogger - INFO - HTTP POST https://prod-apsoutheast-a.online.tableau.com/api/3.18/auth/signin responded NotFound. Details: # Request Headers
Accept: application/xml
User-Agent: TableauMigrationSDK-Python/1.1.0.0
Content-Type: application/xml; charset=utf-8
# Response Headers
Content-Type: application/xml; charset=utf-8

# Request Content
<tsRequest><credentials personalAccessTokenName="REDACTED" personalAccessTokenSecret="*****"><site contentUrl="REDACTED" /></credentials></tsRequest>

# Response Content
<tsResponse><error code="404000"><summary>Not Found Summary</summary><detail>Not Found Detail</detail></error></tsResponse>

2024-02-16 20:15:53,153 - System.Net.Http.HttpClient.DefaultHttpClient.LogicalHandler - INFO - End processing HTTP request after 8.2545ms - 404

Curl: curl --verbose -d @cloud.xml -H "Content-Type: application/xml; charset=utf-8" -H "User-Agent: TableauMigrationSDK-Python/1.1.0.0" -H "Accept: application/xml" https://prod-apsoutheast-a.online.tableau.com/api/3.18/auth/signin

> POST /api/3.18/auth/signin HTTP/1.1
> Host: prod-apsoutheast-a.online.tableau.com
> Content-Type: application/xml
> User-Agent: TableauMigrationSDK-Python/1.1.0.0
> Accept: application/xml
> Content-Length: 202
>
< HTTP/1.1 200
< content-type: application/xml;charset=utf-8
< date: Fri, 16 Feb 2024 09:25:45 GMT
< p3p: CP="NON"
< referrer-policy: strict-origin-when-cross-origin
< server: Tableau
< Set-Cookie: hid=pdasaa-hap01; domain=.prod-apsoutheast-a.online.tableau.com; path=/; HttpOnly; Secure; SameSite=None
< Set-Cookie: AWSELB=REDACTED;PATH=/;DOMAIN=.prod-apsoutheast-a.online.tableau.com;SECURE;HTTPONLY;SAMESITE=None
< strict-transport-security: max-age=31536000; includeSubDomains
< vary: Accept-Encoding
< x-content-type-options: nosniff
< x-tableau: Tableau Server
< x-ua-compatible: IE=Edge
< x-xss-protection: 1; mode=block
< transfer-encoding: chunked
< Connection: keep-alive
jdub commented

The URL seems the same between SDK and curl, but the SDK gets a 404… and I can't seem to construct a request (with curl) that gets a 404.

jdub commented

I should note that it does log in to Tableau Server correctly.

Hi @jdub,

Really appreciate your feedback here and we've filed a story on our end to take a closer look and see if we can get a repro. We'll get back to you as soon as we complete a quick investigation on our end.

Thank you!

Hi @jdub - I can reproduce the issue (and we'll schedule a fix) when using a simulated destination, but can't reproduce when using a real Tableau Cloud site. Are you sure Tableau Cloud is returning a 404 and not another status code? The response above is from the simulator, and not a real Tableau Cloud API, as it has stubbed out error details.

jdub commented

@rbanderton The same thing happens when I remove the simulator code. (Luckily, because otherwise it would start doing things!)

@jdub Is the same exact 404 response returned when using create_api_simulator=False? That would indicate the simulator is being used when the flag is false, which is an issue I also cannot reproduce. Could you please share a code snippet that returns 404 with simulation disabled?

jdub commented

@rbanderton With create_api_simulator=False, I get a 401 (correctly, because I'm using a broken token to avoid executing anything). I then removed the param entirely and also got a 401. Which was not the case previously. So it's entirely possible I made a couple of changes to provoke this problem. 😬

But that means we know it's the simulator as you diagnosed, so I've changed the title to reflect that.

Fixed in v2.0.0