Forum Discussion
bind to gateway API returning false success.
Hi,
there are no details in your question except for the dataset Id, and the error you posted is way above what PowerBI returned, So without PowerBi's error message (or at least the requestId with which we can investigate, it's really hard to know why your request failed.
But I looked at your dataset activities 11/19-20 and I see many errors. Half are of invalid requests and the rest is because you send too many request in a short period, so some where rejected with a meassage asking to try a bit later.
Hope this helps.
Yoav (PBI staff)
I am having the same exact error. I am building a powershell script to automate publishing. I have enabled Fiddler and I can catch the 400 bad request, but when I repeat, the same exact request via fiddler...it works. Is there indeed a timing thing? I am doing a few API calls, pretty much back to back. I am getting an AAD token, followed by getting the groupid, then the reportid based on the name of the pbix file, to make sure the workspace and report exist and if so, need to be overwritten. I then publish the pbix, followed by taking ownership of the dataset and setting parameters. I then am trying to bind the dataset to a gateway using:
https://api.powerbi.com/v1.0/myorg/groups/GroupId/datasets/DatasetId/BindToGateway
To it I use the following body:
{"gatewayObjectId": "GatewayId"}
First attempt as part of the script I get a:
HTTP/1.1 400 Bad Request
Cache-Control: no-store, must-revalidate, no-cache
Content-Type: application/json; charset=utf-8
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Frame-Options: deny
X-Content-Type-Options: nosniff
RequestId: 1507f40e-c4d3-4505-b18c-08d756c68599
Date: Tue, 29 Jan 2019 05:10:55 GMT
Content-Length: 189
{"error":{"code":"DMTS_CanNotFindMatchingDatasourceInGatewayError","pbi.error":{"code":"DMTS_CanNotFindMatchingDatasourceInGatewayError","parameters":{},"details":[],"exceptionCulprit":1}}}
But using Fiddler's Composer I clone the same EXACT request and get:
HTTP/1.1 200 OK Cache-Control: no-store, must-revalidate, no-cache Content-Type: application/octet-stream Strict-Transport-Security: max-age=31536000; includeSubDomains X-Frame-Options: deny X-Content-Type-Options: nosniff RequestId: b8ce9e60-298d-4054-ae41-78d97c273898 Date: Tue, 29 Jan 2019 05:15:46 GMT Content-Length: 0
Please help. I am actually setting up an Azure DevOps Release pipeline to automate this process for my developers.
Update:
I have noticed that a 2 second sleep seems to help, but now I am getting this on the update parameters request:
HTTP/1.1 429
Cache-Control: no-store, must-revalidate, no-cache
Transfer-Encoding: chunked
Content-Type: application/json; charset=utf-8
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Frame-Options: deny
X-Content-Type-Options: nosniff
RequestId: e63505f6-bf41-4d22-94d8-d883188b4923
Date: Tue, 29 Jan 2019 06:02:01 GMT
7F
{"error":{"code":"ActivityLimitReached","message":"UpdateDatasetParameters on c629a2a9-3932-4ce6-a5f6-1de659406843 throttled"}}
0
I think it is self explanatory.