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

log errors on make_encoder() #14

Closed
wants to merge 9 commits into from
Closed

Conversation

patrick-prima
Copy link
Contributor

@patrick-prima patrick-prima commented Nov 1, 2024

We have an odd problem where a small schema update is causing avrogen to fail on startup. We think a little more logging might help us understand what is going on.

For reference, these PRs fail:

** (Mix) Could not start application uk_avro_schema: UkAvroSchema.Application.start(:normal, []) returned an error: shutdown: failed to start child: Avrogen.Schema.SchemaRegistry
    ** (EXIT) an exception was raised:
        ** (ErlangError) Erlang error: "union should have at least one member type"
            (erlavro 2.9.10) /Users/xxx/projects/uk-quote-request-transformers/deps/erlavro/src/avro_union.erl:73: :avro_union.type/1
            (erlavro 2.9.10) /Users/xxx/projects/uk-quote-request-transformers/deps/erlavro/src/avro_json_decoder.erl:72: :avro_json_decoder.decode_schema/2
            (erlavro 2.9.10) /Users/xxx/projects/uk-quote-request-transformers/deps/erlavro/src/avro_util.erl:77: :avro_util.ensure_lkup_fun/1
            (erlavro 2.9.10) /Users/xxx/projects/uk-quote-request-transformers/deps/erlavro/src/avro.erl:208: :avro.make_encoder/2
            (avrogen 0.6.6) lib/avrogen/schema/schema_registry.ex:43: anonymous fn/1 in Avrogen.Schema.SchemaRegistry.init/1
            (noether 0.2.5) lib/noether/either.ex:23: Noether.Either.map/2
            (avrogen 0.6.6) lib/avrogen/schema/schema_registry.ex:41: Avrogen.Schema.SchemaRegistry.init/1
            (stdlib 4.3.1.3) gen_server.erl:851: :gen_server.init_it/2

@patrick-prima patrick-prima requested a review from a team as a code owner November 1, 2024 16:21
@patrick-prima patrick-prima marked this pull request as draft November 1, 2024 16:22
oxg558
oxg558 previously approved these changes Nov 1, 2024
Copy link
Contributor

@oxg558 oxg558 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Would be a lot easier to debug if we could recreate the problem locally...

@oxg558
Copy link
Contributor

oxg558 commented Nov 1, 2024

Though since the error itself happens quite deep in an erlavro call I'm not sure if this log will tell us much more... it will at least show us what order the schemas are being sorted in, which might be what has changed.

oxg558
oxg558 previously approved these changes Nov 1, 2024
@patrick-prima patrick-prima marked this pull request as ready for review November 1, 2024 16:38
oxg558
oxg558 previously approved these changes Nov 4, 2024
oxg558
oxg558 previously approved these changes Nov 4, 2024
@patrick-prima
Copy link
Contributor Author

We found the culprit.

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

Successfully merging this pull request may close these issues.

2 participants