user6942573
user6942573

Reputation:

Docker - Nifi : 1.14.0 - Startup failure - Caused by: org.apache.nifi.properties.SensitivePropertyProtectionException

Hi I am entirely new to docker and nifi, and I need to set up nifi on docker, but i receive the following error.

Error Text below or (screenshot of error - on terminal)

nifi01_1   | 2021-09-17 02:12:30,707 INFO [main] o.a.nifi.properties.NiFiPropertiesLoader Loaded 202 properties from /opt/nifi/nifi-current/./conf/nifi.properties
nifi01_1   | 2021-09-17 02:12:30,719 ERROR [main] o.a.nifi.properties.NiFiPropertiesLoader Clustered Configuration Found: Shared Sensitive Properties Key [nifi.sensitive.props.key] required for cluster nodes
nifi01_1   | 2021-09-17 02:12:30,723 ERROR [main] org.apache.nifi.NiFi Failure to launch NiFi due to java.lang.IllegalArgumentException: There was an issue decrypting protected properties
nifi01_1   | java.lang.IllegalArgumentException: There was an issue decrypting protected properties
nifi01_1   |    at org.apache.nifi.NiFi.initializeProperties(NiFi.java:346)
nifi01_1   |    at org.apache.nifi.NiFi.convertArgumentsToValidatedNiFiProperties(NiFi.java:314)
nifi01_1   |    at org.apache.nifi.NiFi.convertArgumentsToValidatedNiFiProperties(NiFi.java:310)
nifi01_1   |    at org.apache.nifi.NiFi.main(NiFi.java:302)
nifi01_1   | Caused by: org.apache.nifi.properties.SensitivePropertyProtectionException: Sensitive Properties Key [nifi.sensitive.props.key] not found: See Admin Guide section [Updating the Sensitive Properties Key]
nifi01_1   |    at org.apache.nifi.properties.NiFiPropertiesLoader.getDefaultProperties(NiFiPropertiesLoader.java:220)
nifi01_1   |    at org.apache.nifi.properties.NiFiPropertiesLoader.get(NiFiPropertiesLoader.java:209)
nifi01_1   |    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
nifi01_1   |    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
nifi01_1   |    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
nifi01_1   |    at java.lang.reflect.Method.invoke(Method.java:498)
nifi01_1   |    at org.apache.nifi.NiFi.initializeProperties(NiFi.java:341)
nifi01_1   |    ... 3 common frames omitted
nifi01_1 exited with code 0

docker-compose.yml:

#    Licensed to the Apache Software Foundation (ASF) under one or more
#    contributor license agreements.  See the NOTICE file distributed with
#    this work for additional information regarding copyright ownership.
#    The ASF licenses this file to You under the Apache License, Version 2.0
#    (the "License"); you may not use this file except in compliance with
#    the License.  You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.

version: "3"
services:
  zookeeper:
    hostname: zookeeper
    container_name: zookeeper
    image: 'bitnami/zookeeper:latest'
    environment:
      - ALLOW_ANONYMOUS_LOGIN=yes
    networks:
      - nifinet
  nifi01:
    image: apache/nifi:1.14.0
    ports:
      - 6980:8080 # Unsecured HTTP Web Port
    networks:
      - nifinet
    environment:
      - NIFI_WEB_HTTP_PORT=8080
      - NIFI_CLUSTER_IS_NODE=true
      - NIFI_CLUSTER_NODE_PROTOCOL_PORT=8082
      - NIFI_ZK_CONNECT_STRING=zookeeper:2181
      - NIFI_ELECTION_MAX_WAIT=1 min
  nifi02:
    image: apache/nifi:1.14.0
    ports:
      - 6979:8080 # Unsecured HTTP Web Port
    networks:
      - nifinet
    environment:
      - NIFI_WEB_HTTP_PORT=8080
      - NIFI_CLUSTER_IS_NODE=true
      - NIFI_CLUSTER_NODE_PROTOCOL_PORT=8082
      - NIFI_ZK_CONNECT_STRING=zookeeper:2181
      - NIFI_ELECTION_MAX_WAIT=1 min
  nifi03:
    image: apache/nifi:1.14.0
    ports:
      - 6978:8080 # Unsecured HTTP Web Port
    networks:
      - nifinet
    environment:
      - NIFI_WEB_HTTP_PORT=8080
      - NIFI_CLUSTER_IS_NODE=true
      - NIFI_CLUSTER_NODE_PROTOCOL_PORT=8082
      - NIFI_ZK_CONNECT_STRING=zookeeper:2181
      - NIFI_ELECTION_MAX_WAIT=1 min
networks:
  nifinet:
    driver: bridge

Based on my research, it is mentioned that I have to update few properties in nifi.properties, but not sure how I can set them on a docker image. Please help.

Upvotes: 1

Views: 3323

Answers (1)

Theo
Theo

Reputation: 631

Just add NIFI_SENSITIVE_PROPS_KEY as environment variable to your docker-copmose file nifis. It can be a random string but make sure it is at least 12 characters long (NiFi won't acceppt it otherwise).

Upvotes: 6

Related Questions