You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Prem Kamal (Jira)" <ji...@apache.org> on 2022/09/05 06:34:00 UTC

[jira] [Assigned] (KAFKA-14165) ConfigTransformer.DEFAULT_PATTERN fails on Windows platform

     [ https://issues.apache.org/jira/browse/KAFKA-14165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Prem Kamal reassigned KAFKA-14165:
----------------------------------

    Assignee:     (was: Prem Kamal)

> ConfigTransformer.DEFAULT_PATTERN fails on Windows platform
> -----------------------------------------------------------
>
>                 Key: KAFKA-14165
>                 URL: https://issues.apache.org/jira/browse/KAFKA-14165
>             Project: Kafka
>          Issue Type: Bug
>          Components: config
>    Affects Versions: 3.2.1
>         Environment: Windows 10 OS
>            Reporter: Gabor Andras
>            Priority: Major
>
> When a configuration Map which has an entry with a key "someKey" and a value "${file:/F:/properties.txt:fileKey}" is passed to the ConfigTransformer.transform(Map) method, an exception is thrown:
> 2022-08-12 16:44:21,553 ERROR [org.apa.kaf.com.con.pro.FileConfigProvider] (main) Could not read properties from file /F: java.nio.file.NoSuchFileException: \F
>     at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85)
>     at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
>     at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
>     at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:236)
>     at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
>     at java.base/java.nio.file.Files.newByteChannel(Files.java:432)
>     at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:422)
>     at java.base/java.nio.file.Files.newInputStream(Files.java:160)
>     at java.base/java.nio.file.Files.newBufferedReader(Files.java:2922)
>     at java.base/java.nio.file.Files.newBufferedReader(Files.java:2955)
>     at org.apache.kafka.common.config.provider.FileConfigProvider.reader(FileConfigProvider.java:104)
>     at org.apache.kafka.common.config.provider.FileConfigProvider.get(FileConfigProvider.java:86)
>     at org.apache.kafka.common.config.ConfigTransformer.transform(ConfigTransformer.java:103)
> This happens because of a colon ":" in the file name, which is wrongfully matched by the ConfigTransformer.DEFAULT_PATTERN in these three groups "file", "/F" and "/properties.txt:fileKey" instead of "file", "/F:/properties.txt" and "fileKey".
> The ConfigTransformer.DEFAULT_PATTERN should be changed to match the first and the last colon ":" in the expression.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)