Hi, we saw an error when executing Julie in our environment and after some investigation we found a bug that causes it.
Describe the bug
We get the below error when executing Julie:
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "errors" (class com.purbon.kafka.topology.api.ccloud.response.ListServiceAccountResponse), not marked as ignorable (4 known properties: "data", "api_version", "kind", "metadata"])
at [Source: (String)"***
"errors": [
***
"id": "xxx",
"status": "400",
"detail": "failed to base64 decode page cursor",
"source": ***
***
]
***"; line: 2, column: 14] (through reference chain: com.purbon.kafka.topology.api.ccloud.response.ListServiceAccountResponse["errors"])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61)
at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:987)
at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1974)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1701)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1679)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:330)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:187)
at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:322)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4593)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3548)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3516)
at com.purbon.kafka.topology.utils.JSON.toObject(JSON.java:53)
at com.purbon.kafka.topology.api.ccloud.CCloudApi.getListServiceAccounts(CCloudApi.java:162)
at com.purbon.kafka.topology.api.ccloud.CCloudApi.listServiceAccounts(CCloudApi.java:121)
at com.purbon.kafka.topology.serviceAccounts.CCloudPrincipalProvider.listServiceAccounts(CCloudPrincipalProvider.java:27)
at com.purbon.kafka.topology.AbstractPrincipalManager.printCurrentState(AbstractPrincipalManager.java:112)
at com.purbon.kafka.topology.JulieOps.run(JulieOps.java:217)
at com.purbon.kafka.topology.JulieOps.run(JulieOps.java:227)
at com.purbon.kafka.topology.CommandLineInterface.processTopology(CommandLineInterface.java:212)
at com.purbon.kafka.topology.CommandLineInterface.run(CommandLineInterface.java:161)
at com.purbon.kafka.topology.CommandLineInterface.main(CommandLineInterface.java:147)
We turned on debug logs and saw the following calls being made by Julie:
We found out, that we had more than 100 service accounts in our Confluent Cloud org, which leads to the response having a 'next' field in the 'metadata' block which Julie then tries to fetch again.
The constructed URL is malformed which leads to the above mentioned error.
The URL is constructed with two '?' parameters instead of one '?' followed by '&'.
We can not increase it any further as 100 is the maximum page size of the API.
Have a number of service accounts available in Confluent Cloud and set ccloud.service_account.query.page.size to an int which leads to multiple pages when listing service accounts
provide a topology which creates or clears some bindings so that listServiceAccounts gets called
Hi, we saw an error when executing Julie in our environment and after some investigation we found a bug that causes it.
Describe the bug We get the below error when executing Julie:
We turned on debug logs and saw the following calls being made by Julie:
We found out, that we had more than 100 service accounts in our Confluent Cloud org, which leads to the response having a 'next' field in the 'metadata' block which Julie then tries to fetch again.
The constructed URL is malformed which leads to the above mentioned error. The URL is constructed with two '?' parameters instead of one '?' followed by '&'.
We can not increase it any further as 100 is the maximum page size of the API.
I guess this part is the cause of it: https://github.com/kafka-ops/julie/blob/1991611cdfadd41978cc8d27aad2e8e263fc2dd1/src/main/java/com/purbon/kafka/topology/api/ccloud/CCloudApi.java#L136
To Reproduce Steps to reproduce the behavior:
ccloud.service_account.query.page.size
to an int which leads to multiple pages when listing service accountsExpected behavior Julie should correctly deal with a paginated response from Confluent Cloud REST API v2
Runtime (please complete the following information):