kadina
kadina

Reputation: 5376

File already exists in database error from protobuf while using on Amazon Linux

We are using protobuf messages to use in Zsockets on AWS Linux machines. We have 3 protobuf files in the same directory. 2 protobuf files are importing the 3rd file. Protobuf files are as below.

Fs.proto :

syntax = "proto3";

option java_package = "com.abc.xyz.service";
option java_outer_classname = "FsProto";
option java_multiple_files = true;

option cc_enable_arenas = true;

import "Ping.proto";

package Fs;

Ds.proto :

syntax = "proto3";

option java_package = "com.abc.xyz.service";
option java_outer_classname = "DsProto";
option java_multiple_files = true;

option cc_enable_arenas = true;

import "Ping.proto";

package Ds;

Ping.proto :

syntax = "proto3";

option java_package = "com.abc.xyz.service";

option java_multiple_files = true;

option cc_enable_arenas = true;

package Ping;

message P1
{
   fixed64 tid = 1;
   fixed32 port = 2;
}

message P2
{
   fixed64 tid = 1;
   string  ip  = 2;
}

We generated archive library using the directory (but with -fPIC flag as we need to link this library with a shared library). When we are running our code, it is throwing below error.

[libprotobuf ERROR google/protobuf/descriptor_database.cc:641] File already exists in database: Ping.proto
[libprotobuf FATAL google/protobuf/descriptor.cc:1371] CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):

We are not sure why it is throwing this error. We have only one Ping.proto in whole project. We are not able to proceed further on this. Can anyone please help us to identify what is causing the issue and how to fix this.

Note:

I already checked File already exists in database error from Protobuf when deploying Google Dataflow template after MacOS Catalina upgrade But it didn't help.

Upvotes: 1

Views: 1587

Answers (0)

Related Questions