Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvalidDefinitionException : Time unit must be {quantity}{unit} #12672

Closed
danotorrey opened this issue May 16, 2022 · 1 comment
Closed

InvalidDefinitionException : Time unit must be {quantity}{unit} #12672

danotorrey opened this issue May 16, 2022 · 1 comment
Labels

Comments

@danotorrey
Copy link
Contributor

danotorrey commented May 16, 2022

Overview

When attempting to share a dashboard, the following error happens:

java.lang.RuntimeException: IOException encountered while reading from a byte array input stream
Unhandled exception in REST resource
java.lang.RuntimeException: IOException encountered while reading from a byte array input stream
        at org.mongojack.internal.stream.JacksonDBDecoder.decode(JacksonDBDecoder.java:67) ~[graylog.jar:?]
        at org.mongojack.JacksonDBCollection.findOneById(JacksonDBCollection.java:1291) ~[graylog.jar:?]
        at org.graylog.plugins.views.search.db.SearchDbService.get(SearchDbService.java:72) ~[graylog.jar:?]
        at org.graylog.plugins.views.search.views.RequiresParameterSupport.test(RequiresParameterSupport.java:43) ~[graylog.jar:?]
org.graylog.plugins.views.search.searchtypes.pivot.buckets.AutoValue_Time$Builder["interval"])
Caused by: java.lang.IllegalArgumentException: Time unit must be {quantity}{unit}, where quantity is a positive number and unit [smhdwM].
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:142) ~[graylog.jar:?]

This appears to be happen when invalid pivots were entered through the UI (was previously possible due to a bug).

See related issue/PR
Related to this issue/PR, where invalid pivots entered through the UI.
#7195
#7196

Solution

To fix the issue, the invalid time unit will need to be identified and manually fixed with a Mongo command. The unit should be a number and a valid unit, for example 365d. Although this might not be the correct mongo command for every instance of this issue, I am documenting it here for reference.

db.searches.updateOne({ "_id": ObjectId("affected-search-id") }, { $set: { "[queries.0.search](http://queries.0.search/)_types.1.row_groups.0.interval.timeunit" : "365d" } })

HS800430336

@danotorrey
Copy link
Contributor Author

Issue created only for future reference, so I am closing it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant