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

NumericValueOutOfRange: value "11111111111111111111" is out of range #3527

Closed
NGeb1 opened this issue Aug 27, 2024 · 5 comments
Closed

NumericValueOutOfRange: value "11111111111111111111" is out of range #3527

NGeb1 opened this issue Aug 27, 2024 · 5 comments

Comments

@NGeb1
Copy link

NGeb1 commented Aug 27, 2024

Describe the bug
Last lines in replication.log:
2024-08-26 06:59:27: Starting rank 0 (using batch size 1)
2024-08-26 06:59:29: Done 590 in 2 @ 293.392 per second - rank 0 ETA (seconds): 1.64
2024-08-26 06:59:30: Done 883 in 2 @ 302.591 per second - rank 0 ETA (seconds): 0.62
2024-08-26 06:59:31: Done 1070/1070 in 3 @ 291.159 per second - FINISHED rank 0

    2024-08-26 06:59:31: Starting interpolation lines (location_property_osmline) (using batch size 20)
    Traceback (most recent call last):
      File "/usr/local/bin/nominatim", line 12, in <module>
        exit(cli.nominatim(module_dir='/usr/local/lib/nominatim/module',
      File "/usr/local/lib/nominatim/lib-python/nominatim/cli.py", line 228, in nominatim
        return get_set_parser().run(**kwargs)
      File "/usr/local/lib/nominatim/lib-python/nominatim/cli.py", line 121, in run
        return args.command.run(args)
      File "/usr/local/lib/nominatim/lib-python/nominatim/clicmd/replication.py", line 199, in run
        self._update(args)
      File "/usr/local/lib/nominatim/lib-python/nominatim/clicmd/replication.py", line 164, in _update
        indexer.index_full(analyse=False)
      File "/usr/local/lib/nominatim/lib-python/nominatim/indexer/indexer.py", line 140, in index_full
        if self.index_by_rank(26, 30) > 1000:
      File "/usr/local/lib/nominatim/lib-python/nominatim/indexer/indexer.py", line 178, in index_by_rank
        total += self._index(runners.InterpolationRunner(analyzer), 20)
      File "/usr/local/lib/nominatim/lib-python/nominatim/indexer/indexer.py", line 234, in _index
        runner.index_places(pool.next_free_worker(), part)
      File "/usr/local/lib/nominatim/lib-python/nominatim/db/async_connection.py", line 201, in next_free_worker
        return next(self.free_workers)
      File "/usr/local/lib/nominatim/lib-python/nominatim/db/async_connection.py", line 209, in _yield_free_worker
        if thread.is_done():
      File "/usr/local/lib/nominatim/lib-python/nominatim/db/async_connection.py", line 159, in is_done
        if self.conn.poll() == psycopg2.extensions.POLL_OK:
    psycopg2.errors.NumericValueOutOfRange: value "11111111111111111111" is out of range for type integer
    CONTEXT:  PL/pgSQL function osmline_update() line 59 at FOR over SELECT rows

To Reproduce
I had a full planet import with 4.0, I managed to update it to 4.2, and than updated to 4.4, all with continuous replication.

P.S. I managed to overcome the previous replication problems, which apparently happened because of the planet vandalism problems, by running "NOMINATIM_REPLICATION_URL=https://planet.openstreetmap.org/replication/day/ NOMINATIM_REPLICATION_MAX_DIFF=10000 nominatim replication --catch-up --project-dir /nominatim" inside the container.

Software Environment (please complete the following information):

  • Nominatim version: 4.4
  • Postgresql version: mediagis/nominatim-docker/4.4
  • Postgis version: mediagis/nominatim-docker/4.4
  • OS: mediagis/nominatim-docker/4.4

Hardware Configuration (please complete the following information):

  • RAM: 128GB
  • number of CPUs: 56
  • type and size of disks: 3TB SSD vdisk VMWare on HPE Alletra storage system

Postgresql Configuration:

sudo docker run -it -e PBF_URL=https://planet.openstreetmap.org/pbf/planet-latest.osm.pbf -e IMPORT_WIKIPEDIA=true -e REPLICATION_URL=https://planet.openstreetmap.org/replication/hour/ -e UPDATE_MODE=continuous -e POSTGRES_MAINTENANCE_WORK_MEM=20GB -e POSTGRES_EFFECTIVE_CACHE_SIZE=48GB --shm-size=64G -v /opt/nominatim-data:/var/lib/postgresql/14/main -v /opt/nominatim-flatnode:/nominatim/flatnode -p 8080:8080 --name nominatim mediagis/nominatim:4.4

Nominatim Configuration:
see above

Additional context

@NGeb1 NGeb1 changed the title Nominatim 4.4.0 in Docker suddenly fails replication (after many successful replications) with error Nominatim 4.4.0 in Docker suddenly fails replication (after many successful replications) with error "psycopg2.errors.NumericValueOutOfRange: value "11111111111111111111" is out of range for type integer CONTEXT: PL/pgSQL function osmline_update() line 59 at FOR over SELECT rows" Aug 27, 2024
@mtmail
Copy link
Collaborator

mtmail commented Aug 27, 2024

The previous malicious comment is deleted now. Never download anything from a random user.

@osm-search osm-search deleted a comment from FabrizioValenti Aug 27, 2024
@osm-search osm-search deleted a comment Aug 27, 2024
@mtmail
Copy link
Collaborator

mtmail commented Aug 27, 2024

@NGeb1 That long number is a house number. The issue was fixed in #3520 and is part of version 4.4.1 https://github.com/osm-search/Nominatim/releases/tag/v4.4.1

@mtmail mtmail changed the title Nominatim 4.4.0 in Docker suddenly fails replication (after many successful replications) with error "psycopg2.errors.NumericValueOutOfRange: value "11111111111111111111" is out of range for type integer CONTEXT: PL/pgSQL function osmline_update() line 59 at FOR over SELECT rows" NumericValueOutOfRange: value "11111111111111111111" is out of range Aug 27, 2024
@lonvia lonvia closed this as completed Aug 27, 2024
@james-astra
Copy link

Is there an easy way to skip over this problematic address so that I can continue to keep up to date whilst I look into upgrading to 4.4.1? I am currently on 4.3.1

@mtmail
Copy link
Collaborator

mtmail commented Aug 27, 2024

I think it's possible to patch Nominatim 4.3. Looking at https://github.com/osm-search/Nominatim/blob/4.3.x/lib-sql/functions/interpolation.sql#L154 the relevant lines haven't changed in Nominatim 4.4.0. So the patch in https://github.com/osm-search/Nominatim/pull/3520/files should work.

In your database you can use \sf osmline_update to display the PGSQL code. It starts with CREATE OR REPLACE FUNCTION so executing the same code again (or rather the code you fixed) will update it and be immediately active.

A cleaner way is to edit the file (interpolation.sql) in your filesystem and execute nominatim refresh --functions, then verify with \sf osmline_update if it's live in the database.

@james-astra
Copy link

Great. Thanks a lot!
In the middle of migrating to 4.4.1 right now as it doesn't look to hard but if it all goes pear-shaped I'll fallback and patch it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants