neo4j / helm-charts

Apache License 2.0
59 stars 52 forks source link

[Bug]: Command expansion error when using script for "config" values. #316

Closed tanvp112 closed 6 months ago

tanvp112 commented 7 months ago

Contact Details

tanvp112@gmail.com

What happened?

Example when set the helm values for config:

config:
  server.routing.advertised_address: "$(hostname -i)"

Will see the following error during neo4j start up:

Failed to read config /config/neo4j.conf: Error evaluating value for setting 'server.routing.advertised_address'. $(hostname -i) is a command, but config is not explicitly told to expand it. (Missing --expand-commands argument?)

However, later in the log will see:

2024-03-26 08:49:35.605+0000 INFO  Command expansion is explicitly enabled for configuration
2024-03-26 08:49:35.605+0000 INFO  Executing external script to retrieve value of setting server.routing.advertised_address

Since command expansion is enabled by default, is there really an error going on here?

When trying to understand more about the error, I encountered the following line {{- $configImport := .Values.configImport -}} for user-config but couldn't find the reference for this value - what is this configImport and where does it get its value from?

The manual says neo4j.conf will not be used here, so how does user specified configurations gets to apply?

Chart Name

Neo4j

Chart Version

5.12.0

Environment

Amazon Web Services

Relevant log output

No response

Code of Conduct

harshitsinghvi22 commented 6 months ago

@tanvp112 just tried the below config and its working as expected

config:        
  server.routing.advertised_address: "$(bash -c 'hostname -i')"

helm install command

helm install standalone neo4j --set neo4j.password="password" --set volumes.data.mode="defaultStorageClass" --set neo4j.edition="enterprise" --set neo4j.acceptLicenseAgreement="yes" --set neo4j.name="demo" -f demo.yaml

Logs

│ 2024-04-03 09:07:15.895+0000 INFO  Command expansion is explicitly enabled for configuration                                                                                                │
│ 2024-04-03 09:07:15.896+0000 INFO  Executing external script to retrieve value of setting server.routing.advertised_address                                                                 │
│ 2024-04-03 09:07:15.992+0000 INFO  Starting...                                                                                                                                              │
│ 2024-04-03 09:07:28.587+0000 INFO  ======== Neo4j 5.17.0 ========                                                                                                                           │
│ 2024-04-03 09:07:28.786+0000 INFO  This instance is ServerId{9998ba55} (9998ba55-a1a6-4696-87ce-a4a10abce150)
tanvp112 commented 6 months ago

@harshitsinghvi22 , can you advise where does Values.configImport gets it values from {{- $configImport := .Values.configImport -}} ? There is no such field in the values.yaml.