Skip to main content
When working with the SDK, the Self-Service Analytics client might return one or more error messages. The following tables describe all the error messages the SDK might return, and some possible solutions.

createQuery

ErrorDescriptionSolution
metrics must be an arrayThe metrics attribute of the query configuration object is not an array.Make sure metrics is an array, even if it’s just an array of one.
invalid metricsMetrics function, for example “avg” or “min”, is not one of the expected values.The metrics function must be one of the following: ‘min’ , ‘max’ , ‘avg’ , ‘sum’ , ‘calc’ , ‘distinct_count’ , ‘last_value’ , ‘percentiles’
groups is not defined
fields is not defined
The query configuration object has neither a groups attribute or a fields attribute.Either groups or fields must be defined. See the query configuration page for more information about the query configuration object.
groups is not defined
fields must be an array of field names
The query configuration object has a fields attribute that is not an array of field names, and does not define a groups attribute.Make sure your fields attribute is an array, or add a groups attribute to the query configuration object.
groups must be an array of groups configurations
fields is not defined
The query configuration object has a groups attribute that is not an array of groups configurations, and does not have a fields attribute.Make sure your groups attribute is an array. If you do not want a grouped query, add a fields attribute with an array of field names.
filters must be an arrayThe query configuration object has a filters attribute that is not an array of filter configurations.Make sure your filters attribute is an array, even if it’s an empty array [] or an array of just one configuration.
element expectedConfiguration passed to visualize() does not have an ‘element’ attribute that is a webpage element.Check out the XYZ link to visualize sample.
visualization does not existUsing visualize(), you tried to create a visualization that does not exist.Check the name of your visualization and make sure it is valid. If using a custom chart, make sure you copied the name exactly.
data set emptyThe data set that you are trying to access is empty.This message will result if you have a non-live (static) data source and the query to access it contains pauseAfterRead set to false . A query to static data sources should have pauseAfterRead set to true, otherwise the query attempts to read and reread the source.