PostgreSQL invalid IP mask


This post originally appeared on the Annexe.

Getting the following error when trying to start Postgres:

UTC LOG:  invalid IP mask "md5": Name or service not known

Turns out, it’s because I forgot to define the subnet mask for the allowed IP, which meant the security setting was being interpreted. Weird behavior, I would have expected it to search after a backslash.

An example for pg_hba.conf:

host replication postgres md5

And an example of my bad one:

host replication postgres md5

Author bio and support


Ruben Schade is a technical writer and infrastructure architect in Sydney, Australia who refers to himself in the third person in bios. Hi!

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite bespoke cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or send a comment. Thanks ☺️.