Remote datasets not Working: SOLVED


just sharing a solution which might help somebody having the same problem. I was trying to work with remote datasets, however, even they showed correct results using “Test Data URL”, the results were not fetched by the FetchRemoteDatasets-Task nor displayed in the data table.

It showed an error parsing JSON (no valid json) in the notifications. After some debugging, I came up with a solution, being related to the Guzzle HTTP client used for fetching. The function “getContents()” seems to be a bit tricky in this context, as it uses a sort of pointer which only allows to read Contents one time. After that, rewinding the pointer is needed. More information on several forums concerning Guzzle… So it seems that getContents() returns an empty string, resulting in invalid JSON data.

As a solution, I replaced the line
$body = $request->getBody()->getContents();

$body = (string) $request->getBody();

The cast to string always returns the full Body, that means it eliminates problems with getContents(). After that change, data was perfectly received by my table.

Hope this helps anybody :wink:

Thanks for your report.

This was already logged as a bug here and there’s a patch attached: