8,446 questions
Advice
1
vote
0
replies
62
views
Google gnostic: protoc-gen-openapi
i want to know if https://github.com/google/gnostic/tree/main/cmd/protoc-gen-openapi plugin understands and processes annotations as in https://github.com/google/gnostic/blob/main/openapiv3/...
1
vote
1
answer
83
views
How to make google.protobuf.Timestamp required?
I am using Typescript, Google Protobuf and library
"ts-proto": "^2.7.7", to generate ts types and use their encode/decode methods.
I have a message like
message DummyDraft {
...
0
votes
0
answers
56
views
Protobuf FieldMask doesn't accept * syntax for repeated field masking
I have a protobuf message with a repeated field:
message TestRepeatedMask {
repeated Inner inner_message = 1;
message Inner {
optional string first = 1;
optional string second = 2;
}
}
...
2
votes
2
answers
117
views
Unable to generate code for proto files that use import
I have been using .proto files without any issue with C# and Java. I have more than hundred proto files spread across a folder hierarchy. I can compile in Visual Studio and in JetBrains IntelliJ Idea. ...
0
votes
0
answers
50
views
supabase postgis tile server and javascript decoding base64 encoded data
I was trying to serve vector tiles on the fly using an rpc function in superbase but somehow when the responce arrives in the front end using a custom protocol. the vector tiles are not displayed.
...
4
votes
3
answers
439
views
Backward and forward compatibility issues with protobufs in Google Pub/Sub
We use protocol buffers both for gRPC server-to-server communication and for publishing messages to Pub/Sub.
Pub/Sub is fairly sensitive to schema changes, not allowing any schema changes that would ...
0
votes
1
answer
43
views
How to serialize protobuf message into a pre-allocated byte array with offset in c#? (Protobuf 3.32.0.0)
The methods AI showed me are not working. However, one method mentioned by AI seems to be usable, but it is private:
private CodedOutputStream(byte[] buffer, int offset, int length)
So, how can I ...
1
vote
0
answers
51
views
A generated protobuf python file is unable to locate another protobuf module it generated
I have a project set up like this with protos/ as a top level directory and the project that actually builds it under services/common-py.
├── protos
│ ├── common.proto
│ ├── doodad.proto
└── ...
0
votes
0
answers
112
views
Buf can't find google/api/annotations.proto in vendored directory for Cosmos SDK v0.53 module
I'm developing a new module for a Cosmos SDK v0.53 application and I'm completely stuck on a persistent buf error. I have resorted to vendoring all my Protobuf dependencies into a third_party ...
2
votes
1
answer
151
views
Intellij modules not finding generated protobuf classes in a multimodule maven project (but works fine via maven cli)
I have a project set up like this:
protos/ # protobuf files here
pom.xml # parent pom
services/common # this module generates the protobuf classes
services/mod-1 # imports ...
1
vote
1
answer
80
views
How do I set up automatic class generation from a contract using protobuf-net?
I configured the .csproj file as follows:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>...
0
votes
1
answer
113
views
Is it possible that two protobuf messages with same content generate different serialized bytes? [duplicate]
In C++ Protobuf, is it possible for two messages with the same contents to produce different serialized byte strings when using the SerializeToString method?
If so, under what circumstances can the ...
0
votes
1
answer
2k
views
Protobuf Compiler version does not match protobuf runtime version
On my mac machine, I installed the protobuf compiler of the latest version (5.29.3) [1] and the python protobuf runtime library pip install protobuf (6.31.1) [2].
The problem is that I got the ...
0
votes
1
answer
126
views
How to generate NPM package for protoc compiled Typescript
I have a desire to create a reusable NPM package for consumption in Angular 18+ (using old build system) based upon a set of .proto files. The desired usage would be a simple installation of the npm ...
0
votes
1
answer
97
views
gRPC serialized message size difference between Windows and POSIX
gRPC: 1.59.1; Protocol Buffers: 3.21.12;
I have a .proto file with proto2 syntax. One of the messages looks like this:
message Log
{
repeated Info info = 1; // can be very heavy
...
...
0
votes
0
answers
152
views
How to avoid "TypeError: Couldn't build proto file into descriptor pool: duplicate symbol 'core.grpc_interface.Explosion'"
Language / runtime: Python 3.12.3
Operating system: Linux (Ubuntu 24.04)
Protoc / protobuf versions:
protoc (libprotoc) 31.0
protobuf 6.30.1
grpcio-tools 1.73.1
Description:
My ...
1
vote
1
answer
132
views
How to generate protobufs for C# 9.0 that will not use the "global usings" feature
I have a C# project that uses protobufs, but I need to backport it (under duress) to .NET 5.0.
When I do so, the compiler says
/myproj/path/Protos/obj/Debug/net5.0/Protos.GlobalUsings.g.cs(2,1): error ...
0
votes
1
answer
150
views
build gRPC++ with only C++11 and no Absl
I am trying to use protobufs and gRPC on a legacy system that runs Ubuntu 14.04 and C++11, and that can't be updated.
I have tried building gRPC v1.46.7 (the newest version that does not require C++14 ...
1
vote
1
answer
150
views
std::string with custom allocator in protobuf message
I need a string field in a Protobuf message to use a custom allocator for its internal char* buffer, instead of the default global allocator.
I am aware that google::protobuf::Arena will allocate the ...
0
votes
0
answers
127
views
Google Cloud KSM Error: Exception in thread "main" java.lang.NoClassDefFoundError: com/google/protobuf/MapFieldReflectionAccessor
💻 Environment:
Java Version: Corretto 17.0.8
Google Cloud KMS library: google-cloud-kms:2.38.0
Build Tool: Maven
IDE: IntelliJ IDEA Community Edition
📦 Dependencies (pom.xml):
<dependencies>
&...
0
votes
1
answer
152
views
What's the most efficient way to decode protobuf byte stream from a websocket in Python?
I have a websocket to a site which returns a protobuf byte stream. Im trying to find the most efficient way to decode the protobuf bytes. If I have the .proto schema definitions, what's the most ...
0
votes
0
answers
168
views
Protobuf/Grpc generated code from maven with javax instead of jakarta package
I am updating a spring boot project to version 3.4.5 with java 21. For this packages have changed from javax.* to jakarta.*
I am generating Grpc endpoints with protofiles with this maven plugin:
...
0
votes
0
answers
33
views
modify java protobuf and protobuf extensions in parallel, version > 3.17
I have generated java protobuf class. This class has protobuf extensions also. Is it safe to modify different unrelated fields and extensions of the same protobuf builder in parallel?
message ...
0
votes
0
answers
84
views
How to convert from Python pandas Timestamp to repeated google.protobuf.Timestamp? (Python + Google Protocol Buffers)
I am trying to write some code which converts the contents of a pandas.DataFrame to a protobuf object which can be serialized and written to a file.
Here is my protobuf definition.
syntax = "...
1
vote
0
answers
53
views
Java accessors generated by protoc for string fields
For any field x of type string, protoc seems to generate two java accessors:
getX() that returns a String
getXBytes() that returns a ByteString
While the getXBytes() method may be useful, I am ...
0
votes
1
answer
47
views
There were problems loading project grpc-client.csproj. See log for details
When I try to hit the save button for the file grpc-client.csproj on my Code Editor. It shows the error:
There were problems loading project grpc-client.csproj.See log for details.
The content of my ...
0
votes
0
answers
58
views
why in message fields in protobuf there is always a numeric tag even with strings and how does this affect serialization/serialization
Why do we assign numeric tags to message fields in proto files even for string type? That is, here's an example from official documentation:
// The greeting service definition.
service Greeter {
// ...
0
votes
1
answer
82
views
Can I add extra build steps when deploy cloud functions on GCP?
I am using terraform to deploy a python cloud function, similar to the official example, things are working as expected but now I want to use protobuf, which requires extra compile step, I know cloud ...
0
votes
0
answers
51
views
Android Proto not generating data classes
The lore
I have this data class UserSettingsModel, that I have moved to, because of a need to store some appSettings: Map<String, AppSettingsModel>. This is for an app that reads off user-...
0
votes
0
answers
39
views
Tensorflow variables.index file structure, parsing, altering problems
I am trying to understand how tensorflow stores variables.index files to parse it and manipulate. I see that pb file could be parsed with protobuf parser, .data file could be loaded as checkpoint and ...
2
votes
0
answers
96
views
Segmentation fault during Serialization: caused by message as a field in C++17
This post is related to this one: Segmentation fault during Serialization by using protobuf in C++17
But I have narrowed it down to the specific problem and decided to make separated post.
My goal is ...
5
votes
1
answer
180
views
Segmentation fault during Serialization by using protobuf in C++17
My goal is to serialize information by using protobuf in C++.
proto file:
syntax = "proto3";
package PhoneBookSerialize;
message Date {
int32 year = 1;
int32 month = 2;
int32 day = 3;...
0
votes
1
answer
345
views
Linking errors when building latest release of protocol buffers for Windows 10
I need to build protocol buffers (PB) as an external dependency for a project I plan on using it with. I've successfully built and used PB in the past for other projects, but those projects used an ...
1
vote
1
answer
164
views
Converting time.Time to datetime.DateTime
For some of our Protobuf DTOs, we use datetime.DateTime to represent the idea of a date and time with time zone. Internally, however, we work exclusively with time.Time objects because these have ...
-1
votes
1
answer
295
views
How to build an example C++ project which uses CMake, protobuf and vcpkg
I'm trying to build a C++ project with a later version of the protobuf libraries than my OS package manager provides.
To do this, I have chosen to use vcpkg to configure the project dependencies. (In ...
0
votes
2
answers
1k
views
How to install the latest version of protoc on Ubuntu 24.10?
The version of protoc available via apt with Ubuntu 24.10 appears to be somewhat outdated.
$ protoc --version
libprotoc 3.21.12
In particular, this does not appear to support the latest edition ...
-1
votes
1
answer
269
views
Cannot compile protobuf definition with edition syntax
I am trying to compile the following .proto file:
edition = "2023";
package example_proto;
import "google/protobuf/cpp_features.proto";
message BidAsk {
required double bid =...
0
votes
2
answers
333
views
Crash in Protobuf lite on macOS after updating to Xcode 16.3
Since updating to Xcode latest (16.3) I get a crash in protobuf lite when trying to call the copy constructor of a message that has a repeated field.
The crash occurs when the code is trying to call ...
1
vote
1
answer
611
views
Configuring Protobuf support for NeoVim
I am trying to configure Protobuf LSP support with nvim (I am using Lazyvim package manager). I've read here that bufls is deprecated and that we should be using buf_ls. Using this snippet, I've ...
0
votes
0
answers
33
views
High export count from MSVC dll with protobuf
We've discovered that a single proto message e.g:
syntax = "proto3";
package foo.a;
message ResultA {
optional string name = 1;
optional int32 value = 2;
}
Will translate to around ...
1
vote
0
answers
109
views
Unexpected behavior when using CMake and Visual Studio
I have a simple project that is using protobuf to generate some bindings and then include them in a static library using Visual Studio/MSVC. The CMakeLists.txt section looks like this:
...
0
votes
0
answers
29
views
Err dlopen fail: dprint-node.win32-x64-msvc.node not found
So I got this error when trying to run protoc with protoc-gen-ts_proto
protoc --plugin=protoc-gen-ts_proto=.\node_modules\.bin\protoc-gen-ts_proto.cmd --proto_path=.\src\@core\prototypes --...
2
votes
1
answer
343
views
Why does protoc fail with enum name conflict in C++ for valid .proto definitions?
I have a public proto files which cant be altered here is this for Refrence
syntax = "proto2";
package openrtb;
enum ContentCategory {
IAB1 = 1;
IAB1_1 = 2;
IAB1_2 = 3;
IAB11 = 191;...
0
votes
0
answers
126
views
Deserialization Errors in Spring Kafka for byte Array Despite Proper Serializer Configuration
I am new to Kafka & trying to make a decent project for my resume. So in a multi-service (microservices running on docker) model in which I'm developing multiple Spring Boot applications, two of ...
1
vote
0
answers
59
views
C++ multiple library dependencies causing protobuf conflicts
I am currently using an C++ RPC framework (similar to gRPC) to implement the function, which itself depends on protobuf (v3.21.0) and is compiled using bazel(); at the same time, I need to use the ...
2
votes
1
answer
106
views
How to extract Parrot's Anafi AI drone protobuf metadata from RTP packet, using Golang?
I really struggle extracting protobuf payload (Parrot TimedMetadata) from a recording of RTP packets.
I'm using golang. I followed the parrot's dev guide without success.
This is my main.go:
package ...
1
vote
2
answers
160
views
How can I convert go Struct to dynamic.Message or proto.Message in go grpc?
func (w *Worker) makeUnaryRequest(ctx *context.Context, reqMD *metadata.MD, input *dynamic.Message) error {
...
}
I need to modify the contents of input.
var data Response
payload_dataByte, _ := json....
0
votes
0
answers
330
views
Using Protobuf in my CMake project results in missing imported targets (absl, utf8_range)
From an administrator CMD prompt, I installed Protobuf on my Windows machine the following way:
git clone -b v28.3 --recurse-submodules https://github.com/protocolbuffers/protobuf.git
cd protobuf
...
2
votes
0
answers
91
views
Can prost crate convert protobuf's string to other Rust type (such as SmartString)?
I use tonic to build a server. The grpc requests/replies have many short-string members.
I find prost converts the protobuf's string into Rust's String.
I want to use SmartString to replace String for ...
1
vote
1
answer
182
views
Getting error error: cannot find symbol private static final com.google.protobuf.Internal.IntListAdapter.IntConverter
I have updated the com.google.protobuf:protoc version from 4.27.5 to 4.28.0 in my android project. The protobuf block has a defination like this
protobuf {
//dependency versions are defined under ...