cetic / helm-nifi

Helm Chart for Apache Nifi
Apache License 2.0
215 stars 228 forks source link

[cetic/nifi] error in authorizers.xml when ldap enabled #291

Closed shayki5 closed 1 year ago

shayki5 commented 1 year ago

Describe the bug When I configured ldap (with ldap: enable: true) nifi can't running, in the server logs I can see the following error:

authorizers.xml
XML declaration allowed only at the start of the document

When the ldap is false all good. It looks like the ldap make the XML to be with wrong syntax in the first line (an extra space?).

Version of Helm, Kubernetes and the Nifi chart: Helm: 3.9 K8s: 1.24 Nifi chart: 1.1.1

What happened: Nifi can't running.

What you expected to happen: Nifi running.

How to reproduce it (as minimally and precisely as possible): Enable ldap and deploy the chart.

Anything else we need to know:

My relevant values yaml:

  ldap:
    enabled: true
    host: ldap://dc.mycompany.local:389
    searchBase: ou=Users,ou=Israel,dc=mycompany,dc=local
    admin: CN=ADMIN,OU=Users,OU=Israel,OU=mycompany,DC=mycompany
    pass: password
    searchFilter: (cn={0})
    userIdentityAttribute: cn
    authStrategy: SIMPLE # How the connection to the LDAP server is authenticated. Possible values are ANONYMOUS, SIMPLE, LDAPS, or START_TLS.
    identityStrategy: USE_DN
    authExpiration: 12 hours
shayki5 commented 1 year ago

I fixed it with adding sed -i '1d' ${NIFI_HOME}/conf/authorizers.xml in the statefulset.yaml here:

{{- if .Values.auth.ldap.enabled }}
          cat "${NIFI_HOME}/conf/authorizers.temp" > "${NIFI_HOME}/conf/authorizers.xml"
          sed -i '1d' ${NIFI_HOME}/conf/authorizers.xml
          cat "${NIFI_HOME}/conf/login-identity-providers-ldap.xml" > "${NIFI_HOME}/conf/login-identity-providers.xml"