Forum Discussion
User data function invocation failed (but works in testing)
- 15 days ago
After a long stint working with microsoft tech support (big thanks to Naeem), we finally found the source of the issue:
I had, not knowing better, used the line
udf = fn.UserDataFunctions()at the beginning of every (publicly visible) function in the document, like this:
udf = fn.UserDataFunctions() @udf.connection(argName="sqlDB", alias="COGSdb") @udf.function() async def runAllCogsCalculations(sqlDB: fn.FabricSqlConnection) -> str:While for some reason this does not cause issues in testing, it leads to all functions defined before the last instance of the line to be unavailable when published, without producing a clear error as to why.
Luckily, the solution is very simple: just remove all but the first use of "udf = fn.UserDataFunctions()" without changing anything else, and the issue should be resolved.
Hopefully this helps someone who's facing the same issue. I also made sure to report the problem somehow bypassing testing to microsoft, and I hope in the future there will be a proper error to prevent this.
Hi aplia,
This is interesting.
Just to confirm a few things, have you check capacity metrics to ensure that your capacity has returned to a normal state? WIth how capacity smoothing works, sometimes it will stay in a throttled state until well after the task that caused the throttling has ended.
Outside of that, are you the user that is trying to click the button in the report? Are permissions applied correctly if you are not that user?
If your capacity is good, and permissions are good, then I've never seen this behaviour before.
THe last troubleshooting step I would recommend is to re-publish the UDF and see if that changes anything, if not, this sounds like a bug somewhere and a ticket to Microsoft may be needed.