mediagis / nominatim-docker

100% working container for Nominatim
Creative Commons Zero v1.0 Universal
1.08k stars 442 forks source link

Error in curl #419

Open jettcalleja opened 1 year ago

jettcalleja commented 1 year ago

Describe the bug Please see logs below:

---> docker run -it --shm-size=1g   -e PBF_URL=https://download.geofabrik.de/europe/monaco-latest.osm.pbf   -e REPLICATION_URL=https://download.geofabrik.de/europe/monaco-updates/   -e IMPORT_WIKIPEDIA=false   -e NOMINATIM_PASSWORD=very_secure_password   -v nominatim-data:/var/lib/postgresql/14/main   -p 8080:8080   --name nominatim   mediagis/nominatim:4.2
+ tailpid=0
+ replicationpid=0
+ trap stopServices SIGTERM TERM INT
+ /app/config.sh
+ id nominatim
+ useradd -m -p very_secure_password nominatim
+ IMPORT_FINISHED=/var/lib/postgresql/14/main/import-finished
+ '[' '!' -f /var/lib/postgresql/14/main/import-finished ']'
+ /app/init.sh
+ OSMFILE=/nominatim/data.osm.pbf
+ CURL='curl -L -A mediagis/nominatim-docker:4.2.0 --fail-with-body'
+ '[' false = true ']'
+ '[' -f false ']'
+ echo 'Skipping optional Wikipedia importance import'
Skipping optional Wikipedia importance import
+ '[' '' = true ']'
+ '[' -f '' ']'
+ echo 'Skipping optional GB postcode import'
Skipping optional GB postcode import
+ '[' '' = true ']'
+ '[' -f '' ']'
+ echo 'Skipping optional US postcode import'
Skipping optional US postcode import
+ '[' '' = true ']'
+ '[' -f '' ']'
+ echo 'Skipping optional Tiger addresses import'
Skipping optional Tiger addresses import
+ '[' https://download.geofabrik.de/europe/monaco-latest.osm.pbf '!=' '' ']'
+ echo Downloading OSM extract from https://download.geofabrik.de/europe/monaco-latest.osm.pbf
Downloading OSM extract from https://download.geofabrik.de/europe/monaco-latest.osm.pbf
+ curl -L -A mediagis/nominatim-docker:4.2.0 --fail-with-body https://download.geofabrik.de/europe/monaco-latest.osm.pbf -C - --create-dirs -o /nominatim/data.osm.pbf
curl: (6) getaddrinfo() thread failed to start

Expected behavior Can run localhost:8080

Desktop / Server (please complete the following information):

mtmail commented 1 year ago

getaddrinfo() sounds like a DNS issue. Make sure the host machine can access the URL.

jettcalleja commented 1 year ago

I can directly curl the URL and download the osm

mtmail commented 1 year ago

As a work-around you can try downloading the file first and use PBF_PATH instead of PBF_URL

jettcalleja commented 1 year ago

hi @mtmail, I am not getting an error OSM file 'xx.osmpbf' does not exist., what to do here? Tried relative and absolute path.

SenorKarlos commented 1 year ago

mine is failing on wikimedia curl, returning 403

nominatim    | 2023-01-14T23:13:11.640750700Z Downloading Wikipedia importance dump
nominatim    | 2023-01-14T23:13:11.640785285Z + curl -L -A mediagis/nominatim-docker:4.2.0 --fail-with-body https://nominatim.org/data/wikimedia-importance.sql.gz -o /nominatim/wikimedia-importance.sql.gz
nominatim    | 2023-01-14T23:13:11.651184501Z   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
nominatim    | 2023-01-14T23:13:11.651232112Z                                  Dload  Upload   Total   Spent    Left  Speed
100   153  100   153    0     0    129      0  0:00:01  0:00:01 --:--:--   129
nominatim    | 2023-01-14T23:13:12.832448849Z curl: (22) The requested URL returned error: 403

This image have curl ing issues?

SenorKarlos commented 1 year ago

Same error with us post codes, commented out wikimedia for now. All my other docker containers and the server have internet access

mtmail commented 1 year ago

@SenorKarlos That's unrelated (more likely related to https://github.com/mediagis/nominatim-docker/issues/416) and you should open a separate issue.

mtmail commented 1 year ago

@jettcalleja The path needs to be accessible from inside the Docker container. Likely requires binding a volume first.

jettcalleja commented 1 year ago

hi @mtmail I think this is a separate issue but it has now PostgreSQL error related:

 * Starting PostgreSQL 14 database server                                                                                                                                                                                                                                                                                                                            * Error: /usr/lib/postgresql/14/bin/pg_ctl /usr/lib/postgresql/14/bin/pg_ctl start -D /var/lib/postgresql/14/main -l /var/log/postgresql/postgresql-14-main.log -s -o  -c config_file="/etc/postgresql/14/main/postgresql.conf"  exited with status 1: 
popen failure: Cannot allocate memory
The program "postgres" is needed by pg_ctl but was not found in the
same directory as "/usr/lib/postgresql/14/bin/pg_ctl".
Check your installation.
jettcalleja commented 1 year ago

Anyway, works on Nominatim version 3.7. Any reasons why it was not working on version 4?

mtmail commented 1 year ago

Is this for Monaco and --shm-size 1GB? We set Nominatim mininum RAM to 2GB https://nominatim.org/release-docs/latest/admin/Installation/#hardware as far as 6 years ago, the maximum 128GB increased 6 months ago based on user feedback. For testing with Vagrant (Virtualbox virtual machine, https://github.com/osm-search/Nominatim/blob/master/Vagrantfile) we had to increase the memory to 2GB, 1GB was no longer enough, even for the smallest dataset.

The database defaults (https://github.com/mediagis/nominatim-docker/tree/master/4.2#postgresql-tuning) are selected more towards somebody importing the whole planet. Actually it's pretty hard to have one set of settings that works equally well for importing one city or the whole planet.