kloadgen: [Issue] ERROR n.c.k.l.i.ProtobufLoadGenerator: Please make sure that properties data type and expression function return type are compatible with each other

What happened?

Hi

I am getting error from “ProtobufLoadGenerator”, it is unable to load or create “Address” type or values into jmeter. Here is the edited snippet of contract:

message Order {

int32 order_id = 1; .demo.Order.CustomerAccount customer_account = 3;

message Address { string address_line_one = 2; }

message CustomerAccount { .demo.Order.CustomerAccount.BillingParty billing_party = 1;

message BillingParty {
  string party_id = 3;
  .demo.Order.Address party_address = 4;
}

} }

I have “Address” in “Order” but there is no variable for that. “Address” is being using in another Message.

Jmeter is unable to load structure properly for this scenario image

KloadGen Version

KLoadGen 4.12.2

Relevant log output

2022-11-15 15:35:45,500 ERROR n.c.k.l.i.ProtobufLoadGenerator: Please make sure that properties data type and expression function return type are compatible with each other
com.google.protobuf.Descriptors$DescriptorValidationException: demo.Order.CustomerAccount.BillingParty.party_address: ".demo.Order.Address" is not defined.
	at com.google.protobuf.Descriptors$DescriptorPool.lookupSymbol(Descriptors.java:2465) ~[kloadgen-4.12.2.jar:?]
	at com.google.protobuf.Descriptors$FieldDescriptor.crossLink(Descriptors.java:1480) ~[kloadgen-4.12.2.jar:?]
	at com.google.protobuf.Descriptors$FieldDescriptor.access$1000(Descriptors.java:991) ~[kloadgen-4.12.2.jar:?]
	at com.google.protobuf.Descriptors$Descriptor.crossLink(Descriptors.java:954) ~[kloadgen-4.12.2.jar:?]

Have you added your JMX Testplan or a replica?

  • I have added a JMX testplan

Have you added your Schema or a replica?

  • I have added the Schema

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 30 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Hi @mseijasm The change in package structure(net.coru to com.sngular) caused some issue for me and @vishaldhanani. We just updated our JMX to reflect new package structure ,then it works good.

For now, the exception which we created issue got resolved.

We test and analyze it more. We will let you know if we face any issue. Please let us know the release plan of this new jar.

@mseijasm Latest code fixed the problem but it failed for another field when evolved the schema. I just added one “repeated” element to schema ,then it failed. Please find below latest schema and error

syntax = "proto3";
package demo;

option java_package = "com.demo.order.proto";
option java_outer_classname = "DemoOrder";
option java_multiple_files = true;

message Order {
  int32 order_id = 1;
  string order_number = 2;
  .demo.Order.CustomerAccount customer_account = 3;
  .demo.Order.Details details = 4;

  message CustomerAccount {
    .demo.Order.CustomerAccount.BillingParty billing_party = 1;
  
    message BillingParty {
      string party_id = 1;
      .demo.Order.Address address = 2;
      repeated .demo.Order.Contact party_contact = 3;
    }
  }
  message Address {
    string address_line_one = 1;
    string address_line_two = 2;
  }
  message Contact {
    int32 contact_id = 1;
    string contact_name = 2;
  }
  message Details {
    .demo.Order.Details.InDetails in_details = 1;
  
    message InDetails {
      .demo.Order.Details.InDetails.CustomsDetails customs_details = 1;
    
      message CustomsDetails {
        .demo.Order.Details.InDetails.CustomsDetails.Party party = 1;
      
        message Party {
          .demo.Order.Address party_address = 1;
          repeated .demo.Order.Contact party_contact = 2;
          repeated .demo.Order.Contact p_contact = 3;
        }
      }
    }
  }
}

com.google.protobuf.Descriptors$DescriptorValidationException: demo.Order.Details.InDetails.CustomsDetails.Party.Contact.contact_id: “contact_id” is already defined in “demo.Order.Details.InDetails.CustomsDetails.Party.Contact”.

image

Hi @mseijasm Latest code resolved “repeated” error , but we evolved our schema and getting “Address” error again at different nested level. Please take a look and resolve it to work at all nested levels. Also please take care same issue for “repeated” elements

Please find below Evolved (updated) proto and Error screenshot

syntax = "proto3";
package demo;

option java_package = "com.demo.order.proto";
option java_outer_classname = "DemoOrder";
option java_multiple_files = true;

message Order {
  int32 order_id = 1;
  string order_number = 2;
  .demo.Order.CustomerAccount customer_account = 3;
  .demo.Order.Details details = 4;

  message CustomerAccount {
    .demo.Order.CustomerAccount.BillingParty billing_party = 1;
  
    message BillingParty {
      string party_id = 1;
      .demo.Order.Address address = 2;
      repeated .demo.Order.Contact party_contact = 3;
    }
  }
  message Address {
    string address_line_one = 1;
    string address_line_two = 2;
  }
  message Contact {
    int32 contact_id = 1;
    string contact_name = 2;
  }
  message Details {
    .demo.Order.Details.InDetails in_details = 1;
  
    message InDetails {
      .demo.Order.Details.InDetails.CustomsDetails customs_details = 1;
    
      message CustomsDetails {
        .demo.Order.Details.InDetails.CustomsDetails.Party party = 1;

        message Party {
          .demo.Order.Address party_address = 1;
          repeated .demo.Order.Contact party_contact = 2;
        }
      }      
    }
  }
}

image

@mseijasm , please share working jar of the branch

@mseijasm , We just tried using the branch code, but we got build failure "Cannot resolve com.github.everit-org.json-schema:org.everit.json.schema:1.14.0 " When I checked in maven repository, it doesnot exist <dependency> <groupId>com.github.everit-org.json-schema</groupId> <artifactId>org.everit.json.schema</artifactId> <version>1.14.0</version> </dependency>

If possible please share us the Jar

I think you can understand the problem by looking at error message and protobuf schema snippet