It is trying to do a vacuum freeze. Do you have autovacuum turned off? Any settings changed from default related to autovacuum?
https://www.postgresql.org/docs/9.6/routine-vacuuming.html Read 24.1.5. Preventing Transaction ID Wraparound Failures These may also be of help- https://info.crunchydata.com/blog/managing-transaction-id-wraparound-in-postgresql https://www.2ndquadrant.com/en/blog/managing-freezing/ Note that you need to ensure the server gets caught up, or you risk being locked out to prevent data corruption.