[ 
https://issues.apache.org/jira/browse/NIFI-15255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18058632#comment-18058632
 ] 

ASF subversion and git services commented on NIFI-15255:
--------------------------------------------------------

Commit 1ae00bbadb3e7beea28b95d48565774088b342ba in nifi's branch 
refs/heads/NIFI-15258 from Kevin Doran
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=1ae00bbadb ]

NIFI-15355 Connector Configuration Repository (#10876)

* NIFI-15255 Introduce ConnectorConfigurationRepository Extension Interface
* Add new property key to default nifi.properties file
* Address peer review comments

> Docker image still uses legacy start.sh/common.sh with broken 
> prop_add_or_replace (related to #NIFI-14575)
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-15255
>                 URL: https://issues.apache.org/jira/browse/NIFI-15255
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Docker
>    Affects Versions: 2.6.0
>            Reporter: Fatih Mehmet ARSLAN
>            Priority: Major
>
> *Summary*
> The NiFi Docker image still includes an old {{prop_add_or_replace}} function 
> in {{{}start.sh/common.sh{}}}, which uses {{awk}} without specifying a file. 
> This causes duplicate properties in {{nifi.properties}} and sometimes a 
> startup hang.
> This does *not* occur in the upstream NiFi codebase (which no longer uses 
> these scripts), but it still affects the official Docker image.
> *Problem*
> Inside the Docker image:
>  
> {{property_found=$(awk -v property="${1}" 'index($0, property) == 1')}} * 
> {{awk}} reads from stdin instead of a real file
>  * Existing properties are never detected → always appended
>  * Results in duplicate keys like:
>  
> {{nifi.env.s3-bucket=...nifi.env.s3-bucket=...}}
> NiFi 2.6.0 fails to start with:
>  
> {{Duplicate property keys with different values were detected}}
> If the property does not exist, {{awk}} also waits for input → script can 
> hang.
> *Steps to Reproduce*
>  # Run NiFi via {{{}apache/nifi:2.6.0{}}}.
>  # Add any dynamic property in start.sh, e.g.:
>  
> {{prop_add_or_replace 'nifi.env.test' 'value'}}
>  # Restart container multiple times.
>  # Check {{{}nifi.properties{}}}.
> *Expected*
>  * Detect the property if it exists.
>  * Replace instead of append.
>  * No duplicate keys.
> *Actual*
>  * Key is always appended.
>  * Startup eventually fails.
> *Suggested Fix*
> Use a file-aware check:
>  
> {{if grep -q -E "^${1}=" "${target_file}"; then prop_replace "$1" "$2" 
> "${target_file}"elseecho "$1=$2" >> "${target_file}"fi}}
> (or update Docker image to match new Java-based bootstrap logic).
> ----
> If helpful, I can provide a PR or test a patched Docker image.



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

Reply via email to