Confirmed that replacing spaces in names with underscores "resolves" this issue.

I think this either need to be documented or fixed by using URL encoding everywhere. Or using original name for display and replacing all non-supported characters with underscore for URLs. Hmm, that's pretty unnatural to put spaces there since these are just environment variables.
Bad handling of cluster names
**Describe the bug**

We have switched to using user-friendly cluster names in `KAFKA_CLUSTERS_NNN_NAME`. Such that those names are human readable with spaces. After we changed to those names, no operations can be done on cluster (can still browse around tho).


**Set up**
Docker latest master tag


**Steps to Reproduce**
Steps to reproduce the behavior:

1. Use user friendly names such as `KAFKA_CLUSTERS_0_NAME: "Cluster name"`

**Expected behavior**
Everything works as expected.

**Actual behavior**
Error message in UI (i truncated screenshot to not expose private information):

![Screenshot from 2021-11-30 10-47-38](https://user-images.githubusercontent.com/985805/143977249-9b15b597-ccf1-4b8e-a4ba-86cc90354f28.png)

And errors in the logs:

```
02:47:19.596 [parallel-3] WARN  com.provectus.kafka.ui.exception.ErrorCode - Multiple class com.provectus.kafka.ui.exception.ErrorCode values refer to code 4001
02:47:19.614 [parallel-3] DEBUG org.springframework.http.codec.json.Jackson2JsonEncoder - [1296e0bd-3] Encoding [class ErrorResponseDTO {<LF>    code: 4007<LF>    message: No cluster for name 'Cluster%20name'<LF>    timestam (truncated)...]
0
```

Meantime browsing all topics, data etc works just fine.



kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/ReadOnlyModeFilter.java
kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/ReadOnlyModeFilter.java
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/ReadOnlyModeFilter.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/ReadOnlyModeFilter.java
index b998748fccb..41b6cc408f5 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/ReadOnlyModeFilter.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/ReadOnlyModeFilter.java
@@ -3,6 +3,8 @@
 import com.provectus.kafka.ui.exception.ClusterNotFoundException;
 import com.provectus.kafka.ui.exception.ReadOnlyModeException;
 import com.provectus.kafka.ui.service.ClustersStorage;
+import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
 import java.util.regex.Pattern;
 import lombok.RequiredArgsConstructor;
 import org.jetbrains.annotations.NotNull;
@@ -32,7 +34,8 @@ public Mono<Void> filter(ServerWebExchange exchange, @NotNull WebFilterChain cha
     }
 
     var path = exchange.getRequest().getPath().pathWithinApplication().value();
-    var matcher = CLUSTER_NAME_REGEX.matcher(path);
+    var decodedPath = URLDecoder.decode(path, StandardCharsets.UTF_8);
+    var matcher = CLUSTER_NAME_REGEX.matcher(decodedPath);
     if (!matcher.find()) {
       return chain.filter(exchange);
     }
