DataConnectors icon indicating copy to clipboard operation
DataConnectors copied to clipboard

Stack overflow on internal errors

Open monty241 opened this issue 7 years ago • 1 comments

When a custom connector raises an exception on data refresh, current releases of Power BI will not correctly handle them and instead cause a stack overflow to occur in Power BI code.

The custom connector is actually an ado.net provider, which Power BI (thank you!) supports nicely in advanced queries (https://ado.net-provider.cloud/) when you install it on the machine. It does not use ODBC, so it is direct connection without older stuff.

Some real-life samples to show it is not hypothetical:

Password change

One of the ERP cloud providers that we have a Power BI driver for, recently decided to reset all passwords. Shortly after that we started receiving complaints. Users changed their password in the web user interface of the ERP cloud provider, but forgot that their pbix manages those credentials too. The ERP cloud provide uses OAuth2, but instead of maintaining an eternally valid token for the app we use the password to retrieve a new short-lifed token every time. So, on refresh our driver raised an OAuth failure, since the password was wrong. That error bubbles nicely up when using the Excel plugin Invantive Control or the online SQL editor. But that error in Power BI is caught somewhere by Power BI code and then causes an eternal loop.

After the users were instructed to manage credentials, the error went away. Altogether the down time was relatively short, but it is an issue every user at that was confronted with. A typical business user doesn't remember that he once entered a password and then changed that password and then relates a stackoverflow error in Power BI to the changed password.

Data type error

We received a call. This one took time to understand, since there was no easy reproduction scenario.

A user had different data in a table than our metadata expected. Our checks between metadata and the actual data fetched were insufficient; we allowed for instance an int64 to be returned from an int32 column as specified in the metadata. This bug of ourselves has been corrected by now.

But Power BI also does data type validation. Sometimes a stackoverflow was returned from Power BI, sometimes a data type conversion error. It might be that new versions of Power BI had some improvements in this area; we are unsure what caused the varying outcomes in terms of error.

Suggestion

It would be great when instead of a stackoverflowexception, the actual exception raised would be shown in Power BI (in the yellow bar on top of the data area).

monty241 avatar Jun 25 '17 10:06 monty241