googleapis / google-cloud-node

Google Cloud Client Library for Node.js
https://cloud.google.com/nodejs
Apache License 2.0
2.92k stars 593 forks source link

@google-cloud/aiplatform using very old protobuf.js library causing issues with gRPC #4847

Open georgemoon opened 11 months ago

georgemoon commented 11 months ago

Hello there.

I am attempting to run 'createCustomJob' in the '@google-cloud/aiplatform' platform package, and I receive the following error when passing a numeric or string value of 'replicaCount' as part of a 'workerPoolSpec':

Error: 13 INTERNAL: Request message serialization failure: util.Long.fromValue is not a function

On further investigation, it appears that the '@google-cloud/aiplatform' library is using 'protobuf.js' (a library that hasn't been updated in ten years), instead of 'protobufjs' which is much more modern and used by libraries such as 'google-gax'.

'Protobuf.js' itself uses a version of 'long' that is also out of date, which is probably responsible for the error above.

Ref: https://github.com/googleapis/google-cloud-node/blame/823df1eca530906515ee7f631054e845af7108c5/packages/google-cloud-aiplatform/package.json#L57

Would be great if the code could be updated to use the 'protobufjs' library instead of 'protobuf.js'. Thanks!

matthiasnys commented 8 months ago

It seems to also affect our PubSub implementation. We tried by installing manually long@5.2.3 it seems like our PubSub starts responding again.

XLCYun commented 4 months ago

The scripts of our project has the same problem after using this package, and has to override long version to 5(for dev locally) for now, hope this get fixed soon.