mediagis / nominatim-docker

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

v3.3 ...could not connect to server: No such file or directory #70

Closed mesmeric-fiend closed 3 years ago

mesmeric-fiend commented 5 years ago

Failed to establish database connection:SQLSTATE[08006] [7] could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

Full log of DB installation:

[root@localhost map]# docker run -t -v /opt/nominatim/src/map:/data nominatim  sh /app/init.sh /data/maldives-latest.osm.pbf postgresdata 40
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "C.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /data/postgresdata ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    /usr/lib/postgresql/11/bin/pg_ctl -D /data/postgresdata -l logfile start

waiting for server to start....2019-06-04 13:06:31.989 UTC [27] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2019-06-04 13:06:31.989 UTC [27] LOG:  could not bind IPv6 address "::1": Cannot assign requested address
2019-06-04 13:06:31.989 UTC [27] HINT:  Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
2019-06-04 13:06:32.110 UTC [27] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2019-06-04 13:06:32.370 UTC [28] LOG:  database system was shut down at 2019-06-04 13:06:31 UTC
2019-06-04 13:06:32.462 UTC [27] LOG:  database system is ready to accept connections
 done
server started
NOTICE:  database "nominatim" does not exist, skipping
DROP DATABASE
2019-06-04 13:11:29 == module path: /app/src/build/module
2019-06-04 13:11:29 == Create DB
2019-06-04 13:11:29.981 UTC [95] FATAL:  database "nominatim" does not exist
2019-06-04 13:11:31 == Setup DB
Postgres version found: 11
Postgis version found: 2.5
2019-06-04 13:11:40 == WARNING: optional external UK postcode table file (/app/src/data/gb_postcode_data.sql.gz) not found. Skipping.
2019-06-04 13:11:41 == Import data
osm2pgsql version 0.96.0 (64 bit id space)

Parsing gazetteer style file '/app/src/settings/import-full.style'.
Using projection SRS 4326 (Latlong)
NOTICE:  table "place" does not exist, skipping
Allocating memory for dense node cache
Allocating dense node cache in one big chunk
Allocating memory for sparse node cache
Sharing dense sparse
Node-cache: cache=3136MB, maxblocks=50176*65536, allocation method=11
Mid: pgsql, cache=3136
Setting up table: planet_osm_nodes
NOTICE:  table "planet_osm_nodes" does not exist, skipping
Setting up table: planet_osm_ways
NOTICE:  table "planet_osm_ways" does not exist, skipping
Setting up table: planet_osm_rels
NOTICE:  table "planet_osm_rels" does not exist, skipping

Reading in file: /data/maldives-latest.osm.pbf
Using PBF parser.
Processing: Node(367k 183.8k/s) Way(27k 27.29k/s) Relation(860 430.00/s)  parse time: 5s
Node stats: total(367691), max(6516133640) in 2s
Way stats: total(27287), max(693469837) in 1s
Relation stats: total(881), max(9637303) in 2s
Setting up table: planet_osm_nodes
Setting up table: planet_osm_ways
Setting up table: planet_osm_rels

Going over pending ways...
        0 ways are pending

Using 1 helper-processes
Finished processing 0 ways in 1 s

0 Pending ways took 1s at a rate of 0.00/s

Going over pending relations...
        0 relations are pending

Using 1 helper-processes
Finished processing 0 relations in 1 s

0 Pending relations took 1s at a rate of 0.00/s
node cache: stored: 367691(100.00%), storage efficiency: 49.55% (dense blocks: 2, sparse nodes: 362834), hit rate: 100.00%
Stopping table: planet_osm_nodes
Stopped table: planet_osm_nodes in 0s
Stopping table: planet_osm_ways
Stopped table: planet_osm_ways in 0s
Stopping table: planet_osm_rels
Building index on table: planet_osm_rels
Stopped table: planet_osm_rels in 0s

Osm2pgsql took 8s overall
2019-06-04 13:11:49 == Create Functions
2019-06-04 13:11:51 == Create Tables
2019-06-04 13:11:56 == Create Functions
2019-06-04 13:11:58 == Create Partition Tables
2019-06-04 13:15:03 == Create Partition Functions
2019-06-04 13:15:04 == WARNING: wikipedia article dump file not found - places will have default importance
2019-06-04 13:15:04 == WARNING: wikipedia redirect dump file not found - some place importance values may be missing
2019-06-04 13:15:04 == Drop old Data
......................................................................................................................................................................................................................................................................
2019-06-04 13:17:01 == Loading word list
 count
-------
  3873
(1 row)

 count
-------
   718
(1 row)

2019-06-04 13:17:04 == Load Data

2019-06-04 13:17:14 == Reanalysing database
Latest data imported from 2019-05-30T06:57:19Z.
2019-06-04 13:17:19 == Calculate Postcodes
2019-06-04 13:17:26 == Index ranks 0 - 4
nominatim version 3.3.0

Starting indexing rank (0 to 4) using 40 threads
Starting rank 0
  Done 0 in 0 @ 0.000000 per second - FINISHED

Starting rank 1
  Done 0 in 0 @ 0.000000 per second - FINISHED

Starting rank 2
  Done 2 in 1 @ 2.000000 per second - ETA (seconds): 0.000000
  Done 2 in 1 @ 2.000000 per second - FINISHED

Starting rank 3
  Done 0 in 0 @ 0.000000 per second - FINISHED

Starting rank 4
  Done 2 in 0 @ 2.000000 per second - ETA (seconds): 0.000000
  Done 2 in 0 @ 2.000000 per second - FINISHED

2019-06-04 13:17:34 == Index ranks 5 - 25
nominatim version 3.3.0

Starting indexing rank (5 to 25) using 40 threads
Starting rank 5
  Done 0 in 0 @ 0.000000 per second - FINISHED

Starting rank 6
  Done 0 in 0 @ 0.000000 per second - FINISHED

Starting rank 7
  Done 0 in 0 @ 0.000000 per second - FINISHED

Starting rank 8
  Slow place_id 108739
  Done 21 in 2 @ 10.500000 per second - ETA (seconds): 0.000000
  Done 21 in 2 @ 10.500000 per second - FINISHED

Starting rank 9
  Done 0 in 0 @ 0.000000 per second - FINISHED

Starting rank 10
  Done 0 in 0 @ 0.000000 per second - FINISHED

Starting rank 11
  Done 0 in 0 @ 0.000000 per second - FINISHED

Starting rank 12
  Done 0 in 0 @ 0.000000 per second - FINISHED

Starting rank 13
  Done 0 in 0 @ 0.000000 per second - FINISHED

Starting rank 14
  Done 0 in 0 @ 0.000000 per second - FINISHED

Starting rank 15
  Done 1 in 0 @ 1.000000 per second - ETA (seconds): 0.000000
  Done 1 in 0 @ 1.000000 per second - FINISHED

Starting rank 16
  Done 3 in 0 @ 3.000000 per second - ETA (seconds): 0.000000
  Done 3 in 0 @ 3.000000 per second - FINISHED

Starting rank 17
  Slow place_id 104395
  Slow place_id 103536
  Slow place_id 109193
  Slow place_id 102650
  Slow place_id 102479
  Slow place_id 103059
  Slow place_id 103046
  Slow place_id 103274
  Slow place_id 103990
  Slow place_id 103786
  Slow place_id 112853
  Slow place_id 106029
  Slow place_id 102949
  Done 173 in 2 @ 86.500000 per second - ETA (seconds): 0.000000
  Done 173 in 2 @ 86.500000 per second - FINISHED

Starting rank 18
  Done 18 in 0 @ 18.000000 per second - ETA (seconds): 0.000000
  Done 18 in 0 @ 18.000000 per second - FINISHED

Starting rank 19
  Done 8 in 0 @ 8.000000 per second - ETA (seconds): 0.000000
  Done 8 in 0 @ 8.000000 per second - FINISHED

Starting rank 20
  Done 219 in 1 @ 219.000000 per second - ETA (seconds): 0.000000
  Done 219 in 1 @ 219.000000 per second - FINISHED

Starting rank 21
  Done 3 in 0 @ 3.000000 per second - ETA (seconds): 0.000000
  Done 3 in 0 @ 3.000000 per second - FINISHED

Starting rank 22
  Done 56 in 0 @ 56.000000 per second - ETA (seconds): 0.000000
  Done 56 in 0 @ 56.000000 per second - FINISHED

Starting rank 23
  Done 0 in 0 @ 0.000000 per second - FINISHED

Starting rank 24
  Done 52 in 0 @ 52.000000 per second - ETA (seconds): 0.000000
  Done 52 in 0 @ 52.000000 per second - FINISHED

Starting rank 25
  Done 0 in 0 @ 0.000000 per second - FINISHED

2019-06-04 13:17:45 == Index ranks 26 - 30
nominatim version 3.3.0

Starting indexing rank (26 to 30) using 40 threads
Starting rank 26
  Slow place_id 106782
  Slow place_id 106398
  Slow place_id 103597
  Slow place_id 111544
  Slow place_id 112468
  Slow place_id 105194
  Slow place_id 112377
  Slow place_id 105184
  Slow place_id 105468
  Slow place_id 107904
  Slow place_id 112225
  Slow place_id 111500
  Slow place_id 111196
  Slow place_id 105428
  Slow place_id 101774
  Slow place_id 106348
  Slow place_id 104617
  Slow place_id 104399
  Slow place_id 107080
  Slow place_id 112217
  Slow place_id 104902
  Slow place_id 105406
  Slow place_id 108212
  Slow place_id 100244
  Slow place_id 100242
  Slow place_id 104622
  Slow place_id 104624
  Slow place_id 105174
  Slow place_id 105109
  Slow place_id 105170
  Slow place_id 112843
  Slow place_id 111558
  Slow place_id 101772
  Slow place_id 100338
  Slow place_id 100243
  Slow place_id 112858
  Slow place_id 107083
  Slow place_id 105268
  Slow place_id 101771
  Done 637 in 5 @ 127.400002 per second - Rank 26 ETA (seconds): 36.907379
  Done 1657 in 7 @ 236.714279 per second - Rank 26 ETA (seconds): 15.554617
  Done 2607 in 9 @ 289.666656 per second - Rank 26 ETA (seconds): 9.431531
  Done 3558 in 11 @ 323.454559 per second - Rank 26 ETA (seconds): 5.506183
  Done 4592 in 13 @ 353.230774 per second - Rank 26 ETA (seconds): 2.114765
  Done 5339 in 14 @ 381.357147 per second - ETA (seconds): 0.000000
  Done 6060 in 16 @ 378.750000 per second - Rank 26 ETA (seconds): -1.903630
  Done 6540 in 17 @ 384.705872 per second - Rank 26 ETA (seconds): -3.121866
  Done 7299 in 18 @ 405.500000 per second - Rank 26 ETA (seconds): -4.833539
  Done 8019 in 19 @ 422.052643 per second - Rank 26 ETA (seconds): -6.349919
  Done 8741 in 20 @ 437.049988 per second - Rank 26 ETA (seconds): -7.784007
  Done 9541 in 21 @ 454.333344 per second - Rank 26 ETA (seconds): -9.248715
  Done 10301 in 23 @ 447.869568 per second - Rank 26 ETA (seconds): -11.079119
  Done 10678 in 23 @ 464.260864 per second - ETA (seconds): -11.500000
  Done 10678 in 23 @ 464.260864 per second - FINISHED

Starting rank 27
  Done 128 in 1 @ 128.000000 per second - ETA (seconds): 0.000000
  Done 128 in 1 @ 128.000000 per second - FINISHED

Starting rank 28
  Done 0 in 0 @ 0.000000 per second - FINISHED

Starting rank 29
  Done 0 in 0 @ 0.000000 per second - FINISHED

Starting interpolation lines (location_property_osmline)
  Done 19 in 0 @ 19.000000 per second - ETA (seconds): 0.000000
  Done 19 in 0 @ 19.000000 per second - FINISHED

Starting rank 30
  Done 1151 in 3 @ 383.666656 per second - Rank 30 ETA (seconds): 14.801911
  Done 2244 in 6 @ 374.000000 per second - Rank 30 ETA (seconds): 12.262033
  Done 3487 in 8 @ 435.875000 per second - Rank 30 ETA (seconds): 7.669630
  Done 4642 in 11 @ 422.000000 per second - Rank 30 ETA (seconds): 5.184834
  Done 5675 in 13 @ 436.538452 per second - Rank 30 ETA (seconds): 2.645815
  Done 6755 in 15 @ 450.333344 per second - Rank 30 ETA (seconds): 0.166543
  Done 6830 in 16 @ 426.875000 per second - ETA (seconds): 0.000000
  Done 7590 in 17 @ 446.470581 per second - Rank 30 ETA (seconds): -1.702240
  Done 8271 in 18 @ 459.500000 per second - Rank 30 ETA (seconds): -3.136017
  Done 9030 in 19 @ 475.263153 per second - Rank 30 ETA (seconds): -4.629014
  Done 9790 in 20 @ 489.500000 per second - Rank 30 ETA (seconds): -6.046987
  Done 10592 in 22 @ 481.454559 per second - Rank 30 ETA (seconds): -7.813821
  Done 11272 in 23 @ 490.086945 per second - Rank 30 ETA (seconds): -9.063698
  Done 11986 in 24 @ 499.416656 per second - Rank 30 ETA (seconds): -10.324045
  Done 12746 in 25 @ 509.839996 per second - Rank 30 ETA (seconds): -11.603641
  Done 13470 in 26 @ 518.076904 per second - Rank 30 ETA (seconds): -12.816630
  Done 13660 in 27 @ 505.925934 per second - ETA (seconds): -13.500000
  Done 13660 in 27 @ 505.925934 per second - FINISHED

2019-06-04 13:18:38 == Index postcodes
2019-06-04 13:18:47 == Create Search indices
2019-06-04 13:18:50 == Create search index for default country names
 getorcreate_country
---------------------
               48915
(1 row)

 getorcreate_country
---------------------
               48916
(1 row)

 count
-------
   251
(1 row)

 count
-------
   247
(1 row)

 count
-------
 11688
(1 row)

Summary of warnings:

  * optional external UK postcode table file (/app/src/data/gb_postcode_data.sql.gz) not found. Skipping.
  * wikipedia article dump file not found - places will have default importance
  * wikipedia redirect dump file not found - some place importance values may be missing

2019-06-04 13:18:53 == Setup finished.
waiting for server to shut down....2019-06-04 13:18:54.049 UTC [27] LOG:  received fast shutdown request
2019-06-04 13:18:54.120 UTC [27] LOG:  aborting any active transactions
2019-06-04 13:18:54.133 UTC [27] LOG:  background worker "logical replication launcher" (PID 34) exited with exit code 1
..2019-06-04 13:18:56.872 UTC [29] LOG:  shutting down
.2019-06-04 13:18:58.039 UTC [27] LOG:  database system is shut down
 done
server stopped
[root@localhost map]# docker run --restart=always -p 6432:5432 -p 7070:8080 -d --name nominatim -v /opt/osrm/src/map/postgresdata:/var/lib/postgresql/11/main nominatim bash /app/start.sh
60efb973fab9da98eec10dd7c524db4556d60de1bdd4fb07a7f9d0def53f1c26
[root@localhost map]# curl 'http://localhost:7070'
<!DOCTYPE html>
<html lang="en">
<head>
    <style>
        em { font-weight: bold; font-family: monospace; color: #e00404; background-color: #ffeaea; }
    </style>
</head>
<body>
    <h1>Internal Server Error</h1>

        <p>Nominatim has encountered an internal error while accessing the database.
           This may happen because the database is broken or because of a bug in
           the software.</p>

    <h3>Details</h3>

    Failed to establish database connection:SQLSTATE[08006] [7] could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

    <p>
        If you feel this error is incorrect feel file an issue on
        <a href="https://github.com/openstreetmap/Nominatim/issues">Github</a>.

        Please include the error message above and the URL you used.
    </p>
</body>
</html>
itamar-otonomo commented 5 years ago

Same here.

aerotypebharat commented 5 years ago

I got same error too

shaiperson commented 4 years ago

Same. Was anyone able to fix or get around this? Thanks.

VasyaKing commented 4 years ago

The same with v3.4

greghor commented 4 years ago

Same error when running on ubuntu. But it works fine on mac os x.

greghor commented 4 years ago

I was able to get rid of the error by building the image (3.4) manually instead of pulling the image from docker hub

Altroo commented 4 years ago

I was able to get rid of the error by building the image (3.4) manually instead of pulling the image from docker hub

The v3.4 uses postgres v11 The v3.5 uses postgres v12

Notice the : /var/lib/postgresql/VERSION/main use : /var/lib/postgresql/11/main for nominatim 3.4 & /var/lib/postgresql/12/main for nominatim 3.5 docker run --restart=always -p 6432:5432 -p 7070:8080 -d --name nominatim -v /opt/osrm/src/map/postgresdata:/var/lib/postgresql/11/main nominatim bash /app/start.sh

philipkozeny commented 3 years ago

We've changed quite a lot with the latest releases (3.6 & 3.7). You can check the latest version out and give us feedback, the problem should be fixed.

JyzjYzjyZ commented 3 weeks ago

in ubuntu24 the same problem

JyzjYzjyZ commented 3 weeks ago

原因是输入本机的路径,脚本却读取容器内的路径.即在Ubuntu的docker上存在file.pbf没有被正确挂载的问题

使用

sudo docker run -it \
  -v $(pwd)/shanghai-latest.osm.pbf:/data/shanghai-latest.osm.pbf \
  -e PBF_PATH=/data/shanghai-latest.osm.pbf \
  -p 8080:8080 \
  --name nominatim \
  mediagis/nominatim:4.4