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 duplicate mapping key at ConfigMap (default-config) #160

Closed
1 task done
StiviiK opened this issue Mar 30, 2023 · 1 comment
Closed
1 task done

[Bug]: neo4j duplicate mapping key at ConfigMap (default-config) #160

StiviiK opened this issue Mar 30, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@StiviiK
Copy link

StiviiK commented Mar 30, 2023

What happened?

If you render the neo4j helm chart using helm template using a minimal values.yaml (taken from the example):

neo4j:
  name: neo4j
  resources:
    cpu: "0.5"
    memory: "2Gi"

  # Uncomment to set the initial password
  #password: "my-initial-password"

  # Uncomment to use enterprise edition
  #edition: "enterprise"
  #acceptLicenseAgreement: "yes"

volumes:
  data:
    mode: "dynamic"
    dynamic:
      # * managed-csi-premium provisions premium SSD disks (recommended)
      # * managed-csi provisions standard SSD-backed disks
      storageClassName: managed-csi-premium

It leads to a duplicate mapping key for server.directories.import & server.jvm.additional in the ConfigMap.

apiVersion: v1
kind: ConfigMap
metadata:
  name: "my-neo4j-release-default-config"
  namespace: "simulation"
  labels:
    app: "my-standalone"    
data:

  # Neo4j defaults
  server.directories.import: import
  [...]
  server.jvm.additional: -XX:+UseG1GC
  server.jvm.additional: -XX:-OmitStackTraceInFastThrow
  server.jvm.additional: -XX:+AlwaysPreTouch
  server.jvm.additional: -XX:+UnlockExperimentalVMOptions
  server.jvm.additional: -XX:+TrustFinalNonStaticFields
  server.jvm.additional: -XX:+DisableExplicitGC
  server.jvm.additional: -Djdk.nio.maxCachedBufferSize=1024
  server.jvm.additional: -Dio.netty.tryReflectionSetAccessible=true
  server.jvm.additional: -Djdk.tls.ephemeralDHKeySize=2048
  server.jvm.additional: -Djdk.tls.rejectClientInitiatedRenegotiation=true
  server.jvm.additional: -XX:FlightRecorderOptions=stackdepth=256
  server.jvm.additional: -XX:+UnlockDiagnosticVMOptions
  server.jvm.additional: -XX:+DebugNonSafepoints
  server.jvm.additional: --add-opens=java.base/java.nio=ALL-UNNAMED
  server.jvm.additional: --add-opens=java.base/java.io=ALL-UNNAMED
  server.jvm.additional: --add-opens=java.base/sun.nio.ch=ALL-UNNAMED
  server.jvm.additional: -Dlog4j2.disable.jmx=true
  [...]
  server.directories.import: "/import"

When trying to deploy this Chart via FluxCD it leads to Helm install errors.

Chart Name

Standalone

Chart Version

5.5.0

Environment

FluxCD, Kustomize

Relevant log output

Status:                                                                                                                                                                                                                                                                      │
│   Conditions:                                                                                                                                                                                                                                                                │
│     Last Transition Time:  2023-03-30T10:17:39Z                                                                                                                                                                                                                              │
│     Message:               Helm install failed: error while running post render on files: map[string]interface {}(nil): yaml: unmarshal errors:                                                                                                                              │
│   line 55: mapping key "server.directories.import" already defined at line 14                                                                                                                                                                                                │
│   line 20: mapping key "server.jvm.additional" already defined at line 19                                                                                                                                                                                                    │
│   line 21: mapping key "server.jvm.additional" already defined at line 19

Relevant Issues

fluxcd/flux2#1522

Duplicate YAML keys

Unlike Helm, the Kustomize yaml parser (kyaml) does not accept duplicate keys, while Helm drops the duplicates, Kustomize errors out. This impacts helm-controller as it uses kustomize/kyaml to label objects reconciled by a HelmRelease.

For example, a chart that adds the app.kubernetes.io/name more than once, will result in a HelmRelease install failure:

map[string]interface {}(nil): yaml: unmarshal errors:
line 21: mapping key "app.kubernetes.io/name" already defined at line 20

Code of Conduct

  • I agree to follow this project's Code of Conduct
@StiviiK StiviiK added the bug Something isn't working label Mar 30, 2023
@StiviiK
Copy link
Author

StiviiK commented Mar 30, 2023

Closing, duplicate of #119

@StiviiK StiviiK closed this as completed Mar 30, 2023
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