You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been attempting to set up an instance of Nominatim with this helm chart and ran into an issue at the very end: the nominatim command line interface worked, and I could connect to the database via psql, but the Nominatim API did not work with the webserver and status.php was returning ERROR: Database connection failed.
Attempting to search resulted in {"error":{"code":500,"message":"Failed to establish database connection:could not find driver"}}
This is with the helm chart setting up the postgresql database.
Testing done
I executed into the pod and in /nominatim/website I created a file called "customstatus.php" with everything the same as "status.php" with the exception that @define('CONST_Database_DSN' is 'pgsql:dbname=nominatim;host=geocode-postgresql;port=5432;user=postgres;password=nominatim'.
When visiting customstatus.php, I get the response "OK".
Solution (ish)
I executed into the pod running Nominatim and ran:
After that the status page returns "ok" and searching works.
The nominatim command line interface (nominatim search --city Urbana) still works despite the change in ENV variable.
That said this has to be done manually after the pod has already started. This setting is undone if the deployment has to restart for any reason. This is not a long term solution.
Suggestion
In _helpers.tpl create a function
{{/*
Create the database DSN.
*/}}
{{- define "nominatim.databaseDSN" -}}
pgsql:dbname={{ include "nominatim.databaseName" . }};host={{ include "nominatim.databaseHost" . }};port={{ include "nominatim.databasePort" . }};user={{ include "nominatim.databaseUser" . }};password={{ include "nominatim.databasePassword" . }}
{{- end }}
In deployment.yaml rather than referencing databaseURL, reference databaseDSN (on line 165):
{{- else }}
value: {{ include "nominatim.databaseDSN" . }}
{{- end }}
I could create a pull request for this if that would be desirable.
Note
The initJob and updatesJob seem to work fine with the previous format for the DSN, as does the nominatim command line interface.
It seems to be specifically the lib-php which is incompatible.
The ENV in initJob.yaml and updatesJob.yaml could be updated for consistency or left alone.
That is a matter of preference.
The text was updated successfully, but these errors were encountered:
What has changed
As of Nominatim version 3.3.0 the format of NOMINATIM_DATABASE_DSN has changed from
pgsql://johndoe:[email protected]:1234/db1
To
pgsql:dbname=db1;host=machine1.domain.com;port=1234;user=johndoe;password=secret
Source: https://nominatim.org/release-docs/latest/admin/Migration/#new-database-connection-string-dsn-format
The error I encountered
I have been attempting to set up an instance of Nominatim with this helm chart and ran into an issue at the very end: the nominatim command line interface worked, and I could connect to the database via psql, but the Nominatim API did not work with the webserver and status.php was returning
ERROR: Database connection failed
.Attempting to search resulted in
{"error":{"code":500,"message":"Failed to establish database connection:could not find driver"}}
This is with the helm chart setting up the postgresql database.
Testing done
I executed into the pod and in
/nominatim/website
I created a file called "customstatus.php" with everything the same as "status.php" with the exception that@define('CONST_Database_DSN'
is'pgsql:dbname=nominatim;host=geocode-postgresql;port=5432;user=postgres;password=nominatim'
.When visiting customstatus.php, I get the response "OK".
Solution (ish)
I executed into the pod running Nominatim and ran:
After that the status page returns "ok" and searching works.
The nominatim command line interface (
nominatim search --city Urbana
) still works despite the change in ENV variable.That said this has to be done manually after the pod has already started. This setting is undone if the deployment has to restart for any reason. This is not a long term solution.
Suggestion
In
_helpers.tpl
create a functionIn
deployment.yaml
rather than referencing databaseURL, reference databaseDSN (on line165
):I could create a pull request for this if that would be desirable.
Note
The initJob and updatesJob seem to work fine with the previous format for the DSN, as does the nominatim command line interface.
It seems to be specifically the
lib-php
which is incompatible.The ENV in initJob.yaml and updatesJob.yaml could be updated for consistency or left alone.
That is a matter of preference.
The text was updated successfully, but these errors were encountered: