Search code examples
dockerdockerfiledb2containersdb2-luw

Docker/DB2 - Released lock on the file /database/config/db2inst1/sqllib/ctrl/db2strst.lck - how to fix this?


I try to run the ibmcom/db2 image from ther Docker hub and it's not working..

When I do the docker run docker run --name mydb2 --privileged=true -p 50000:50000 -e LICENSE=accept -e DB2INST1_PASSWORD=test -e DBNAME=testdb ibmcom/db2 it is not working.

I get the follow error at the end of the db2start :

2023-02-09-18.58.37.677287+000 I307847E393           LEVEL: Warning
PID     : 25258                TID : 139812728498048 PROC : db2start
INSTANCE: db2inst1             NODE : 000
HOSTNAME: 4cf8a32d373a
FUNCTION: DB2 UDB, base sys utilities, sqleReleaseStStLockFile, probe:16242
MESSAGE : Released lock on the file:
DATA #1 : String, 50 bytes
/database/config/db2inst1/sqllib/ctrl/db2strst.lck

Can someone help me please ?

I've tried to remove the file, to connect in the container and do this command suggested in another page :

sudo chown db2inst1 /database/config/db2inst1/sqllib/adm/*

But I get the following error :

chown: cannot dereference '/database/config/db2inst1/sqllib/adm/ITLMready.properties': No such file or directory

-- EDIT -- I've inspected the db2diag.log and i've those 2 errors :

2023-02-09-20.46.55.817407+000 I232915E544           LEVEL: Error (OS)
PID     : 21597                TID : 139979254654720 PROC : db2wdog 0 [db2inst1]
INSTANCE: db2inst1             NODE : 000
HOSTNAME: db3d3429ea6b
EDUID   : 2                    EDUNAME: db2wdog 0 [db2inst1]
FUNCTION: DB2 UDB, oper system services, sqloSetPriorityHdl, probe:6156
MESSAGE : ZRC=0x83000001=-2097151999
          
CALLED  : OS, -, sched_setscheduler               OSERR: EPERM (1)
DATA #1 : String, 51 bytes
Failure setting absolute priority of kernel thread.

2023-02-09-20.46.55.819889+000 I233460E544           LEVEL: Error (OS)
PID     : 21597                TID : 139979254654720 PROC : db2wdog 0 [db2inst1]
INSTANCE: db2inst1             NODE : 000
HOSTNAME: db3d3429ea6b
EDUID   : 2                    EDUNAME: db2wdog 0 [db2inst1]
FUNCTION: DB2 UDB, oper system services, sqloSetPriorityHdl, probe:6156
MESSAGE : ZRC=0x83000001=-2097151999

Nothing works :(


Solution

  • We found the solution !

    We had to copy, inside the image "ibmcom/db2", under "/database/config/", a file named "instance.cfg" with the following content to be able to run it :

    [database]
    port=50000
    [instance]
    name=db2inst1
    

    We still have the warning but now the connection to the database is successful.