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

Error after building the schema #21

Open
iamshreeram opened this issue Dec 3, 2021 · 8 comments
Open

Error after building the schema #21

iamshreeram opened this issue Dec 3, 2021 · 8 comments

Comments

@iamshreeram
Copy link

Seeing below error after building the schema.

2021/12/03 23:00:57 built document type for dlake-kubernet-namespaces in 1.349116ms
2021/12/03 23:00:57 built boolean argument type for dlake-kubernet-namespaces in 597.751µs
2021/12/03 23:00:57 built document aggregation type for dlake-kubernet-namespaces in 573.113µs
2021/12/03 23:00:57 Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "dlake-kubernet-namespaces" does not.

Couldn't trace the root cause. Any suggestion?

cc: @mewil

@mewil
Copy link
Owner

mewil commented Dec 8, 2021

This occurred because GraphQL does not support schema names with - in the name. Previously we only applied name normalization logic field and argument names, but as of e714f3fd this also applies to index names and should fix your use case.

@iamshreeram
Copy link
Author

Perfect. This is working.

Btw, I have set the index include pattern as - set -gx STURGEON_ELASTICSEARCH_INDEX_INCLUDE_PATTERN "dlake_*"
But, application is exiting with below exception -

2021/12/09 00:40:59 RootQuery fields must be an object with field names as keys or a function which return such an object.

When I use just dlake*, sturgeon is able to pull all the index details. Any reason?

@mewil
Copy link
Owner

mewil commented Dec 9, 2021

Great!

This occurs because the STURGEON_ELASTICSEARCH_INDEX_INCLUDE_PATTERN variable applies to the literal index name (dlake-kubernet-namespaces) and not the "normalized" GraphQL-compatible version (dlake_kubernet_namespaces). I'll add better handling for the case where no schemas are generated which yields the error you see.

@iamshreeram
Copy link
Author

I think you will have to handle all special characters. Below one is failing because of a . between dates.

2021/12/09 13:58:09 Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "dlake_pb_batchjobs_2020.05.24_000001_agg_docs" does not.

@mewil
Copy link
Owner

mewil commented Dec 11, 2021

Fixed in d7363dd to replace any non-alphanumeric character with _.

@iamshreeram
Copy link
Author

Yes, Above PR fixed the issue. Seeing below error though.

2021/12/11 11:49:25 dlake_snw_inc_bool_argsfilter fields must be an object with field names as keys or a function which return such an object.
exit status 1

This looks similar to this error

@mewil
Copy link
Owner

mewil commented Dec 30, 2021

This might be fixed in 2ca30dc but similar errors may still occur in other places.

@iamshreeram
Copy link
Author

Thanks for looking into this. I'm still seeing the same error (in the boolean). Is there any work around for this issue?

Could you please explain whats going on? If there is any work around just for my use-case, i can fork and make it work just for my ES. Let me know.

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

No branches or pull requests

2 participants