Layer7 API Management

 View Only
Expand all | Collapse all

"unable to allocate file descriptor table - out of memory" error

  • 1.  "unable to allocate file descriptor table - out of memory" error

    Posted Jun 02, 2025 05:10 AM

    Hi There,

    I am trying to install API Developer Portal version 5.1 on docker swarm. This is for me to troubleshoot an issue when upgrading 5.1 to 5.3.2.

    When I run portal.sh after I had set up external database and SMTP server, the install process stuck at "Checking to see if DB schema update is needed...................................".

    I checked the log file of the containers "db-upgrade-rbac:5.1" and "db-upgrade-portal:5.1", they all had the same "library initialization failed - unable to allocate file descriptor table - out of memory./upgrade.sh: line 140" error message:
    ====================================================================================================
    INFO: Waiting for the MySQL DB server(rhel-91-mysql-80.acme2.com:3306) to start...
    INFO: The DB server has started.

    INFO: Running the rbac upgrade...
    [2025-06-02 08:58:03] INFO [liquibase.integration] No Liquibase Pro license key supplied. Please set liquibaseProLicenseKey on command line or in liquibase.properties to use Liquibase Pro features.
    Liquibase Community 4.3.5 by Datical
    ####################################################
    ##   _     _             _ _                      ##
    ##  | |   (_)           (_) |                     ##
    ##  | |    _  __ _ _   _ _| |__   __ _ ___  ___   ##
    ##  | |   | |/ _` | | | | | '_ \ / _` / __|/ _ \  ##
    ##  | |___| | (_| | |_| | | |_) | (_| \__ \  __/  ##
    ##  \_____/_|\__, |\__,_|_|_.__/ \__,_|___/\___|  ##
    ##              | |                               ##
    ##              |_|                               ##
    ##                                                ## 
    ##  Get documentation at docs.liquibase.com       ##
    ##  Get certified courses at learn.liquibase.com  ## 
    ##  Free schema change activity reports at        ##
    ##      https://hub.liquibase.com                 ##
    ##                                                ##
    ####################################################
    Starting Liquibase at 08:58:03 (version 4.3.5 #62 built at 2021-04-29 18:31+0000)
    library initialization failed - unable to allocate file descriptor table - out of memory./upgrade.sh: line 140:    23 Aborted                 (core dumped) java $2 -jar ${LIQUIBASE_JAR} --url=${URL} --username=${USERNAME} --password=${PASSWORD} --driver=${DRIVER} --classpath=${DRIVER_JAR} --changeLogFile=$1 --logLevel=${LOG_LEVEL} update
    ERROR: Running the rbac liquibase scripts failed, see above for details; exiting
    08:58:04, Stopping simple server on :8081... done
    ====================================================================================================
    INFO: Waiting for the MySQL DB server(rhel-91-mysql-80.acme2.com:3306) to start...
    INFO: The DB server has started.

    INFO: Running the portal-data specific upgrade...
    [2025-06-02 08:58:03] INFO [liquibase.integration] No Liquibase Pro license key supplied. Please set liquibaseProLicenseKey on command line or in liquibase.properties to use Liquibase Pro features.
    Liquibase Community 4.3.5 by Datical
    ####################################################
    ##   _     _             _ _                      ##
    ##  | |   (_)           (_) |                     ##
    ##  | |    _  __ _ _   _ _| |__   __ _ ___  ___   ##
    ##  | |   | |/ _` | | | | | '_ \ / _` / __|/ _ \  ##
    ##  | |___| | (_| | |_| | | |_) | (_| \__ \  __/  ##
    ##  \_____/_|\__, |\__,_|_|_.__/ \__,_|___/\___|  ##
    ##              | |                               ##
    ##              |_|                               ##
    ##                                                ## 
    ##  Get documentation at docs.liquibase.com       ##
    ##  Get certified courses at learn.liquibase.com  ## 
    ##  Free schema change activity reports at        ##
    ##      https://hub.liquibase.com                 ##
    ##                                                ##
    ####################################################
    Starting Liquibase at 08:58:03 (version 4.3.5 #62 built at 2021-04-29 18:31+0000)
    ERROR: Running the portal-data liquibase scripts failed, see above for details; exiting
    library initialization failed - unable to allocate file descriptor table - out of memory./upgrade.sh: line 140:    20 Aborted                 (core dumped) java $2 -jar ${LIQUIBASE_JAR} --url=${URL} --username=${USERNAME} --password=${PASSWORD} --driver=${DRIVER} --classpath=${DRIVER_JAR} --changeLogFile=$1 --logLevel=${LOG_LEVEL} update
    08:58:04, Stopping simple server on :8080... done
    ====================================================================================================

    I tried to run the containers with command "docker run --ulimit nofile=65536:65536 caapim/db-upgrade-rbac:5.1" separate from the installation process but received the same error.

    Please help.

    Regards,
    Jiangping Li



  • 2.  RE: "unable to allocate file descriptor table - out of memory" error

    Posted Jun 07, 2025 03:33 AM

    To answer my own question, it was caused by too MANY file descriptors available to the container.

    Adding the limit to docker service unit file resolves the issue.

    ExecStart=/usr/bin/dockerd --default-ulimit nofile=1024:1024 -H fd:// --containerd=/run/containerd/containerd.sock

    Regards,

    Jiangping Li