Repository: provectus/kafka-ui
Issue: Unable to Edit Setting of a topic from kafka ui getting 404
Labels: type/bug
scope/frontend
status/accepted
status/confirmed
severity/medium

<!--

We will close the issue without further explanation if you don't follow this template and don't provide the information requested within this template.

Don't forget to check for existing issues/discussions regarding your proposal. We might already have it.
https://github.com/provectus/kafka-ui/issues
https://github.com/provectus/kafka-ui/discussions

-->

<!--
Please follow the naming conventions for bugs:
<Feature/Area/Scope> :  <Compact, but specific problem summary> 
Avoid generic titles, like “Topics: incorrect layout of message sorting drop-down list”. Better use something like: “Topics: Message sorting drop-down list overlaps the "Submit" button”.

-->

**Describe the bug** (Actual behavior)
<!--(A clear and concise description of what the bug is.Use a list, if there is more than one problem)-->

Getting 404 Error page when i click on Edit setting button for a topic.

**Expected behavior**
<!--(A clear and concise description of what you expected to happen.)-->

We should be allowed to update setting for the topic.
I tried to CLI was able to update the setting for the topic.


**Set up**
<!--
WE MIGHT CLOSE THE ISSUE without further explanation IF YOU DON'T PROVIDE THIS INFORMATION.

How do you run the app? Please provide as much info as possible:
1. App version (docker image version or check commit hash in the top left corner in UI)
2. Helm chart version, if you use one
3. Any IAAC configs
-->
1. App version - V0.6.0
2. Helm chart version - 0.6.0


**Steps to Reproduce**
<!-- We'd like you to provide an example setup (via docker-compose, helm, etc.) 
to reproduce the problem, especially with a complex setups. -->
bring up kafka ui and crate a topic and try to edit setting for that topic from ui 
1. 

**Screenshots**
<!--
(If applicable, add screenshots to help explain your problem)

<img width="1350" alt="image" src="https://user-images.githubusercontent.com/103026073/227729847-bc0f05f5-2aff-4673-9c12-de1d7cfabf68.png">

-->


**Additional context**
<!--
Add any other context about the problem here. E.g.: 
1. Are there any alternative scenarios (different data/methods/configuration/setup) you have tried? 
   Were they successfull or same issue occured? Please provide steps as well.
3. Related issues (if there are any).
4. Logs (if available)
5. Is there any serious impact or behaviour on the end-user because of this issue, that can be overlooked?
-->


Issue comments:
Hello there nadig-aditya! 👋

Thank you and congratulations 🎉 for opening your very first issue in this project! 💖

In case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. 👀
Hi,

I'm not able to reproduce the issue, vid attached.
Please attach the similar one with steps to reproduce.

https://user-images.githubusercontent.com/1494347/228045696-0238d4f0-9019-415c-9ba5-1823fb39e756.mov


i observed issue us happening only for Kafka version 2.2.1 (MSK cluster) and not for later versions
This issue has been automatically marked as stale because no requested feedback has been provided. It will be closed if no further activity occurs. Thank you for your contributions.
@nadig-aditya can you do a screen record?
> @nadig-aditya can you do a screen record?

Hi,
Cant provider recording at this moment, but have same issue with Kafka cluster 2.1, returns 404 on topic edit settings
No errors on service side, yet UI complains:
![image](https://user-images.githubusercontent.com/3961710/231115659-135d27ea-40bb-456d-be7a-fe87a1794452.png)

![image](https://user-images.githubusercontent.com/3961710/231116166-1569029f-bcf8-4fe7-9c91-97f5ae3e2b6c.png)

Kafka cluster 3.2-IV0 works fine, downgrading kafka-ui to 0.4.0 works for both kafka clusters versions
It looks like its because of message format version: https://github.com/provectus/kafka-ui/blob/master/kafka-ui-react-app/src/lib/constants.ts#L31

My kafka 2.1 cluster uses **message.format.version**: 2.1-IV2
which does not have **max.compaction.lag.ms** described in: https://github.com/provectus/kafka-ui/blob/master/kafka-ui-react-app/src/lib/constants.ts#L33


Thanks for the clarification. To be resolved by #3661.

Pull request review comments:

Patch that resolved the issue:
diff --git a/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamField.tsx b/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamField.tsx
index 7edbc5426dd..5ba51ad2890 100644
--- a/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamField.tsx
+++ b/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamField.tsx
@@ -49,7 +49,7 @@ const CustomParamField: React.FC<Props> = ({
       label: option,
       disabled:
         (config &&
-          config[option].source !== ConfigSource.DYNAMIC_TOPIC_CONFIG) ||
+          config[option]?.source !== ConfigSource.DYNAMIC_TOPIC_CONFIG) ||
         existingFields.includes(option),
     }));
 


Test patch: