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

Fix issue where notifications service failed for ServiceNow requests #4500

Merged
merged 1 commit into from
Dec 28, 2020

Conversation

jaym
Copy link
Contributor

@jaym jaym commented Dec 18, 2020

Before, we were getting the following error:

 ** (UndefinedFunctionError) function Google.Protobuf.Timestamp.__message_props__/0 is undefined (module Google.Protobuf.Tim

     Google.Protobuf.Timestamp.__message_props__()
     (protobuf) lib/protobuf/decoder.ex:15: Protobuf.Decoder.decode/2
     (protobuf) lib/protobuf/decoder.ex:152: Protobuf.Decoder.build_struct/3
     (protobuf) lib/protobuf/decoder.ex:16: Protobuf.Decoder.decode/2
     (grpc) lib/grpc/stub.ex:484: GRPC.Stub.parse_response/4
     (grpc) lib/grpc/stub.ex:428: GRPC.Stub.do_recv/2
     (notifications) lib/data/secret_store.ex:39: Notifications.Data.SecretStore.handle_call/3
     (stdlib) gen_server.erl:661: :gen_server.try_handle_call/4
 Last message (from #PID<0.5748.0>): {:read, "b1c01a67-6a2f-4ffe-8899-dfb258b26f2f"}
 State: %{channel: %GRPC.Channel{accepted_compressors: [], adapter: GRPC.Adapter.Gun, adapter_payload: %{conn_pid: #PID<0.1432.0>}, codec: GRPC.Codec.Proto, compressor: nil, cred: %GRPC.Credential{ssl: [certfile: "/hab/svc/secrets-service/config/service.crt", keyfile: "/hab/svc/secrets-service/config/service.key", cacertfile: "/hab/svc/secrets-service/config/root_ca.crt", versions: [:"tlsv1.2"]]}, headers: [], host: "127.0.0.1", interceptors: [], port: 10131, scheme: "https"}}
 Client #PID<0.5748.0> is alive

     (stdlib) gen.erl:169: :gen.do_call/4
     (elixir) lib/gen_server.ex:986: GenServer.call/3
     (notifications) lib/service.ex:154: Notifications.Service.get_target_username_password/1
     (notifications) lib/service.ex:44: Notifications.Service.validate_webhook/2
     (grpc) lib/grpc/server.ex:164: anonymous fn/6 in GRPC.Server.call_with_interceptors/4
     (grpc) lib/grpc/server.ex:181: GRPC.Server.call_with_interceptors/4
     (grpc) lib/grpc/adapter/cowboy/handler.ex:346: GRPC.Adapter.Cowboy.Handler.do_call_rpc/3
     (grpc) lib/grpc/adapter/cowboy/handler.ex:319: GRPC.Adapter.Cowboy.Handler.call_rpc/3
 19:39:37.819 module=GRPC.Server [error] ** (exit) exited in: GenServer.call(Notifications.Data.SecretStore, {:read, "b1c01a67-6a2f-4ffe-8899-dfb258b26f2f"}, 5000)

There was a commit the removed a dependency on the google_protos package which
caused that to break. I've added that back in. Also, the notifications-service
needs some the common/query/parameters.proto, which i've added.

@netlify
Copy link

netlify bot commented Dec 18, 2020

👷 Deploy preview for chef-automate processing.

🔨 Explore the source changes: cd89ab7

🔍 Inspect the deploy logs: https://app.netlify.com/sites/chef-automate/deploys/5fdd20affddca700084b67f4

Before, we were getting the following error:
```
 ** (UndefinedFunctionError) function Google.Protobuf.Timestamp.__message_props__/0 is undefined (module Google.Protobuf.Tim

     Google.Protobuf.Timestamp.__message_props__()
     (protobuf) lib/protobuf/decoder.ex:15: Protobuf.Decoder.decode/2
     (protobuf) lib/protobuf/decoder.ex:152: Protobuf.Decoder.build_struct/3
     (protobuf) lib/protobuf/decoder.ex:16: Protobuf.Decoder.decode/2
     (grpc) lib/grpc/stub.ex:484: GRPC.Stub.parse_response/4
     (grpc) lib/grpc/stub.ex:428: GRPC.Stub.do_recv/2
     (notifications) lib/data/secret_store.ex:39: Notifications.Data.SecretStore.handle_call/3
     (stdlib) gen_server.erl:661: :gen_server.try_handle_call/4
 Last message (from #PID<0.5748.0>): {:read, "b1c01a67-6a2f-4ffe-8899-dfb258b26f2f"}
 State: %{channel: %GRPC.Channel{accepted_compressors: [], adapter: GRPC.Adapter.Gun, adapter_payload: %{conn_pid: #PID<0.1432.0>}, codec: GRPC.Codec.Proto, compressor: nil, cred: %GRPC.Credential{ssl: [certfile: "/hab/svc/secrets-service/config/service.crt", keyfile: "/hab/svc/secrets-service/config/service.key", cacertfile: "/hab/svc/secrets-service/config/root_ca.crt", versions: [:"tlsv1.2"]]}, headers: [], host: "127.0.0.1", interceptors: [], port: 10131, scheme: "https"}}
 Client #PID<0.5748.0> is alive

     (stdlib) gen.erl:169: :gen.do_call/4
     (elixir) lib/gen_server.ex:986: GenServer.call/3
     (notifications) lib/service.ex:154: Notifications.Service.get_target_username_password/1
     (notifications) lib/service.ex:44: Notifications.Service.validate_webhook/2
     (grpc) lib/grpc/server.ex:164: anonymous fn/6 in GRPC.Server.call_with_interceptors/4
     (grpc) lib/grpc/server.ex:181: GRPC.Server.call_with_interceptors/4
     (grpc) lib/grpc/adapter/cowboy/handler.ex:346: GRPC.Adapter.Cowboy.Handler.do_call_rpc/3
     (grpc) lib/grpc/adapter/cowboy/handler.ex:319: GRPC.Adapter.Cowboy.Handler.call_rpc/3
 19:39:37.819 module=GRPC.Server [error] ** (exit) exited in: GenServer.call(Notifications.Data.SecretStore, {:read, "b1c01a67-6a2f-4ffe-8899-dfb258b26f2f"}, 5000)
```

There was a commit the removed a dependency on the google_protos package which
caused that to break. I've added that back in. Also, the notifications-service
needs some the common/query/parameters.proto, which i've added.

Signed-off-by: Jay Mundrawala <jmundrawala@chef.io>
@jaym jaym force-pushed the jdm/notifications-protobufs branch from d5c394c to cd89ab7 Compare December 18, 2020 21:35
@jaym jaym merged commit e95960b into master Dec 28, 2020
@jaym jaym deleted the jdm/notifications-protobufs branch December 28, 2020 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants