osm2pgsql-dev / osm2pgsql

OpenStreetMap data to PostgreSQL converter
https://osm2pgsql.org
GNU General Public License v2.0
1.48k stars 473 forks source link

Replication breakage #2195

Closed joto closed 2 months ago

joto commented 3 months ago

What version of osm2pgsql are you using?

master

What operating system and PostgreSQL/PostGIS version are you using?

Debian stable

What did you do exactly?

Running osm2pgsql-replication update -d "$DB" in a loop.

What did you expect to happen?

Update works.

What did happen instead?

Ran fine for months then stopped with this:

2024-05-30 14:22:39 [WARNING]: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f91767a0850>: Failed to establish a new connection: [Errno 111] Connection refused')': /replication/minute//006/111/860.state.txt
2024-05-30 14:22:40 [WARNING]: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f917679a810>: Failed to establish a new connection: [Errno 111] Connection refused')': /replication/minute//006/111/860.state.txt
2024-05-30 14:22:42 [WARNING]: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f91767b4910>: Failed to establish a new connection: [Errno 111] Connection refused')': /replication/minute//006/111/860.state.txt
Traceback (most recent call last):
  File "/home/sqrt/bin/osm2pgsql-replication", line 724, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/sqrt/bin/osm2pgsql-replication", line 716, in main
    return args.handler(props, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sqrt/bin/osm2pgsql-replication", line 563, in update
    props.write_replication_state(base_url, seq, nextstate.timestamp if nextstate else None)
  File "/home/sqrt/bin/osm2pgsql-replication", line 211, in write_replication_state
    self._set_prop('replication_timestamp', osm_date(date))
                                            ^^^^^^^^^^^^^^
  File "/home/sqrt/bin/osm2pgsql-replication", line 81, in osm_date
    return date.strftime('%Y-%m-%dT%H:%M:%SZ')
           ^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'strftime'