Db2

 View Only
  • 1.  podman run fails for Db2 Community Container

    Posted Tue October 17, 2023 11:42 AM
      |   view attached

    When I attempt to create the Db2 community container using podman, the RUN command fails.  The first error in the output is:

    (*) Creating users ...
    useradd: cannot create directory /database/config/db2inst1
    useradd: cannot create directory /database/config/db2fenc1

    Important details:  
    MacOS Ventura 13.6
    Container Runtime: Podman 4.6.2

    Here is the command I'm running:
    podman run -h db2server115 --name db2server115 --detach --privileged=true -p 50000:50000 --env-file .env_list -v /Users/db2dean/x/db2fs:/db2fs -v /Users/db2dean/x:/x -v /Users/db2dean/x/db2fs/database:/database icr.io/db2_community/db2

    Contents of .env_list
    LICENSE=accept
    DB2INSTANCE=db2inst1
    DB2INST1_PASSWORD=ibmdb2aa
    DBNAME=
    BLU=false
    ENABLE_ORACLE_COMPATIBILITY=false
    UPDATEAVAIL=NO
    TO_CREATE_SAMPLEDB=false
    REPODB=false
    IS_OSXFS=true
    PERSISTENT_HOME=true
    HADR_ENABLED=false
    ETCD_ENDPOINT=
    ETCD_USERNAME=
    ETCD_PASSWORD=

    Earlier I had the container running fine, but recently had to uninstall/reinstall podman.  So I have the latest version Podman.  I have had some macos upgrades since I last created the Db2 container. 



    ------------------------------
    Dean Compher
    ------------------------------

    Attachment(s)

    log
    db2icrt.log   1 KB 1 version


  • 2.  RE: podman run fails for Db2 Community Container

    Posted Thu November 23, 2023 12:58 PM

    Hello @Dean Compher,

    I have a few questions for you to help debug the issue:
    - Can you check what permissions the /Users/db2dean/x/db2fs/database directory has? It may be that the container doesn't have the correct permissions to write/modify files in that path

    - Does your Mac contain the Apple silicon? E.g. the M1/M2/MX chips. Or is it using an intel chip?



    ------------------------------
    Mohamed Bengezi
    ------------------------------



  • 3.  RE: podman run fails for Db2 Community Container

    Posted Fri November 24, 2023 11:37 AM

    Thank you Mohamed,

    My Mac uses an Intel chip.  When I checked the permissions on the /Users/db2dean/x/db2fs/database directory I noticed that group and user didn't have write permissions, so I did a chmod 777 on it to change it as follows:

    $ ls -l | grep database
    drwxrwxrwx@  2 db2dean  staff       64 Nov 24 09:09 database

    This had an interesting effect.  Before I made the change issuing the podman-run command would create a config directory under database.  Now it doesn't and I see this error in the output. 

    Error: statfs /Users/db2dean/x/db2fs/database: no such file or directory

    I tried adding that directory to $PATH but that had no effect.  I've attached all of the output displayed in the terminal window in the file called Screen output.txt  I also attached the script that I run called pmrun115mac  That script is located in /Users/db2dean/x/db2fs and I execute it from the command line as ./pmrun115mac.sh.



    ------------------------------
    Dean Compher
    ------------------------------

    Attachment(s)

    sh
    pmrun115mac.sh   400 B 1 version
    txt
    Screen output.txt   4 KB 1 version


  • 4.  RE: podman run fails for Db2 Community Container

    Posted Fri November 24, 2023 12:15 PM

    Hi @Dean Compher

    My Mac uses the apple silicon which doesn't support running the container directly. For the intel architecture, it should be supported as normal. Give me some time to get ahold of a similar environment to yours in order to duplicate the issue and debug. In the meantime, can you also try with the previous image? Since we just GA'd v1159, there's a chance that that is the reason it stopped working all of a sudden. To rule that out, can you try your command as you did the previous times it worked, but use the image tagged with :11.5.8.0, rather than the latest. You can also use 11.5.7.0 if you'd like. 

    I'll post a follow up soon once I've gotten a laptop and reproduced your issue 



    ------------------------------
    Mohamed Bengezi
    ------------------------------



  • 5.  RE: podman run fails for Db2 Community Container

    Posted Fri November 24, 2023 01:07 PM

    Hi @Mohamed Bengezi

    I tried byth 11.5.8 and 11.5.7.  They do NOT get the "Error: statfs /Users/db2dean/x/db2fs/database: no such file or directory" message and they both do create a config directory under database.  I zipped the config directories for both and attached them here.



    ------------------------------
    Dean Compher
    ------------------------------

    Attachment(s)

    zip
    config11.5.7.0.zip   142 KB 1 version
    zip
    config.11.5.8.zip   149 KB 1 version


  • 6.  RE: podman run fails for Db2 Community Container

    Posted Tue January 02, 2024 10:57 AM

    I've spoken with Dean offline, and we've found a workaround by excluding the 

     -v /Users/db2dean/x/db2fs/database:/database 

    database volume mount from the command. Mounting other directories works without issue, but it seems that it has trouble when the database volume is mounted due to some permission issue from macOS



    ------------------------------
    Mohamed Bengezi
    ------------------------------