Telegraf not able to read multiple .proto files

Hi
I am trying to read one proto file which is the main one and this file is importing other proto files.
It gives the error no such file or directory

Configuration for the main proto file

syntax = "proto3";
option java_package = "package.gpb";
option java_outer_classname = "SciMessageProtocol";

import "ap_report.proto";
import "ap_non_cum.proto";
import "ap_cum.proto";
import "ap_alarms.proto";

message SciMessage {

	string  mac      = 1; 
	string  version 	= 2;


	ApReport apReport 		        = 100;
	ApNonCum	apNonCum 		    = 101;  
	ApCum	apCum 			        = 102;
	ApAlarms	apAlarms			= 103;
}

it’s giving the error

[telegraf] Error running agent: Error loading config file /etc/telegraf/cbrs/telegraf.conf: error parsing mqtt_consumer, parsing protocol-buffer definition in "/etc/telegraf/cbrs/protofiles/sci_message.proto" failed: /etc/telegraf/cbrs/protofiles/sci_message.proto:14:8: open ap_report.proto: no such file or directory
2022-03-08T06:20:16Z I! Starting Telegraf 1.20.0
2022-03-08T06:20:16Z E! [telegraf] Error running agent: Error loading config file /etc/telegraf/cbrs/telegraf.conf: error parsing mqtt_consumer, parsing protocol-buffer definition in "/etc/telegraf/cbrs/protofiles/sci_message.proto" failed: /etc/telegraf/cbrs/protofiles/sci_message.proto:14:8: open ap_report.proto: no such file or directory
2022-03-08T06:20:17Z I! Starting Telegraf 1.20.0

all the above 4 proto files are present in same location but still giving the same error.

When I remove the import for other proto files it works fine and gives the decoded message but I want the message from all the files

syntax = "proto3";
option java_package = "package.gpb";
option java_outer_classname = "SciMessageProtocol";


message SciMessage {

	string  mac      = 1; 
	string  version 	= 2;

}

The above proto file works fine.
Is there any way we can define configuration such that it should work for all the proto files?

I tried having each MQTT plugin for each proto file then it was giving

2022-03-08T05:59:31Z E! [inputs.mqtt_consumer] Error in plugin: proto: cannot parse invalid wire-format data
2022-03-08T05:59:35Z E! [inputs.mqtt_consumer] Error in plugin: proto: cannot parse invalid wire-format data
2022-03-08T05:59:38Z E! [inputs.mqtt_consumer] Error in plugin: proto: cannot parse invalid wire-format data
2022-03-08T05:59:39Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2022-03-08T05:59:41Z E! [inputs.mqtt_consumer] Error in plugin: proto: cannot parse invalid wire-format data

Not sure where I am making the mistake.

Thanks

Hey @Ravikant_Gautam, can you please share your proto files (or a replacement) to reproduce your issue? It would be best to create an issue in Issues · influxdata/telegraf · GitHub and add the information there… Feel free to assign the issue to me (srebhan) or contact me on Slack (@Sven Rebhan)…

sure. I will raise the issue on GitHub but unfortunately, I won’t be able to share the proto files. I will tell you the steps by which you can reproduce the issue.
Thanks