Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: neo4j-standalone - duplicate mapping key at ConfigMap #36

Closed
1 task done
chlumper opened this issue Apr 5, 2022 · 7 comments
Closed
1 task done

[Bug]: neo4j-standalone - duplicate mapping key at ConfigMap #36

chlumper opened this issue Apr 5, 2022 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@chlumper
Copy link

chlumper commented Apr 5, 2022

Contact Details

[email protected]

What happened?

If you render the neo4j-standalone helm chart using helm template -f values.yaml neo4j-test .
using a minimal values.yaml:

neo4j:
  enabled: true
  volumes:
    data:
      mode: "volume"
      volume:
        emptyDir:
          medium: Memory

it leads to a duplicate mapping key for dbms.directories.import in the ConfigMap

# Source: neo4j-test/charts/neo4j/templates/neo4j-config.yaml
# Default Neo4j config values, these are overridden by user-provided values in neo4j-test-user-config
apiVersion: v1
kind: ConfigMap
metadata:
  name: "neo4j-test-default-config"
  namespace: "default"
  labels:
    app: "neo4j"
data:
  # Neo4j defaults
  dbms.directories.import: import # <---- DUPLICATE
  dbms.tx_state.memory_allocation: ON_HEAP
  dbms.connector.bolt.enabled: 'true'
  dbms.connector.http.enabled: 'true'
  dbms.connector.https.enabled: 'false'
  dbms.tx_log.rotation.retention_policy: 1 days
  dbms.windows_service_name: neo4j

  # ...

  # Import
  dbms.directories.import: "/import" # <---- DUPLICATE

which is invalid according to the yaml spec and leads to the following error at the cd tool flux:

Helm install failed: error while running post render on files:
    map[string]interface {}(nil): yaml: unmarshal errors:
        line 38: mapping key "dbms.directories.import" already defined at line 14

(Similar issues at other helm charts with flux: fluxcd/helm-controller#283)


Expected behavior:

Valid yaml with single dbms.directories.import entry in the ConfigMap to allow deplyoment with cd tool flux.


Relevant parts at the helm chart:

  • configmap - neo4j defaults:
    # Neo4j defaults
    {{- /* TODO: figure out how to use lookup to detect if there is an existing default configMap and require user to explicitly force overwrite */}}
    {{- include "neo4j.configYaml" $confFile | nindent 2 }}
  • configmap - import:
    {{- if .Values.volumes.import }}
    # Import
    dbms.directories.import: "/import"
    {{- end }}
  • conf:
    # This setting constrains all `LOAD CSV` import files to be under the `import` directory. Remove or comment it out to
    # allow files to be loaded from anywhere in the filesystem; this introduces possible security problems. See the
    # `LOAD CSV` section of the manual for details.
    dbms.directories.import=import

As a workaround I tried to disable the "import volume" with the following values.yaml entry without any luck, due to merging behavior of helm and the template conditional.

neo4j:
  volumes:
    import:
      enabled: false

or

neo4j:
  volumes:
    import: {}

Tested with neo4j-standalone version 4.4.3 and 4.4.5.

Chart Name

Standalone

Chart Version

4.4.3

Environment

Microsoft Azure

Relevant log output

Helm install failed: error while running post render on files:
    map[string]interface {}(nil): yaml: unmarshal errors:
        line 38: mapping key "dbms.directories.import" already defined at line 14

Code of Conduct

  • I agree to follow this project's Code of Conduct
@chlumper chlumper added the bug Something isn't working label Apr 5, 2022
@harshitsinghvi22
Copy link
Contributor

harshitsinghvi22 commented Apr 7, 2022

Hi @chlumper

The values.yaml posted looks incorrect

neo4j:
  enabled: true
  volumes:
    data:
      mode: "volume"
      volume:
        emptyDir:
          medium: Memory

there is no enabled or volumes object under neo4j.

Can you please check and provide the correct and complete values.yaml ?

Thanks,
Harshit

@harshitsinghvi22
Copy link
Contributor

Hi @chlumper

Was able to reproduce the issue with the below yaml.

volumes:
    data:
      mode: "volume"
      volume:
        emptyDir:
          medium: Memory

Will take a look and do the necessary fix.

Thanks for bringing this to our attention. Appreciate your time and effort in raising this issue.

Regards,
Harshit

@chlumper
Copy link
Author

chlumper commented Apr 7, 2022

Hi @chlumper

The values.yaml posted looks incorrect

neo4j:
  enabled: true
  volumes:
    data:
      mode: "volume"
      volume:
        emptyDir:
          medium: Memory

there is no enabled or volumes object under neo4j.

Can you please check and provide the correct and complete values.yaml ?

Thanks, Harshit

Sorry the sub entry neo4j and enabled is just there since its used in an umbrella chart like this:

apiVersion: v2
name: neo4j-test
description: A Helm chart to test neo4j
type: application
version: 0.0.1
appVersion: "0.0.1"

dependencies:
  - condition: neo4j.enabled
    name: neo4j-standalone
    version: 4.4.3
    repository: https://helm.neo4j.com/neo4j
    alias: neo4j

But as you denoted that's not causing the actual problem.

Thanks a lot for taking a look!

@harshitsinghvi22
Copy link
Contributor

Hi @chlumper ,

The fix is merged to dev in this PR

#37

Will be released in the upcoming release.

Thanks,
Harshit

@chlumper
Copy link
Author

chlumper commented Apr 7, 2022

Hi @harshitsinghvi22,

Thanks a lot for the quick fix!

Is there any roadmap for the upcoming release version? Looking forward to it...

Greets

@harshitsinghvi22
Copy link
Contributor

Hi @chlumper ,

Probably by end of next week we will release a new version.

You can always track the newest version here

Thanks,
Harshit

@harshitsinghvi22
Copy link
Contributor

Hi @chlumper ,

4.4.6 is released now.

Thanks,
Harshit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants