postgresqldockerdocker-composepostgresql-14

invalid length of startup packet docker postgressql


PostgreSQL init process complete; ready for start up.

2022-05-16 19:28:51.674 UTC [1] LOG:  starting PostgreSQL 14.2 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20211027) 10.3.1 20211027, 64-bit
2022-05-16 19:28:51.674 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2022-05-16 19:28:51.674 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2022-05-16 19:28:51.677 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-05-16 19:28:51.681 UTC [51] LOG:  database system was shut down at 2022-05-16 19:28:51 UTC
2022-05-16 19:28:51.684 UTC [1] LOG:  database system is ready to accept connections
2022-05-16 19:29:07.610 UTC [59] LOG:  invalid length of startup packet
2022-05-16 19:29:07.611 UTC [58] LOG:  invalid length of startup packet
2022-05-16 19:29:07.612 UTC [60] LOG:  invalid length of startup packet
2022-05-16 19:29:08.647 UTC [62] LOG:  invalid length of startup packet
2022-05-16 19:29:08.650 UTC [61] LOG:  invalid length of startup packet
2022-05-16 19:29:08.652 UTC [63] LOG:  invalid length of startup packet

Any help would be appreciated I couldn't figure out

Docker composer file

version: '3.9'

services:
  postgres:
    image: postgres:14-alpine
    ports:
      - 5432:5432
    volumes:
      - ~/apps/postgres:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=S3cret
      - POSTGRES_USER=citizix_user
      - POSTGRES_DB=citizix_db

Using ubuntu 20.4


Solution

  • Try these fixes:

    1. Update docker and restart it
    2. Reduce the name length of the sql file that you are providing to /docker-entrypoint-initdb.d in volumes