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

Libbeat mapstriface.go: Error message is misleading #18662

Closed
alakahakai opened this issue May 20, 2020 · 2 comments
Closed

Libbeat mapstriface.go: Error message is misleading #18662

alakahakai opened this issue May 20, 2020 · 2 comments
Labels
good first issue Indicates a good issue for first-time contributors Team:Services (Deprecated) Label for the former Integrations-Services team

Comments

@alakahakai
Copy link

The error message from https://github.com/elastic/beats/blob/master/libbeat/common/schema/mapstriface/mapstriface.go 105 is misleading. It is not displaying the type of the errored value properly. They are always displayed as map[string]interface {}.

2020-05-05T17:46:57.188-0500 ERROR mapstriface/mapstriface.go:105 wrong format in `dataFileVersion`: expected dictionary, found map[string]interface {}
2020-05-05T17:46:57.188-0500 ERROR mapstriface/mapstriface.go:105 wrong format in `extentFreeList`: expected dictionary, found map[string]interface {} 

A type switch should be used there instead of cast.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 20, 2020
@andresrc andresrc added the Team:Services (Deprecated) Label for the former Integrations-Services team label May 22, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-services (Team:Services)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label May 22, 2020
@andresrc andresrc added [zube]: Inbox good first issue Indicates a good issue for first-time contributors [zube]: Backlog and removed [zube]: Inbox labels May 22, 2020
@urso
Copy link

urso commented May 25, 2020

If by dictionary we mean common.MapStr, then map[string]interface{} should be valid as well. Sometimes we get map[string]interface{} when parsing JSON into a MapStr. Libbeat normally takes care of this by dynamically casting map[string]interface{} to common.MapStr via type switches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Indicates a good issue for first-time contributors Team:Services (Deprecated) Label for the former Integrations-Services team
Projects
None yet
Development

No branches or pull requests

4 participants