There are a couple things to check..
1. Issue "db2set -all" and see if DB2COMM=TCPIP is set. If not, you want to set it "db2set db2comm tcpip"
2. Make sure that your db2 instance is set to a port to communicate on - db2 "get dbm cfg" - the SVCENAME should be set to a port number. If it is set to a string like "db2c_db2inst1" confirm that string is in /etc/services and set to a port like 50051
3. Look in your error log after you try to connect and see if there is an error message reported with more details. The default location is in the instance home directory /sqllib/db2dump and the file is called db2diag.log
And as mentioned before, reboot the VM or the docker image, it may clear things up.
------------------------------
Michael Krafick
------------------------------
Original Message:
Sent: Thu July 04, 2019 07:20 AM
From: Mohammed Ashraf
Subject: DB2 Connection Error
I have DB2 V11.5 ubuntu V16.04 when I try to connect to Database it gives an error fail to connect so I tried to update the instance with db2iupdt command a new error rises "DBI20127E The command failed because it is not supported or is invalid. "
------------------------------
Mohammed Ashraf
------------------------------
#Db2