Using latest psycopg2 (2.6.2) I cannot connect to a dockerized postgres database. I am getting
psycopg2.OperationalError: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
on psycopg2.connect.
I made sure my credentials and the rest of the configuration is correct. I can successfully connect with a psql command:
psql -U postgres -h 127.0.0.1 postgres
psql (9.5.4, server 9.5.3)
Type "help" for help.
postgres=#
The port is, obviously, open, too:
tcp6 0 0 :::5432 :::* LISTEN
telnet 127.0.0.1 5432
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
^CConnection closed by foreign host.
Usage:
psycopg2.connect(database='postgres',
user='postgres',
host='127.0.0.1',
sslmode='disable')
The docker is started with:
docker pull postgres
docker run -d -p 5432:5432 postgres
Other specs:
cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.1 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.1 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
UBUNTU_CODENAME=xenial
python3 --version
Python 3.5.2
python --version
Python 2.7.12
dpkg -l | grep docker
ii docker.io 1.11.2-0ubuntu5~16.04 amd64
uname -r
4.4.0-31-generic
A detailed debug log is here:
[13071] initpsycopg: initializing psycopg 2.6.2 (dt dec pq3 ext lo64)
[13071] psyco_adapter_datetime_init: datetime init
[13071] typecast_init: initializing NUMBER
[13071] typecast_new: new type at = 0x7f90e553a2c8, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a2c8
[13071] typecast_add: object at 0x7f90e553a2c8, values refcnt = 1
[13071] typecast_add: adding val: 20
[13071] typecast_add: adding val: 23
[13071] typecast_add: adding val: 21
[13071] typecast_add: adding val: 701
[13071] typecast_add: adding val: 700
[13071] typecast_add: adding val: 1700
[13071] typecast_add: base caster: (nil)
[13071] typecast_init: initializing LONGINTEGER
[13071] typecast_new: new type at = 0x7f90e553a318, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a318
[13071] typecast_add: object at 0x7f90e553a318, values refcnt = 1
[13071] typecast_add: adding val: 20
[13071] typecast_add: base caster: (nil)
[13071] typecast_init: initializing INTEGER
[13071] typecast_new: new type at = 0x7f90e553a368, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a368
[13071] typecast_add: object at 0x7f90e553a368, values refcnt = 1
[13071] typecast_add: adding val: 23
[13071] typecast_add: adding val: 21
[13071] typecast_add: base caster: (nil)
[13071] typecast_init: initializing FLOAT
[13071] typecast_new: new type at = 0x7f90e553a3b8, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a3b8
[13071] typecast_add: object at 0x7f90e553a3b8, values refcnt = 1
[13071] typecast_add: adding val: 701
[13071] typecast_add: adding val: 700
[13071] typecast_add: base caster: (nil)
[13071] typecast_init: initializing DECIMAL
[13071] typecast_new: new type at = 0x7f90e553a408, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a408
[13071] typecast_add: object at 0x7f90e553a408, values refcnt = 1
[13071] typecast_add: adding val: 1700
[13071] typecast_add: base caster: (nil)
[13071] typecast_init: initializing UNICODE
[13071] typecast_new: new type at = 0x7f90e553a458, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a458
[13071] typecast_add: object at 0x7f90e553a458, values refcnt = 1
[13071] typecast_add: adding val: 19
[13071] typecast_add: adding val: 18
[13071] typecast_add: adding val: 25
[13071] typecast_add: adding val: 1042
[13071] typecast_add: adding val: 1043
[13071] typecast_add: base caster: (nil)
[13071] typecast_init: initializing STRING
[13071] typecast_new: new type at = 0x7f90e553a4a8, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a4a8
[13071] typecast_add: object at 0x7f90e553a4a8, values refcnt = 1
[13071] typecast_add: adding val: 19
[13071] typecast_add: adding val: 18
[13071] typecast_add: adding val: 25
[13071] typecast_add: adding val: 1042
[13071] typecast_add: adding val: 1043
[13071] typecast_add: base caster: (nil)
[13071] typecast_init: initializing BOOLEAN
[13071] typecast_new: new type at = 0x7f90e553a4f8, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a4f8
[13071] typecast_add: object at 0x7f90e553a4f8, values refcnt = 1
[13071] typecast_add: adding val: 16
[13071] typecast_add: base caster: (nil)
[13071] typecast_init: initializing DATETIME
[13071] typecast_new: new type at = 0x7f90e553a548, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a548
[13071] typecast_add: object at 0x7f90e553a548, values refcnt = 1
[13071] typecast_add: adding val: 1114
[13071] typecast_add: adding val: 1184
[13071] typecast_add: adding val: 704
[13071] typecast_add: adding val: 1186
[13071] typecast_add: base caster: (nil)
[13071] typecast_init: initializing TIME
[13071] typecast_new: new type at = 0x7f90e553a598, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a598
[13071] typecast_add: object at 0x7f90e553a598, values refcnt = 1
[13071] typecast_add: adding val: 1083
[13071] typecast_add: adding val: 1266
[13071] typecast_add: base caster: (nil)
[13071] typecast_init: initializing DATE
[13071] typecast_new: new type at = 0x7f90e553a5e8, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a5e8
[13071] typecast_add: object at 0x7f90e553a5e8, values refcnt = 1
[13071] typecast_add: adding val: 1082
[13071] typecast_add: base caster: (nil)
[13071] typecast_init: initializing INTERVAL
[13071] typecast_new: new type at = 0x7f90e553a638, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a638
[13071] typecast_add: object at 0x7f90e553a638, values refcnt = 1
[13071] typecast_add: adding val: 704
[13071] typecast_add: adding val: 1186
[13071] typecast_add: base caster: (nil)
[13071] typecast_init: initializing BINARY
[13071] typecast_new: new type at = 0x7f90e553a688, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a688
[13071] typecast_add: object at 0x7f90e553a688, values refcnt = 1
[13071] typecast_add: adding val: 17
[13071] typecast_add: base caster: (nil)
[13071] typecast_init: initializing ROWID
[13071] typecast_new: new type at = 0x7f90e553a6d8, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a6d8
[13071] typecast_add: object at 0x7f90e553a6d8, values refcnt = 1
[13071] typecast_add: adding val: 26
[13071] typecast_add: base caster: (nil)
[13071] typecast_init: initializing LONGINTEGERARRAY
[13071] typecast_new: new type at = 0x7f90e553a728, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a728
[13071] typecast_add: object at 0x7f90e553a728, values refcnt = 1
[13071] typecast_add: adding val: 1016
[13071] typecast_add: base caster: 0x7f90e553a318
[13071] typecast_init: initializing INTEGERARRAY
[13071] typecast_new: new type at = 0x7f90e553a778, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a778
[13071] typecast_add: object at 0x7f90e553a778, values refcnt = 1
[13071] typecast_add: adding val: 1005
[13071] typecast_add: adding val: 1006
[13071] typecast_add: adding val: 1007
[13071] typecast_add: base caster: 0x7f90e553a368
[13071] typecast_init: initializing FLOATARRAY
[13071] typecast_new: new type at = 0x7f90e553a7c8, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a7c8
[13071] typecast_add: object at 0x7f90e553a7c8, values refcnt = 1
[13071] typecast_add: adding val: 1017
[13071] typecast_add: adding val: 1021
[13071] typecast_add: adding val: 1022
[13071] typecast_add: base caster: 0x7f90e553a3b8
[13071] typecast_init: initializing DECIMALARRAY
[13071] typecast_new: new type at = 0x7f90e553a818, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a818
[13071] typecast_add: object at 0x7f90e553a818, values refcnt = 1
[13071] typecast_add: adding val: 1231
[13071] typecast_add: base caster: 0x7f90e553a408
[13071] typecast_init: initializing UNICODEARRAY
[13071] typecast_new: new type at = 0x7f90e553a868, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a868
[13071] typecast_add: object at 0x7f90e553a868, values refcnt = 1
[13071] typecast_add: adding val: 1002
[13071] typecast_add: adding val: 1003
[13071] typecast_add: adding val: 1009
[13071] typecast_add: adding val: 1014
[13071] typecast_add: adding val: 1015
[13071] typecast_add: base caster: 0x7f90e553a458
[13071] typecast_init: initializing STRINGARRAY
[13071] typecast_new: new type at = 0x7f90e553a8b8, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a8b8
[13071] typecast_add: object at 0x7f90e553a8b8, values refcnt = 1
[13071] typecast_add: adding val: 1002
[13071] typecast_add: adding val: 1003
[13071] typecast_add: adding val: 1009
[13071] typecast_add: adding val: 1014
[13071] typecast_add: adding val: 1015
[13071] typecast_add: base caster: 0x7f90e553a4a8
[13071] typecast_init: initializing BOOLEANARRAY
[13071] typecast_new: new type at = 0x7f90e553a908, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a908
[13071] typecast_add: object at 0x7f90e553a908, values refcnt = 1
[13071] typecast_add: adding val: 1000
[13071] typecast_add: base caster: 0x7f90e553a4f8
[13071] typecast_init: initializing DATETIMEARRAY
[13071] typecast_new: new type at = 0x7f90e553a958, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a958
[13071] typecast_add: object at 0x7f90e553a958, values refcnt = 1
[13071] typecast_add: adding val: 1115
[13071] typecast_add: adding val: 1185
[13071] typecast_add: base caster: 0x7f90e553a548
[13071] typecast_init: initializing TIMEARRAY
[13071] typecast_new: new type at = 0x7f90e553a9a8, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a9a8
[13071] typecast_add: object at 0x7f90e553a9a8, values refcnt = 1
[13071] typecast_add: adding val: 1183
[13071] typecast_add: adding val: 1270
[13071] typecast_add: base caster: 0x7f90e553a598
[13071] typecast_init: initializing DATEARRAY
[13071] typecast_new: new type at = 0x7f90e553a9f8, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553a9f8
[13071] typecast_add: object at 0x7f90e553a9f8, values refcnt = 1
[13071] typecast_add: adding val: 1182
[13071] typecast_add: base caster: 0x7f90e553a5e8
[13071] typecast_init: initializing INTERVALARRAY
[13071] typecast_new: new type at = 0x7f90e553aa48, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553aa48
[13071] typecast_add: object at 0x7f90e553aa48, values refcnt = 1
[13071] typecast_add: adding val: 1187
[13071] typecast_add: base caster: 0x7f90e553a638
[13071] typecast_init: initializing BINARYARRAY
[13071] typecast_new: new type at = 0x7f90e553aa98, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553aa98
[13071] typecast_add: object at 0x7f90e553aa98, values refcnt = 1
[13071] typecast_add: adding val: 1001
[13071] typecast_add: base caster: 0x7f90e553a688
[13071] typecast_init: initializing ROWIDARRAY
[13071] typecast_new: new type at = 0x7f90e553aae8, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553aae8
[13071] typecast_add: object at 0x7f90e553aae8, values refcnt = 1
[13071] typecast_add: adding val: 1028
[13071] typecast_add: adding val: 1013
[13071] typecast_add: base caster: 0x7f90e553a6d8
[13071] typecast_init: initializing UNKNOWN
[13071] typecast_new: new type at = 0x7f90e553ab38, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553ab38
[13071] typecast_add: object at 0x7f90e553ab38, values refcnt = 1
[13071] typecast_add: adding val: 705
[13071] typecast_add: base caster: (nil)
[13071] typecast_new: new type at = 0x7f90e553ab88, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553ab88
[13071] psyco_typecast_datetime_init: datetime init
[13071] typecast_init: initializing PYDATETIME
[13071] typecast_new: new type at = 0x7f90e553abd8, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553abd8
[13071] typecast_init: initializing PYTIME
[13071] typecast_new: new type at = 0x7f90e553ac28, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553ac28
[13071] typecast_init: initializing PYDATE
[13071] typecast_new: new type at = 0x7f90e553ac78, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553ac78
[13071] typecast_init: initializing PYINTERVAL
[13071] typecast_new: new type at = 0x7f90e553acc8, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553acc8
[13071] typecast_init: initializing PYDATETIMEARRAY
[13071] typecast_new: new type at = 0x7f90e553ad18, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553ad18
[13071] typecast_init: initializing PYTIMEARRAY
[13071] typecast_new: new type at = 0x7f90e553ad68, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553ad68
[13071] typecast_init: initializing PYDATEARRAY
[13071] typecast_new: new type at = 0x7f90e553adb8, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553adb8
[13071] typecast_init: initializing PYINTERVALARRAY
[13071] typecast_new: new type at = 0x7f90e553ae08, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e553ae08
[13071] microprotocols_add: cast 0x7f90ea5e6260 for (float, ?)
[13071] microprotocols_add: cast 0x7f90ea5e6000 for (int, ?)
[13071] microprotocols_add: cast 0x7f90ea5e5b40 for (bool, ?)
[13071] microprotocols_add: cast 0x7f90ea5e64c0 for (str, ?)
[13071] microprotocols_add: cast 0x7f90ea5e53a0 for (bytes, ?)
[13071] microprotocols_add: cast 0x7f90ea5e53a0 for (bytearray, ?)
[13071] microprotocols_add: cast 0x7f90ea5e53a0 for (memoryview, ?)
[13071] microprotocols_add: cast 0x7f90ea5e58c0 for (list, ?)
[13071] microprotocols_add: cast 0x7f90e5533240 for (datetime.date, ?)
[13071] microprotocols_add: cast 0x7f90e5533288 for (datetime.time, ?)
[13071] microprotocols_add: cast 0x7f90e55332d0 for (datetime.datetime, ?)
[13071] microprotocols_add: cast 0x7f90e5533318 for (datetime.timedelta, ?)
[13071] initpsycopg: module initialization complete
[13071] typecast_new: new type at = 0x7f90e5538cc8, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e5538cc8
[13071] typecast_new: new type at = 0x7f90e5542048, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e5542048
[13071] typecast_add: object at 0x7f90e5538cc8, values refcnt = 1
[13071] typecast_add: adding val: 114
[13071] typecast_add: base caster: (nil)
[13071] typecast_add: object at 0x7f90e5542048, values refcnt = 1
[13071] typecast_add: adding val: 199
[13071] typecast_add: base caster: 0x7f90e5538cc8
[13071] typecast_new: new type at = 0x7f90e5542098, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e5542098
[13071] typecast_new: new type at = 0x7f90e55426d8, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e55426d8
[13071] typecast_add: object at 0x7f90e5542098, values refcnt = 1
[13071] typecast_add: adding val: 3802
[13071] typecast_add: base caster: (nil)
[13071] typecast_add: object at 0x7f90e55426d8, values refcnt = 1
[13071] typecast_add: adding val: 3807
[13071] typecast_add: base caster: 0x7f90e5542098
[13071] typecast_new: new type at = 0x7f90e554f318, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e554f318
[13071] typecast_new: new type at = 0x7f90e554f368, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e554f368
[13071] typecast_add: object at 0x7f90e554f318, values refcnt = 1
[13071] typecast_add: adding val: 3904
[13071] typecast_add: base caster: (nil)
[13071] typecast_add: object at 0x7f90e554f368, values refcnt = 1
[13071] typecast_add: adding val: 3905
[13071] typecast_add: base caster: 0x7f90e554f318
[13071] typecast_new: new type at = 0x7f90e554f3b8, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e554f3b8
[13071] typecast_new: new type at = 0x7f90e554f408, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e554f408
[13071] typecast_add: object at 0x7f90e554f3b8, values refcnt = 1
[13071] typecast_add: adding val: 3926
[13071] typecast_add: base caster: (nil)
[13071] typecast_add: object at 0x7f90e554f408, values refcnt = 1
[13071] typecast_add: adding val: 3927
[13071] typecast_add: base caster: 0x7f90e554f3b8
[13071] typecast_new: new type at = 0x7f90e554f458, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e554f458
[13071] typecast_new: new type at = 0x7f90e554f4a8, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e554f4a8
[13071] typecast_add: object at 0x7f90e554f458, values refcnt = 1
[13071] typecast_add: adding val: 3906
[13071] typecast_add: base caster: (nil)
[13071] typecast_add: object at 0x7f90e554f4a8, values refcnt = 1
[13071] typecast_add: adding val: 3907
[13071] typecast_add: base caster: 0x7f90e554f458
[13071] typecast_new: new type at = 0x7f90e554f548, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e554f548
[13071] typecast_new: new type at = 0x7f90e554f598, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e554f598
[13071] typecast_add: object at 0x7f90e554f548, values refcnt = 1
[13071] typecast_add: adding val: 3912
[13071] typecast_add: base caster: (nil)
[13071] typecast_add: object at 0x7f90e554f598, values refcnt = 1
[13071] typecast_add: adding val: 3913
[13071] typecast_add: base caster: 0x7f90e554f548
[13071] typecast_new: new type at = 0x7f90e554f638, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e554f638
[13071] typecast_new: new type at = 0x7f90e554f688, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e554f688
[13071] typecast_add: object at 0x7f90e554f638, values refcnt = 1
[13071] typecast_add: adding val: 3908
[13071] typecast_add: base caster: (nil)
[13071] typecast_add: object at 0x7f90e554f688, values refcnt = 1
[13071] typecast_add: adding val: 3909
[13071] typecast_add: base caster: 0x7f90e554f638
[13071] typecast_new: new type at = 0x7f90e554f728, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e554f728
[13071] typecast_new: new type at = 0x7f90e554f778, refcnt = 1
[13071] typecast_new: typecast object created at 0x7f90e554f778
[13071] typecast_add: object at 0x7f90e554f728, values refcnt = 1
[13071] typecast_add: adding val: 3910
[13071] typecast_add: base caster: (nil)
[13071] typecast_add: object at 0x7f90e554f778, values refcnt = 1
[13071] typecast_add: adding val: 3911
[13071] typecast_add: base caster: 0x7f90e554f728
[13071] psyco_connect: dsn = 'dbname=postgres user=postgres host=127.0.0.1 sslmode=disable', async = 0
[13071] connection_setup: init connection object at 0x7f90e39dc378, async 0, refcnt = 1
[13071] con_connect: connecting in SYNC mode
[13071] conn_connect: new postgresql connection at 0x274ab00
[13071] conn_connect: PQconnectdb(dbname=postgres user=postgres host=127.0.0.1 sslmode=disable) returned BAD
[13071] connection_init: FAILED
[13071] conn_close: PQfinish called
[13071] connection_dealloc: deleted connection object at 0x7f90e39dc378, refcnt = 0
Traceback (most recent call last):
File "./application.py", line 130, in <module>
sslmode='disable')
File "/home/user/env/lib/python3.5/site-packages/psycopg2-2.6.2-py3.5-linux-x86_64.egg/psycopg2/__init__.py", line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
psycopg2.OperationalError: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
What's interesting, based on a tcpdump, it seems like the client first connects to 127.0.0.1 and then sends another SYN (for new connection) via device docker0, 172.17.0.1, and that's where the server sends a connection RESET. Details below:
tcpdump: listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
13:35:18.765868 IP (tos 0x0, ttl 64, id 51265, offset 0, flags [DF], proto TCP (6), length 60)
localhost.37950 > localhost.postgresql: Flags [S], cksum 0xfe30 (incorrect -> 0x1c00), seq 3876426159, win 43690, options [mss 65495,sackOK,TS val 218978798 ecr 0,nop,wscale 7], length 0
0x0000: 4500 003c c841 4000 4006 7478 7f00 0001 E..<.A@[email protected]....
0x0010: 7f00 0001 943e 1538 e70d 91af 0000 0000 .....>.8........
0x0020: a002 aaaa fe30 0000 0204 ffd7 0402 080a .....0..........
0x0030: 0d0d 59ee 0000 0000 0103 0307 ..Y.........
13:35:18.765940 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 60)
localhost.postgresql > localhost.37950: Flags [S.], cksum 0xfe30 (incorrect -> 0x43e1), seq 2737884640, ack 3876426160, win 43690, options [mss 65495,sackOK,TS val 218978799 ecr 218978798,nop,wscale 7], length 0
0x0000: 4500 003c 0000 4000 4006 3cba 7f00 0001 E..<..@.@.<.....
0x0010: 7f00 0001 1538 943e a330 cde0 e70d 91b0 .....8.>.0......
0x0020: a012 aaaa fe30 0000 0204 ffd7 0402 080a .....0..........
0x0030: 0d0d 59ef 0d0d 59ee 0103 0307 ..Y...Y.....
13:35:18.765972 IP (tos 0x0, ttl 64, id 51266, offset 0, flags [DF], proto TCP (6), length 52)
localhost.37950 > localhost.postgresql: Flags [.], cksum 0xfe28 (incorrect -> 0x1625), seq 1, ack 1, win 342, options [nop,nop,TS val 218978799 ecr 218978799], length 0
0x0000: 4500 0034 c842 4000 4006 747f 7f00 0001 E..4.B@[email protected].....
0x0010: 7f00 0001 943e 1538 e70d 91b0 a330 cde1 .....>.8.....0..
0x0020: 8010 0156 fe28 0000 0101 080a 0d0d 59ef ...V.(........Y.
0x0030: 0d0d 59ef ..Y.
13:35:18.767471 IP (tos 0x0, ttl 64, id 39934, offset 0, flags [DF], proto TCP (6), length 60)
172.17.0.1.35650 > 172.17.0.2.postgresql: Flags [S], cksum 0x5854 (incorrect -> 0x72f5), seq 1095549457, win 29200, options [mss 1460,sackOK,TS val 218978799 ecr 0,nop,wscale 7], length 0
0x0000: 4500 003c 9bfe 4000 4006 4698 ac11 0001 E..<..@[email protected].....
0x0010: ac11 0002 8b42 1538 414c c211 0000 0000 .....B.8AL......
0x0020: a002 7210 5854 0000 0204 05b4 0402 080a ..r.XT..........
0x0030: 0d0d 59ef 0000 0000 0103 0307 ..Y.........
13:35:18.767481 IP (tos 0x0, ttl 64, id 51267, offset 0, flags [DF], proto TCP (6), length 93)
localhost.37950 > localhost.postgresql: Flags [P.], cksum 0xfe51 (incorrect -> 0xf8f6), seq 1:42, ack 1, win 342, options [nop,nop,TS val 218978799 ecr 218978799], length 41
0x0000: 4500 005d c843 4000 4006 7455 7f00 0001 E..].C@[email protected]....
0x0010: 7f00 0001 943e 1538 e70d 91b0 a330 cde1 .....>.8.....0..
0x0020: 8018 0156 fe51 0000 0101 080a 0d0d 59ef ...V.Q........Y.
0x0030: 0d0d 59ef 0000 0029 0003 0000 7573 6572 ..Y....)....user
0x0040: 0070 6f73 7467 7265 7300 6461 7461 6261 .postgres.databa
0x0050: 7365 0070 6f73 7467 7265 7300 00 se.postgres..
13:35:18.767494 IP (tos 0x0, ttl 64, id 39934, offset 0, flags [DF], proto TCP (6), length 60)
172.17.0.1.35650 > 172.17.0.2.postgresql: Flags [S], cksum 0x5854 (incorrect -> 0x72f5), seq 1095549457, win 29200, options [mss 1460,sackOK,TS val 218978799 ecr 0,nop,wscale 7], length 0
0x0000: 4500 003c 9bfe 4000 4006 4698 ac11 0001 E..<..@[email protected].....
0x0010: ac11 0002 8b42 1538 414c c211 0000 0000 .....B.8AL......
0x0020: a002 7210 5854 0000 0204 05b4 0402 080a ..r.XT..........
0x0030: 0d0d 59ef 0000 0000 0103 0307 ..Y.........
13:35:18.767500 IP (tos 0x0, ttl 64, id 37902, offset 0, flags [DF], proto TCP (6), length 52)
localhost.postgresql > localhost.37950: Flags [.], cksum 0xfe28 (incorrect -> 0x15fc), seq 1, ack 42, win 342, options [nop,nop,TS val 218978799 ecr 218978799], length 0
0x0000: 4500 0034 940e 4000 4006 a8b3 7f00 0001 E..4..@.@.......
0x0010: 7f00 0001 1538 943e a330 cde1 e70d 91d9 .....8.>.0......
0x0020: 8010 0156 fe28 0000 0101 080a 0d0d 59ef ...V.(........Y.
0x0030: 0d0d 59ef ..Y.
13:35:18.767590 IP (tos 0x0, ttl 64, id 2139, offset 0, flags [DF], proto TCP (6), length 40)
172.17.0.2.postgresql > 172.17.0.1.35650: Flags [R.], cksum 0xb3d1 (correct), seq 0, ack 1095549458, win 0, length 0
0x0000: 4500 0028 085b 4000 4006 da4f ac11 0002 E..(.[@[email protected]....
0x0010: ac11 0001 1538 8b42 0000 0000 414c c212 .....8.B....AL..
0x0020: 5014 0000 b3d1 0000 P.......
The problem was in a docker command. It's supposed to be ran with:
docker run -d -p 5432:5432 postgres postgres -h 0.0.0.0
How make this in docker composer?
Most helpful comment
The problem was in a docker command. It's supposed to be ran with: