Dataset Framework throws NotFoundExn without logging or returning the actual error
Activity
Show:

Andreas Neumann July 30, 2015 at 10:57 PM
To fix this, we need to change DatasetInstanceService:
If the typeMeta is null, that is obviously an unexpected state, and we should not throw NotFound. Probably there is also a bug in the DatasetFrameworkClient, which does not preserve the message returned in the 404 (that contains the dataset type name and would at least be a hint). But it seems to simply convert any 404 into returning null.
Won't Fix
Pinned fields
Click on the next to a field label to start pinning.
Details
Details
Assignee

Reporter

Labels
Affects versions
Components
Priority
Created July 30, 2015 at 10:50 PM
Updated December 9, 2020 at 8:59 PM
Resolved June 9, 2020 at 1:27 AM
When a dataset cannot be instantiated (for example, its type cannot be found), then the dataset framework simply throws a NotFoundException. That leads to a wrong error message.
In this case, a DatasetDefinition.configure() returned a spec with a type name of "twoTables", but the DatasetModule registers the type as "TwoTables". So, when the dataset framework instantiates the dataset, it first loads the spec, the tries to find the type from that spec - which does not exist (wrong case). Instead of logging an error, or throwing an IllegalStateException, it now throws a NotFoundException - of course without a message that could indicate "dataset type 'twoTables' does not exist". The dataset framework client interprets this a "dataset instance does not exist" and thus reports a wrong error message.
For the user, this is baffling. You see in the logs that the dataset gets created, but when you instantiate it in an app or test case, you get "Dataset does not exist".