question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[grpc] Unable to pass integer value in workflow inputs

See original GitHub issue

Hi we are using the Netflix grpc workflow client (version:com.netflix.conductor:conductor-grpc-client:2.12.1) and we are unable to pass in a integer value in workflow input (or task inputs) during execution.

We are passing in dynamic workflows by using the startWorkflowRequest object.

We see the following error: cannot map to Value type: 40

We suspect this is happening in here: https://github.com/Netflix/conductor/blob/a7a6e32900b7c5cf78b861a144d3e663b9be11c3/grpc/src/main/java/com/netflix/conductor/grpc/ProtoMapper.java#L44

I understand that, these are generated files from protobuf (please correct me if am wrong). Is it possible to update it to support integer values?

Happy to contribute as well, might need some assistance in updating this as I am new to this code base

Thanks in advance!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
vmgcommented, Jul 3, 2019

@sujaysudheenda: No, the file you’ve linked, ProtoMapper.java is not auto-generated. The rest of the protobuf code is, but not that implementation.

It is not possible to add a new method to the Value builder because Value is a standard ProtoBuf type: https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/Value.Builder – these standard types do not support ProtoBuf INT fields because they need to be mapped 1:1 between ProtoBuf and JSON-ProtoBuf (the JSON specification does not have a concept of “integer”, it only supports “numeric” values which are basically double).

Your best bet here to prevent breaking the ProtoBuf/GRPC spec is adding a type check to toProto that handles Java Integer and casts that to double, calling setNumberValue. You may lose precision here, but again, this is the only way that you’ll be able to support the standard ProtoBuf Value.

Sorry this is inconvenient. I did not design this, Google did. 😄

1reaction
vmgcommented, Jul 3, 2019

The interface we designed for GRPC is limited to “numeric” values (i.e. doubles) because of backwards compatibility with the old interface, IIRC. So all numbers need to be floating point. That’s… not ideal. You could simply fix it by updating the toProto method, but I recall this was a breaking change so we did not do it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error creating new work flow 0 "The 'inputs.parame...
I am having some problem creating a new manual workflow. ... Converting the integer value '-0.028397214541428645' to type 'Integer/int64' ...
Read more >
Field Reference - The workflow engine for Kubernetes
OnExit is a template reference which is invoked at the end of the workflow, irrespective of the success, failure, or error of the...
Read more >
does grpc service must have exactly one input parameter and ...
gRPC service methods have exactly one input message and exactly one output message. Typically, these messages are used as input and output ...
Read more >
Gst-nvinferserver — DeepStream 6.1.1 Release documentation
The Gst-nvinferserver plugin passes the input batched buffers to the low-level library and waits for the results to be available.
Read more >
Transformers - Retool Docs
The transformer will automatically re-run when the variable value changes. ... Note that inside the failure conditions inputs, you have access to three ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found