Db2

Db2

Connect with Db2, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
Expand all | Collapse all

Problem with calling Docker DB2 user defined function.

  • 1.  Problem with calling Docker DB2 user defined function.

    Posted Wed October 22, 2025 10:23 AM

    Hello,

    I have problem with calling user defined function.

    The function is custom defined and the function calls Java function from installed JAR.

    When running functions it says about fenced user.

    UPDATE EMPLOYER SET PESEL = ENCRYPT_STRING(PESEL);

    Response:

    SQL Error [     ]: A routine failed because the fenced user ID cannot access required files in the sqllib directory or other instance or database directories.. SQLCODE=-1646, SQLSTATE=     , DRIVER=4.35.11

    i checked and jars are somewhere  in database/…/sqllib directory.

    Is it permission problem ? If so what to change?

    I am using Mac OS on Apple M1 chip and DB2 goes in Docker image - 12.1.



    ------------------------------
    Mariusz Lewandowski
    ------------------------------


  • 2.  RE: Problem with calling Docker DB2 user defined function.

    Posted Thu October 23, 2025 02:54 AM

    Hello,

    What's the result of the following query?

    SELECT IMPLEMENTATION
    FROM SYSCAT.ROUTINES
    WHERE ROUTINESCHEMA NOT LIKE 'SYS%' AND ROUTINENAME = 'ENCRYPT_STRING' AND ORIGIN = 'E'



    ------------------------------
    Mark Barinstein
    ------------------------------



  • 3.  RE: Problem with calling Docker DB2 user defined function.

    Posted Sat November 01, 2025 09:36 AM

    Hi @Mark Barinstein,

    Your query returns value in IMPLEMENTATION:

    encryptStringDeterministic(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;



    ------------------------------
    Mariusz Lewandowski
    ------------------------------



  • 4.  RE: Problem with calling Docker DB2 user defined function.

    Posted Sun November 02, 2025 04:01 AM

    It's an external JAVA function, and you must find the jar/class file (probably with the CLASS, JAR_ID, JARSCHEMA columns of the same query above).

    Once you find this file in the `~db2inst1/sqllib/function` directory (or in some its subdirectories), make sure that this file is readable by the `db2fenc1` user.



    ------------------------------
    Mark Barinstein
    ------------------------------



  • 5.  RE: Problem with calling Docker DB2 user defined function.

    Posted Sun November 02, 2025 10:26 AM
    Edited by Mariusz Lewandowski Sun November 02, 2025 10:26 AM

    Hi @Mark Barinstein,

    Thanks for answer.

    I found the jar files in sqllib/function/jars and changes their ownership to:

     db2fenc1:db2fadm1 (also tried group db2adm1)

    but it didn't help.

    I suspect this problem might be related to the issue of Docker image where I had to invoke this:

    chown root:db2iadm1 /database/config/<user>/sqllib/adm/fencedid

    I also tried with chmod +x for JAR files but also didn't help. Restarting Docker container wasn't helpful as well.



    ------------------------------
    Mariusz Lewandowski
    ------------------------------



  • 6.  RE: Problem with calling Docker DB2 user defined function.

    Posted Sun November 02, 2025 02:57 PM

    What's the jar or class file supporting namely this function?

    What's the exact CREATE FUNCTION statement?

    Can you show the return code of the following command namely for this particular jar or class file *inside the container*?

    sudo -u db2fenc1 test -r ~db2inst1/sqllib/function/<path/to/jar_or_class_file>



    ------------------------------
    Mark Barinstein
    ------------------------------



  • 7.  RE: Problem with calling Docker DB2 user defined function.

    Posted Sun November 02, 2025 11:20 PM

    Hi,

    Create function:

    CREATE FUNCTION ENCRYPT_STRING_NON_DETERMINISTIC(VARCHAR(128)) RETURNS VARCHAR(128) EXTERNAL NAME 'MY_SCHEMA.ENCRYPTIONJAR:com.company.encryptString' NO SQL PARAMETER STYLE java LANGUAGE java RETURNS NULL ON NULL INPUT NO EXTERNAL ACTION NOT DETERMINISTIC

    This command returned nothing:

    sh-5.1# sudo -u db2fenc1 test -r ~db2inst1/sqllib/function/jar/DB/SYSTEM/MS/ENCRYPTIONJAR.jar 
    sh-5.1# 

    What I have found:

    Error: Unable to initialize main class com.company.DatabaseCrypto
    Caused by: java.lang.UnsupportedClassVersionError: com/.../CryptoService has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 55.0

    I will change the version of JDK inside the container and will report back!



    ------------------------------
    Mariusz Lewandowski
    ------------------------------



  • 8.  RE: Problem with calling Docker DB2 user defined function.

    Posted Mon November 03, 2025 04:37 AM

    Updated the JDK to newer version but that also didn't help..



    ------------------------------
    Mariusz Lewandowski
    ------------------------------



  • 9.  RE: Problem with calling Docker DB2 user defined function.

    Posted Mon November 03, 2025 06:56 AM

    Did you Rebuild and Redeploy Docker DB2 Container after updating Docker Image to use JDK version 21 ?



    ------------------------------
    Madhusudan S M
    ------------------------------



  • 10.  RE: Problem with calling Docker DB2 user defined function.

    Posted Mon November 03, 2025 07:02 AM

    Yes, and the JAR file cannot be run right now from command line.

    But if I call the UDF from SQL Client it throws:

    SQL Error [     ]: A routine failed because the fenced user ID cannot access required files in the sqllib directory or other instance or database directories.. SQLCODE=-1646, SQLSTATE=     , DRIVER=4.35.11



    ------------------------------
    Mariusz Lewandowski
    ------------------------------



  • 11.  RE: Problem with calling Docker DB2 user defined function.

    Posted Mon November 03, 2025 07:25 AM

    What are the current os permissions on DB2 database-related files and directories, including the sqllib directory and the db2fmp executable file?



    ------------------------------
    Madhusudan S M
    ------------------------------



  • 12.  RE: Problem with calling Docker DB2 user defined function.

    Posted Mon November 03, 2025 07:37 AM

    Hi Madhusudan,

    4 drwxrwsr-t 23 db2inst1 db2iadm1 4096 Nov  3 09:09 sqllib

    sh-5.1# pwd

    /database/config/db2inst1/sqllib/function/jar/DB/SYSTEM/MS

       4 drwxrwxr-x 2 db2inst1 db2iadm1    4096 Nov  3 12:35 .
       4 drwxrwxr-x 6 db2inst1 db2iadm1    4096 Oct 18 09:51 ..
    4048 -rwxr-xr-x 1 db2inst1 db2iadm1 4144844 Oct 18 09:47 ENCRYPTIONJAR.jar

    Also tried with db2fenc1 user for jar but it doesn't give any effect.



    ------------------------------
    Mariusz Lewandowski
    ------------------------------



  • 13.  RE: Problem with calling Docker DB2 user defined function.

    Posted Mon November 03, 2025 11:12 AM

    According to ChatGPT - DB2 for Docker is stripped from some functionalities, e.g. FENCED.

    That's why when I queried:

    db2 get dbm cfg | grep -i FENCED
     Server Plugin Mode                    (SRV_PLUGIN_MODE) = UNFENCED
     Keep fenced process                        (KEEPFENCED) = YES
     Number of pooled fenced processes         (FENCED_POOL) = AUTOMATIC(MAX_COORDAGENTS)
     Initial number of fenced processes     (NUM_INITFENCED) = 0

    It didn't returned FENCED key with user. Also I cannot update DB2 configuration with pointing out the fenced username.

    Could it be right answer?



    ------------------------------
    Mariusz Lewandowski
    ------------------------------



  • 14.  RE: Problem with calling Docker DB2 user defined function.

    Posted Mon November 03, 2025 11:56 AM
    Edited by Florian Boldt Mon November 03, 2025 12:02 PM

    How did you create the container?

    # docker-compose.yml

    volumes: - db2_data:/database

     # or user-Mapping (UIDs/GIDs)

    user: "1000:1000" #  set UIDs 

    you can try to correct the ownership explicitly:

    chown -R db2inst1:db2iadm1 /home/db2inst1/sqllib

    chown -R db2fenc1:db2fadm1 /home/db2fenc1/sqllib

    chmod -R 755 /home/db2inst1/sqllib

    ------------------------------
    Florian Boldt




  • 15.  RE: Problem with calling Docker DB2 user defined function.

    Posted Mon November 03, 2025 01:02 PM

    Regarding container creation, here is the command:

    docker run -h db2server --name db2 --restart=always --detach --privileged=true -p 50000:50000 --env-file .env_list -v db_data:/database -v /Users/itml/Developer/liquibase/:/liquibase-db

    I will try with your suggestion about permissions.



    ------------------------------
    Mariusz Lewandowski
    ------------------------------



  • 16.  RE: Problem with calling Docker DB2 user defined function.

    Posted Mon November 03, 2025 01:37 PM

    Let's create a smoke test of UDF creation.

    Place the following files into some empty directory inside the container as db2inst1.

    make-all.sh


    PATH="${PATH}:${DB2_HOME}/java/jdk64/bin"
    JAR_FILE="my_jar.jar"
    JAR_ID="MY_SCHEMA.ENCRYPTIONJAR"
    CLASSES="classes"


    [ -d "${CLASSES}" ] || mkdir "${CLASSES}"
    javac -d "${CLASSES}" EncryptString.java
    jar -cvf "${JAR_FILE}" -C "${CLASSES}" .


    db2 connect to sample


    # One of these 2 must fail - it's expected
    db2 -v "call sqlj.install_jar('file:${PWD}/${JAR_FILE}', '${JAR_ID}')"
    db2 -v "call sqlj.replace_jar('file:${PWD}/${JAR_FILE}', '${JAR_ID}')"


    db2 -v "call sqlj.refresh_classes()"


    db2 +p -tv - <<EOF
    CREATE OR REPLACE FUNCTION ENCRYPT_STRING_NON_DETERMINISTIC(VARCHAR(128))
    RETURNS VARCHAR(128)
    EXTERNAL NAME '${JAR_ID}:com.company.EncryptString.encryptString'
    NO SQL PARAMETER STYLE java LANGUAGE java
    RETURNS NULL ON NULL INPUT NO EXTERNAL ACTION NOT DETERMINISTIC
    ;
    EOF

    db2 "values ENCRYPT_STRING_NON_DETERMINISTIC('test string')::VARCHAR(20)"

    EncryptString.java
    package com.company;
     
    public class EncryptString
    {
      public static String encryptString(String p_str)
      {
        return p_str;
      }
    }

    The function just returns a value of the parameter passed.
    Change the database name (SAMPLE) if you have another one.
    Run it:

    chmod +x make-all.sh
    ./make-all.sh

    Does it work?



    ------------------------------
    Mark Barinstein
    ------------------------------



  • 17.  RE: Problem with calling Docker DB2 user defined function.

    Posted Tue November 04, 2025 12:38 AM

    Hi Mark,

    ./make-all.sh
    added manifest
    adding: com/(in = 0) (out= 0)(stored 0%)
    adding: com/company/(in = 0) (out= 0)(stored 0%)
    adding: com/company/EncryptString.class(in = 309) (out= 212)(deflated 31%)
    
       Database Connection Information
    
     Database server        = DB2/LINUXX8664 12.1.2.0
     SQL authorization ID   = DB2INST1
     Local database alias   = DB2
    
    call sqlj.install_jar('file:/tmp/my_jar.jar', 'MY_SCHEMA.ENCRYPTIONJAR')
    DB20000I  The CALL command completed successfully.
    
    
    call sqlj.replace_jar('file:/tmp/my_jar.jar', 'MY_SCHEMA.ENCRYPTIONJAR')
    DB20000I  The CALL command completed successfully.
    
    
    call sqlj.refresh_classes()
    DB20000I  The CALL command completed successfully.
    
    
    CREATE OR REPLACE FUNCTION ENCRYPT_STRING_NON_DETERMINISTIC(VARCHAR(128))
    RETURNS VARCHAR(128)
    EXTERNAL NAME 'MY_SCHEMA.ENCRYPTIONJAR:com.company.EncryptString.encryptString'
    NO SQL PARAMETER STYLE java LANGUAGE java
    RETURNS NULL ON NULL INPUT NO EXTERNAL ACTION NOT DETERMINISTIC
    
    DB20000I  The SQL command completed successfully.
    
    
    1                   
    --------------------
    SQL1646N  A routine failed because the fenced user ID cannot access required 
    files in the sqllib directory or other instance or database directories.


    ------------------------------
    Mariusz Lewandowski
    ------------------------------



  • 18.  RE: Problem with calling Docker DB2 user defined function.

    Posted Tue November 04, 2025 01:03 AM

    The example above works well with my 12.1.2 container. This means, that you really have some problems with some file / dir permissions, if you tried to set them manually earlier. Db2 really doesn't like it sometimes.

    Usually we may try to repair it with db2iupdt (as root), but it runs on a stopped db2 instance.

    What appears in the db2diag.log (`db2diag -H 1m` inside the container as db2inst1, for example - last 1 min messages) after getting such an error?



    ------------------------------
    Mark Barinstein
    ------------------------------



  • 19.  RE: Problem with calling Docker DB2 user defined function.

    Posted Tue November 04, 2025 02:26 AM

    Here is the log.

    I am going to set up the container again and try your script in first place to see if it is going to work on fresh installation.

    2025-11-04 08:23:13.955 | 
    2025-11-04 08:23:13.955 | 2025-11-04-07.23.13.954456+000 I1182372E646          LEVEL: Info
    2025-11-04 08:23:13.955 | PID     : 22152                TID : 140736808871488 PROC : db2sysc 0
    2025-11-04 08:23:13.955 | INSTANCE: db2inst1             NODE : 000            DB   : BOADB
    2025-11-04 08:23:13.955 | APPHDL  : 0-1909               APPID: *LOCAL.db2inst1.251104072313
    2025-11-04 08:23:13.955 | UOWID   : 1                    LAST_ACTID: 0              
    2025-11-04 08:23:13.955 | AUTHID  : db2inst1             HOSTNAME: db2server
    2025-11-04 08:23:13.955 | EDUID   : 878                  EDUNAME: db2agent (BOADB) 0
    2025-11-04 08:23:13.955 | FUNCTION: DB2 UDB, BSU Java support, sqlejReadJar, probe:2349
    2025-11-04 08:23:13.955 | DATA #1 : String, 11 bytes
    2025-11-04 08:23:13.955 | Jar Classes
    2025-11-04 08:23:13.955 | DATA #2 : String, 80 bytes
    2025-11-04 08:23:13.955 | META-INF. META-INF.MANIFEST.MF com. com.company. com.company.EncryptString.class
    2025-11-04 08:23:15.945 | 
    2025-11-04 08:23:15.945 | 2025-11-04-07.23.15.943144+000 I1183019E314          LEVEL: Warning
    2025-11-04 08:23:15.945 | PID     : 49737                TID : 140737411913600 PROC : db2fmpr
    2025-11-04 08:23:15.945 | INSTANCE: db2inst1             NODE : 000
    2025-11-04 08:23:15.945 | HOSTNAME: db2server
    2025-11-04 08:23:15.945 | FUNCTION: DB2 UDB, oper system services, sqloJVMvfprintf, probe:20
    2025-11-04 08:23:15.945 | MESSAGE : Exception in thread "(unnamed thread)"
    2025-11-04 08:23:15.946 | 
    2025-11-04 08:23:15.946 | 2025-11-04-07.23.15.945888+000 I1183334E277          LEVEL: Warning
    2025-11-04 08:23:15.946 | PID     : 49737                TID : 140737411913600 PROC : db2fmpr
    2025-11-04 08:23:15.946 | INSTANCE: db2inst1             NODE : 000
    2025-11-04 08:23:15.946 | HOSTNAME: db2server
    2025-11-04 08:23:15.946 | FUNCTION: DB2 UDB, oper system services, sqloJVMvfprintf, probe:20
    2025-11-04 08:23:15.946 | MESSAGE :  
    2025-11-04 08:23:15.946 | 
    2025-11-04 08:23:15.946 | 2025-11-04-07.23.15.946012+000 I1183612E304          LEVEL: Warning
    2025-11-04 08:23:15.946 | PID     : 49737                TID : 140737411913600 PROC : db2fmpr
    2025-11-04 08:23:15.946 | INSTANCE: db2inst1             NODE : 000
    2025-11-04 08:23:15.946 | HOSTNAME: db2server
    2025-11-04 08:23:15.946 | FUNCTION: DB2 UDB, oper system services, sqloJVMvfprintf, probe:20
    2025-11-04 08:23:15.946 | MESSAGE : java/lang/StackOverflowError
    2025-11-04 08:23:15.980 | 
    2025-11-04 08:23:15.980 | 2025-11-04-07.23.15.960294+000 I1183917E6152         LEVEL: Warning
    2025-11-04 08:23:15.980 | PID     : 22152                TID : 140736808871488 PROC : db2sysc 0
    2025-11-04 08:23:15.980 | INSTANCE: db2inst1             NODE : 000            DB   : BOADB
    2025-11-04 08:23:15.980 | APPHDL  : 0-1909               APPID: *LOCAL.db2inst1.251104072313
    2025-11-04 08:23:15.980 | UOWID   : 4                    ACTID: 1              
    2025-11-04 08:23:15.980 | AUTHID  : db2inst1             HOSTNAME: db2server
    2025-11-04 08:23:15.980 | EDUID   : 878                  EDUNAME: db2agent (BOADB) 0
    2025-11-04 08:23:15.980 | FUNCTION: DB2 UDB, routine_infrastructure, sqlerMasterThreadReq, probe:823
    2025-11-04 08:23:15.980 | DATA #1 : String, 26 bytes
    2025-11-04 08:23:15.980 | FMP being marked unstable.
    2025-11-04 08:23:15.980 | DATA #2 : sqlerUnstableReason, PD_TYPE_SQLER_UNSTABLE_REASON, 4 bytes
    2025-11-04 08:23:15.980 | SQLER_UNSTABLE_INIT_COMMS_FAILED (8) - Failed to communicate with master thread
    2025-11-04 08:23:15.980 | DATA #3 : sqlerFmpRow, PD_SQLER_TYPE_FMP_ROW, 872 bytes
    2025-11-04 08:23:15.980 |  fmpPid: 49737
    2025-11-04 08:23:15.980 |  fmpPoolList Ptr: 0x0000000000000000	fmpForcedList Ptr: 0x0000000000000000
    2025-11-04 08:23:15.980 |  nextFmpCB Ptr: 0x0000000204192e20	prevFmpCB Ptr: 0x0000000000000000
    2025-11-04 08:23:15.980 |  fmpIPCList Ptr: 0x0000000204198060
    2025-11-04 08:23:15.980 |  stateFlags: 0x00800143	numFmp32Attaches: 0
    2025-11-04 08:23:15.980 |  numActiveThreads: 0	numPoolThreads: 0	numForcedThreads: 0
    2025-11-04 08:23:15.980 |  fmpCodePage: 1208	fmpRowUseCount: 1
    2025-11-04 08:23:15.980 |  is32bit: false 
    2025-11-04 08:23:15.980 |  active: 0x01 	rowLoaderValidate: 0x00
    2025-11-04 08:23:15.980 |  startTimestamp:    2025-11-04-07.23.15
    2025-11-04 08:23:15.980 |  unstableTimestamp: 0
    2025-11-04 08:23:15.980 |  unstableReason: SQLER_UNSTABLE_UNKNOWN (0) - Unknown reason
    2025-11-04 08:23:15.980 |  ipcLatch:
    2025-11-04 08:23:15.980 | 0x0000000204197CE4 : 0100 4000                                  ..@.
    2025-11-04 08:23:15.980 |  rowLatch:
    2025-11-04 08:23:15.980 | 0x0000000204197CE8 : 0100 EA01                                  ....
    2025-11-04 08:23:15.980 |  fmpAgentList:
    2025-11-04 08:23:15.980 | 0x0000000204197CF0 : 0800 0700 2D32 3039 3731 3531 3935 3700    ....-2097151957.
    2025-11-04 08:23:15.980 | 0x0000000204197D00 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.980 | 0x0000000204197D10 : 0000 0000 0000 0000 0000 0000 2A00 0000    ............*...
    2025-11-04 08:23:15.980 | 0x0000000204197D20 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.980 | 0x0000000204197D30 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.980 | 0x0000000204197D40 : 0000 0000 2A00 0000 0000 0000 0000 0000    ....*...........
    2025-11-04 08:23:15.980 | 0x0000000204197D50 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.980 | 0x0000000204197D60 : 0000 0000 0000 0000 0000 0000 2A00 0000    ............*...
    2025-11-04 08:23:15.980 | 0x0000000204197D70 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.980 | 0x0000000204197D80 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.980 | 0x0000000204197D90 : 0000 0000 2A00 0000 0000 0000 0000 0000    ....*...........
    2025-11-04 08:23:15.980 | 0x0000000204197DA0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.980 | 0x0000000204197DB0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.980 | 0x0000000204197DC0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.980 | 0x0000000204197DD0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.980 | 0x0000000204197DE0 : 0000 0000 5345 4D41 5048 4F52 4520 5741    ....SEMAPHORE WA
    2025-11-04 08:23:15.980 | 0x0000000204197DF0 : 4954 0000 0000 0000 0000 0000 0000 0000    IT..............
    2025-11-04 08:23:15.980 | 0x0000000204197E00 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.980 | 0x0000000204197E10 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.980 | 0x0000000204197E20 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E30 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E40 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E50 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E60 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E70 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E80 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E90 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197EA0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197EB0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197EC0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197ED0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197EE0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197EF0 : 0000 0000 0000 0000 E07C 1904 0200 0000    .........|......
    2025-11-04 08:23:15.981 | 0x0000000204197F00 : E07B 1904 0200 0000 0000 0000 0000 0000    .{..............
    2025-11-04 08:23:15.981 | 0x0000000204197F10 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197F20 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197F30 : 0100 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | CALLSTCK: (Static functions may not be resolved correctly, as they are resolved to the nearest symbol)
    2025-11-04 08:23:15.981 |   [0] 0x00007FFFF5E6FFFE _Z20sqlerMasterThreadReqP17sqlerFmpParmsBaseP13sqlerFmpTableP14sqlerFmpHandleP18sqlerFmpThreadListP8sqeAgentjccP5sqlcab + 0xBEE
    2025-11-04 08:23:15.981 |   [1] 0x00007FFFF5E773F4 _Z22sqlerGetFmpThreadEntryP11sqlerFmpRowP14sqlerFmpHandleP17sqlerFmpParmsBaseb + 0xB64
    2025-11-04 08:23:15.981 |   [2] 0x00007FFFF5E7EADB _Z19sqlerGetFmpFromPoolP14sqlerFmpHandleP17sqlerFmpParmsBase + 0x1B8B
    2025-11-04 08:23:15.981 |   [3] 0x00007FFFF5E7FFB0 _Z24sqlerInvokeFencedRoutineP13sqlerFmpParms + 0x500
    2025-11-04 08:23:15.981 |   [4] 0x00007FFFF9053431 _Z18sqlriInvokeInvokerP10sqlri_ufobb + 0x261
    2025-11-04 08:23:15.981 |   [5] 0x00007FFFF9057144 _Z15sqlriusf_commonP8sqlrr_cbP10sqlri_ufob + 0x5B4
    2025-11-04 08:23:15.981 |   [6] 0x00007FFFF9058B1D _Z8sqlriusfP8sqlrr_cb + 0x3D
    2025-11-04 08:23:15.981 |   [7] 0x00007FFFF8EDE74F _Z15sqlriSectInvokeP8sqlrr_cbP12sqlri_opparm + 0x55F
    2025-11-04 08:23:15.981 |   [8] 0x00007FFFF8902349 _Z27sqlrr_process_fetch_requestP14db2UCinterface + 0x899
    2025-11-04 08:23:15.981 |   [9] 0x00007FFFF8905691 _Z10sqlrr_openP14db2UCinterfaceP15db2UCCursorInfo + 0x7B1
    2025-11-04 08:23:15.981 |   [10] 0x00007FFFF61D9CE9 _Z16sqljs_ddm_opnqryP14db2UCinterfaceP13sqljDDMObject + 0x4B9
    2025-11-04 08:23:15.981 |   [11] 0x00007FFFF61BAE03 _Z21sqljsParseRdbAccessedP13sqljsDrdaAsCbP13sqljDDMObjectP14db2UCinterface + 0x333
    2025-11-04 08:23:15.981 |   [12] 0x00007FFFF61BB2C6 _Z10sqljsParseP13sqljsDrdaAsCbP14db2UCinterfaceP8sqeAgentb + 0x336
    2025-11-04 08:23:15.981 |   [13] 0x00007FFFF61B2409 /database/config/db2inst1/sqllib/lib64/libdb2e.so.1 + 0xBA99409
    2025-11-04 08:23:15.981 |   [14] 0x00007FFFF61B5A20 _Z17sqljsDrdaAsDriverP18SQLCC_INITSTRUCT_T + 0xF50
    2025-11-04 08:23:15.981 |   [15] 0x00007FFFF5A4841C _ZN8sqeAgent6RunEDUEv + 0x9AC
    2025-11-04 08:23:15.981 |   [16] 0x00007FFFFA088904 _ZN9sqzEDUObj9EDUDriverEv + 0x1A4
    2025-11-04 08:23:15.981 |   [17] 0x00007FFFF80E51EE sqloEDUEntry + 0x28E
    2025-11-04 08:23:15.981 |   [18] 0x00007FFFE9BDE0EA /lib64/libc.so.6 + 0x8A0EA
    2025-11-04 08:23:15.981 |   [19] 0x00007FFFE9C62444 clone + 0x44
    2025-11-04 08:23:15.981 | 
    2025-11-04 08:23:15.981 | 2025-11-04-07.23.15.980702+000 E1190070E4526         LEVEL: Info
    2025-11-04 08:23:15.981 | PID     : 22152                TID : 140736808871488 PROC : db2sysc 0
    2025-11-04 08:23:15.981 | INSTANCE: db2inst1             NODE : 000            DB   : BOADB
    2025-11-04 08:23:15.981 | APPHDL  : 0-1909               APPID: *LOCAL.db2inst1.251104072313
    2025-11-04 08:23:15.981 | UOWID   : 4                    ACTID: 1              
    2025-11-04 08:23:15.981 | AUTHID  : db2inst1             HOSTNAME: db2server
    2025-11-04 08:23:15.981 | EDUID   : 878                  EDUNAME: db2agent (BOADB) 0
    2025-11-04 08:23:15.981 | FUNCTION: DB2 UDB, routine_infrastructure, sqlerMasterThreadReq, probe:11106
    2025-11-04 08:23:15.981 | DATA #1 : String, 23 bytes
    2025-11-04 08:23:15.981 | Marking fmp as unstable
    2025-11-04 08:23:15.981 | DATA #2 : String, 8 bytes
    2025-11-04 08:23:15.981 | Fmp TID:
    2025-11-04 08:23:15.981 | DATA #3 : Hexdump, 8 bytes
    2025-11-04 08:23:15.981 | 0x0000000204198258 : 0000 0000 0000 0000                        ........
    2025-11-04 08:23:15.981 | DATA #4 : String, 8 bytes
    2025-11-04 08:23:15.981 | Fmp Row:
    2025-11-04 08:23:15.981 | DATA #5 : sqlerFmpRow, PD_SQLER_TYPE_FMP_ROW, 872 bytes
    2025-11-04 08:23:15.981 |  fmpPid: 49737
    2025-11-04 08:23:15.981 |  fmpPoolList Ptr: 0x0000000000000000	fmpForcedList Ptr: 0x0000000000000000
    2025-11-04 08:23:15.981 |  nextFmpCB Ptr: 0x0000000204192e20	prevFmpCB Ptr: 0x0000000000000000
    2025-11-04 08:23:15.981 |  fmpIPCList Ptr: 0x0000000204198060
    2025-11-04 08:23:15.981 |  stateFlags: 0x00800153	numFmp32Attaches: 0
    2025-11-04 08:23:15.981 |  numActiveThreads: 0	numPoolThreads: 0	numForcedThreads: 0
    2025-11-04 08:23:15.981 |  fmpCodePage: 1208	fmpRowUseCount: 1
    2025-11-04 08:23:15.981 |  is32bit: false 
    2025-11-04 08:23:15.981 |  active: 0x01 	rowLoaderValidate: 0x00
    2025-11-04 08:23:15.981 |  startTimestamp:    2025-11-04-07.23.15
    2025-11-04 08:23:15.981 |  unstableTimestamp: 2025-11-04-07.23.15
    2025-11-04 08:23:15.981 |  unstableReason: SQLER_UNSTABLE_INIT_COMMS_FAILED (8) - Failed to communicate with master thread
    2025-11-04 08:23:15.981 |  ipcLatch:
    2025-11-04 08:23:15.981 | 0x0000000204197CE4 : 0100 4000                                  ..@.
    2025-11-04 08:23:15.981 |  rowLatch:
    2025-11-04 08:23:15.981 | 0x0000000204197CE8 : 0100 EA01                                  ....
    2025-11-04 08:23:15.981 |  fmpAgentList:
    2025-11-04 08:23:15.981 | 0x0000000204197CF0 : 0800 0700 2D32 3039 3731 3531 3935 3700    ....-2097151957.
    2025-11-04 08:23:15.981 | 0x0000000204197D00 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197D10 : 0000 0000 0000 0000 0000 0000 2A00 0000    ............*...
    2025-11-04 08:23:15.981 | 0x0000000204197D20 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197D30 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197D40 : 0000 0000 2A00 0000 0000 0000 0000 0000    ....*...........
    2025-11-04 08:23:15.981 | 0x0000000204197D50 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197D60 : 0000 0000 0000 0000 0000 0000 2A00 0000    ............*...
    2025-11-04 08:23:15.981 | 0x0000000204197D70 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197D80 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197D90 : 0000 0000 2A00 0000 0000 0000 0000 0000    ....*...........
    2025-11-04 08:23:15.981 | 0x0000000204197DA0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197DB0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197DC0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197DD0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197DE0 : 0000 0000 5345 4D41 5048 4F52 4520 5741    ....SEMAPHORE WA
    2025-11-04 08:23:15.981 | 0x0000000204197DF0 : 4954 0000 0000 0000 0000 0000 0000 0000    IT..............
    2025-11-04 08:23:15.981 | 0x0000000204197E00 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E10 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E20 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E30 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E40 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E50 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E60 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E70 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E80 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E90 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197EA0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197EB0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197EC0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197ED0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197EE0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197EF0 : 0000 0000 0000 0000 E07C 1904 0200 0000    .........|......
    2025-11-04 08:23:15.981 | 0x0000000204197F00 : E07B 1904 0200 0000 0000 0000 0000 0000    .{..............
    2025-11-04 08:23:15.981 | 0x0000000204197F10 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197F20 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197F30 : 0100 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 
    2025-11-04 08:23:15.981 | 2025-11-04-07.23.15.980894+000 I1194597E4651         LEVEL: Severe
    2025-11-04 08:23:15.981 | PID     : 22152                TID : 140736808871488 PROC : db2sysc 0
    2025-11-04 08:23:15.981 | INSTANCE: db2inst1             NODE : 000            DB   : BOADB
    2025-11-04 08:23:15.981 | APPHDL  : 0-1909               APPID: *LOCAL.db2inst1.251104072313
    2025-11-04 08:23:15.981 | UOWID   : 4                    ACTID: 1              
    2025-11-04 08:23:15.981 | AUTHID  : db2inst1             HOSTNAME: db2server
    2025-11-04 08:23:15.981 | EDUID   : 878                  EDUNAME: db2agent (BOADB) 0
    2025-11-04 08:23:15.981 | FUNCTION: DB2 UDB, routine_infrastructure, sqlerMasterThreadReq, probe:10597
    2025-11-04 08:23:15.981 | RETCODE : ZRC=0xFFFFF992=-1646
    2025-11-04 08:23:15.981 |           SQL1646N  A routine failed because the fenced user ID cannot access 
    2025-11-04 08:23:15.981 |           required files in the sqllib directory or other instance or database 
    2025-11-04 08:23:15.981 |           directories.
    2025-11-04 08:23:15.981 | 
    2025-11-04 08:23:15.981 | DATA #1 : String, 43 bytes
    2025-11-04 08:23:15.981 | Error occurred sending msg to master thread
    2025-11-04 08:23:15.981 | DATA #2 : String, 31 bytes
    2025-11-04 08:23:15.981 | Dumping the FMP info. Fmp Row: 
    2025-11-04 08:23:15.981 | DATA #3 : sqlerFmpRow, PD_SQLER_TYPE_FMP_ROW, 872 bytes
    2025-11-04 08:23:15.981 |  fmpPid: 49737
    2025-11-04 08:23:15.981 |  fmpPoolList Ptr: 0x0000000000000000	fmpForcedList Ptr: 0x0000000000000000
    2025-11-04 08:23:15.981 |  nextFmpCB Ptr: 0x0000000204192e20	prevFmpCB Ptr: 0x0000000000000000
    2025-11-04 08:23:15.981 |  fmpIPCList Ptr: 0x0000000204198060
    2025-11-04 08:23:15.981 |  stateFlags: 0x00800153	numFmp32Attaches: 0
    2025-11-04 08:23:15.981 |  numActiveThreads: 0	numPoolThreads: 0	numForcedThreads: 0
    2025-11-04 08:23:15.981 |  fmpCodePage: 1208	fmpRowUseCount: 1
    2025-11-04 08:23:15.981 |  is32bit: false 
    2025-11-04 08:23:15.981 |  active: 0x01 	rowLoaderValidate: 0x00
    2025-11-04 08:23:15.981 |  startTimestamp:    2025-11-04-07.23.15
    2025-11-04 08:23:15.981 |  unstableTimestamp: 2025-11-04-07.23.15
    2025-11-04 08:23:15.981 |  unstableReason: SQLER_UNSTABLE_INIT_COMMS_FAILED (8) - Failed to communicate with master thread
    2025-11-04 08:23:15.981 |  ipcLatch:
    2025-11-04 08:23:15.981 | 0x0000000204197CE4 : 0100 4000                                  ..@.
    2025-11-04 08:23:15.981 |  rowLatch:
    2025-11-04 08:23:15.981 | 0x0000000204197CE8 : 0000 EA01                                  ....
    2025-11-04 08:23:15.981 |  fmpAgentList:
    2025-11-04 08:23:15.981 | 0x0000000204197CF0 : 0800 0700 2D32 3039 3731 3531 3935 3700    ....-2097151957.
    2025-11-04 08:23:15.981 | 0x0000000204197D00 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197D10 : 0000 0000 0000 0000 0000 0000 2A00 0000    ............*...
    2025-11-04 08:23:15.981 | 0x0000000204197D20 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197D30 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197D40 : 0000 0000 2A00 0000 0000 0000 0000 0000    ....*...........
    2025-11-04 08:23:15.981 | 0x0000000204197D50 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197D60 : 0000 0000 0000 0000 0000 0000 2A00 0000    ............*...
    2025-11-04 08:23:15.981 | 0x0000000204197D70 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197D80 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197D90 : 0000 0000 2A00 0000 0000 0000 0000 0000    ....*...........
    2025-11-04 08:23:15.981 | 0x0000000204197DA0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197DB0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197DC0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197DD0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197DE0 : 0000 0000 5345 4D41 5048 4F52 4520 5741    ....SEMAPHORE WA
    2025-11-04 08:23:15.981 | 0x0000000204197DF0 : 4954 0000 0000 0000 0000 0000 0000 0000    IT..............
    2025-11-04 08:23:15.981 | 0x0000000204197E00 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E10 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E20 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E30 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E40 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E50 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E60 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E70 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E80 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197E90 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197EA0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197EB0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197EC0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197ED0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197EE0 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197EF0 : 0000 0000 0000 0000 E07C 1904 0200 0000    .........|......
    2025-11-04 08:23:15.981 | 0x0000000204197F00 : E07B 1904 0200 0000 0000 0000 0000 0000    .{..............
    2025-11-04 08:23:15.981 | 0x0000000204197F10 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197F20 : 0000 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.981 | 0x0000000204197F30 : 0100 0000 0000 0000 0000 0000 0000 0000    ................
    2025-11-04 08:23:15.982 | 
    2025-11-04 08:23:15.982 | 2025-11-04-07.23.15.981616+000 I1199249E721          LEVEL: Severe
    2025-11-04 08:23:15.982 | PID     : 22152                TID : 140736808871488 PROC : db2sysc 0
    2025-11-04 08:23:15.982 | INSTANCE: db2inst1             NODE : 000            DB   : BOADB
    2025-11-04 08:23:15.982 | APPHDL  : 0-1909               APPID: *LOCAL.db2inst1.251104072313
    2025-11-04 08:23:15.982 | UOWID   : 4                    ACTID: 1              
    2025-11-04 08:23:15.982 | AUTHID  : db2inst1             HOSTNAME: db2server
    2025-11-04 08:23:15.982 | EDUID   : 878                  EDUNAME: db2agent (BOADB) 0
    2025-11-04 08:23:15.982 | FUNCTION: DB2 UDB, routine_infrastructure, sqlerGetFmpThread, probe:7450
    2025-11-04 08:23:15.982 | RETCODE : ZRC=0xFFFFF992=-1646
    2025-11-04 08:23:15.982 |           SQL1646N  A routine failed because the fenced user ID cannot access 
    2025-11-04 08:23:15.982 |           required files in the sqllib directory or other instance or database 
    2025-11-04 08:23:15.982 |           directories.
    2025-11-04 08:23:15.982 | 


    ------------------------------
    Mariusz Lewandowski
    ------------------------------



  • 20.  RE: Problem with calling Docker DB2 user defined function.

    Posted Tue November 04, 2025 03:56 AM

    Ok so now:

    • I have removed all containers
    • I have removed all volumes
    • I set up new and fresh container

    my .envlist:

    % cat .env_list

    LICENSE=accept

    DB2INSTANCE=db2inst1

    DB2INST1_PASSWORD=db2inst1

    DBNAME=BOADB

    BLU=false

    ENABLE_ORACLE_COMPATIBILITY=false

    UPDATEAVAIL=NO

    TO_CREATE_SAMPLEDB=true

    REPODB=false

    IS_OSXFS=true

    PERSISTENT_HOME=true

    HADR_ENABLED=false

    ETCD_ENDPOINT=

    ETCD_USERNAME=

    ETCD_PASSWORD=

    Docker command:

     docker run -h db2server --name db2 --restart=always --detach --privileged=true -p 50000:50000 --env-file .env_list -v db_data:/database -v /Users/itml/Developer/cos/:/liquibase-db icr.io/db2_community/db2

    And the files I have created in /tmp dir as db2inst1. Still same problem.

    Could it be because of my .env_list settings? Docker settings? 

    In Docker settings I have:

    Apple Virtualization Framework

    Use Rosetta for x86/64 emulation on Apple Silicon

    Filesystem VirtioFs



    ------------------------------
    Mariusz Lewandowski
    ------------------------------



  • 21.  RE: Problem with calling Docker DB2 user defined function.

    Posted Wed November 05, 2025 01:02 AM

    All the above: too long, did not read. But are you aware of these two new security features of Db2 V12.1.x?

    To me it sounds pretty much like you've hit by the changes.

    https://www.ibm.com/docs/en/db2/12.1.0?topic=routines-mon-get-connection-get-connection-metrics

    And just in case, have you set DB2_SECCOMP_ENABLE? See second entry on https://www.ibm.com/docs/en/db2/12.1.0?topic=121-security-enhancements



    ------------------------------
    Roland Schock
    IBM Champion and IBM Gold Consultant
    ------------------------------



  • 22.  RE: Problem with calling Docker DB2 user defined function.

    Posted Wed November 05, 2025 03:42 AM

    Hi @Roland Schock,

    Actually I don't need the newest DB2 version. I tried with DB2_SECCOMP_ENABLE with ON/OFF but didn't help.

    But I have downgraded the image to 11.5.4.0 and the script from Mark it seems to work!

    I will try to set up complete DB with liquibase scripts on this version and will see if it's going to work eventually.

    [db2inst1@db2server ~]$ ./make-all.sh 
    added manifest
    adding: com/(in = 0) (out= 0)(stored 0%)
    adding: com/company/(in = 0) (out= 0)(stored 0%)
    adding: com/company/EncryptString.class(in = 309) (out= 212)(deflated 31%)
     
       Database Connection Information
     
     Database server        = DB2/LINUXX8664 11.5.4.0 <------- this is the version I have used
     SQL authorization ID   = DB2INST1
     Local database alias   = DB
     
    call sqlj.install_jar('file:/database/config/db2inst1/my_jar.jar', 'MY_SCHEMA.ENCRYPTIONJAR')
    DB20000I  The CALL command completed successfully.
     
     
    call sqlj.replace_jar('file:/database/config/db2inst1/my_jar.jar', 'MY_SCHEMA.ENCRYPTIONJAR')
    DB20000I  The CALL command completed successfully.
     
     
    call sqlj.refresh_classes()
    DB20000I  The CALL command completed successfully.
     
     
    CREATE OR REPLACE FUNCTION ENCRYPT_STRING_NON_DETERMINISTIC(VARCHAR(128))
    RETURNS VARCHAR(128)
    EXTERNAL NAME 'MY_SCHEMA.ENCRYPTIONJAR:com.company.EncryptString.encryptString'
    NO SQL PARAMETER STYLE java LANGUAGE java
    RETURNS NULL ON NULL INPUT NO EXTERNAL ACTION NOT DETERMINISTIC
     
    DB20000I  The SQL command completed successfully.
     
     
    1                   
    --------------------
    test string         
     
      1 record(s) selected.


    ------------------------------
    Mariusz Lewandowski
    ------------------------------



  • 23.  RE: Problem with calling Docker DB2 user defined function.

    Posted Wed November 05, 2025 05:09 AM

    Hi Mariusz,

    it a pain for me to hear, you are just using a version, which is two years old. See https://www.ibm.com/support/pages/node/6241724

    It should also work with the newest version of Db2. If not, then there wa some change inbetween we have to take care of. Usually there are no big changes.

    Flicking the DB2_SECCOMP_ENABLE switch will have an effect only with Db2 12.1.x but not with Db2 11.5.x.

    Cheers

    Roland



    ------------------------------
    Roland Schock
    IBM Champion and IBM Gold Consultant
    ------------------------------