Hello, I'm running into a model validation issue a...
# gooddata-cloud
Hello, I'm running into a model validation issue and could use some help. I was making a change to some of my model elements and broke a bunch of metrics. I then put the attribute back into the model so it should be fixed now, but I'm still getting invalid model objects. Is there some sort of cache on the AnalyticalModel that is not being refreshed?
Really don't want to recreate all of the metrics, because that would be unfortunate.
Hi Steve, sorry for the delay in getting back to you here - Would you please be so kind as to walk us through the steps you took? Did you delete the Attribute and see the validation issues, as in my screenshot below and still went ahead with the deletion? Or you canceled the update from here and you’re still seeing validation issues?
And yes, GoodData stores computed results for your analytics in an internal cache. However, if new data arrives to the database, you need to refresh this cache to ensure your visualizations display the latest data. More details on this can be found here: https://www.gooddata.com/docs/cloud/connect-data/cache-management/reload-cached-data/#invalidate-cached-data
So our "Authoring Environment" as I have coined it is setup as such: • LDM_Authoring (parent) • Analytical_Authoring (child of parent with a WDF) • Because our LDM is not in the Analytical Model, we use an Admin tool that calls into the 5 main parts of the analytical model looking for invalid: ◦ Metrics ◦ Contexts ◦ Visualization Objects ◦ Filters ◦ Dashboards In our LDM • I removed an attribute that was being used by a bunch of metrics (not intentional) • Ran our admin tool looking for issues • Discovered that my changes caused several metrics to be invalidated. • I then re-added the missing model value into the LDM ◦ Checked the analytics model in our admin tool ◦ Still invalid • I re-imported an old version of the LDM ◦ Still marked as invalid • I then created a new metric and verified that the item listed in the metric is there and usable. Meaning it should no longer be valid. Thats when I didn't know what else I could do other than reach out to you all.
I have evidence this makes no sense: I just created a brand new metric with the EXACT same logic:
{ "content": { "format": "#,##0.00", "maql": "SELECT COUNT({label/INVOICE_NUMBER})\nWHERE {fact/daysoverdue} <= 15\n AND {fact/daysoverdue} >= 0\n AND {label/outstanding.isoutstanding} = \"true\"" }, "createdAt": "2023-11-28 15:08", "createdBy": { "id": "steve.fox", "type": "user" }, "description": "", "id": "age_count_0-15_days", "modifiedAt": "2023-11-29 23:02", "modifiedBy": { "id": "steve.fox", "type": "user" }, "title": "AGE: Count 0-15 days" }, { "content": { "format": "#,##0.00", "maql": "SELECT COUNT({label/INVOICE_NUMBER})\nWHERE {fact/daysoverdue} <= 15\n AND {fact/daysoverdue} >= 0\n AND {label/outstanding.isoutstanding} = \"true\"" }, "createdAt": "2023-12-18 21:34", "createdBy": { "id": "steve.fox", "type": "user" }, "description": "", "id": "age_count_0-15_days_new", "title": "AGE: Count 0-15 days" }
and the original one is still marked as invalid and won't show in teh UI.
I really, do not like that these don't show in the UI if invalid makes this whole process cumbersome.
Really wish Metrics were part of the LDM.
Either way i'm going to recreate the metrics. I think there is an issue with the child workspace analytical models handling errors with the parent data model.
I really do not like that the UI doesn't allow you to see invalid insights, metrics. This is not fun.
It seems that we encountered a similar scenario in the past, and unfortunately, there’s still no alternative method for recovering the broken metrics other than recreating them. Please let me link here the thread for reference. Alternatively, I can also recommend creating a backup for the workspace via the Declarative API endpoints. As the article I just shared explains, these types of endpoints will allow you to back up an entire component via a GET call, which you can then restore by performing a PUT call with the backup. Here is the article explaining the endpoints for Workspace Declarative APIs. There’s also one for the entire organization, as per Create and Restore Backups.