Skip to content

error odbc-snowflake-php-84 layer #581

Description

@AngularProUser

Hello,

getting this error :

"odbc_connect(): SQL error: [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed, SQL state IM004 in SQLConnect"

"bref/bref": "2.3.13",
"bref/extra-php-extensions": "1.7.0",

runtime: php-84
layers:

  • ${bref-extra:odbc-snowflake-php-84}

This does not occur on versions php-83

Activity

  1. AngularProUser commented on Apr 7, 2025

    @AngularProUser
    Author

    Hi,

    Please error still occur using theses versions :
    "bref/bref": "2.4.1"
    "bref/extra-php-extensions": "1.7.1", "1.7.2"

  2. lracicot commented on May 21, 2025

    @lracicot

    We have the same problem. I don't know if it is related to the same underlying cause as mkleehammer/pyodbc#738 (comment). provided.al2 uses a glibc 2.26 and it comes with unixODBC 2.3.1. Snowflake does not seem to document which version of the driver they require so maybe there is something to confirm there... 🤔

    Broken
    ${bref-extra:odbc-snowflake-php-82}
    "bref/bref": "2.4.4"
    "bref/extra-php-extensions": "1.8.3"

    Works
    ${bref-extra:odbc-snowflake-php-82}
    "bref/bref": "2.4.4"
    "bref/extra-php-extensions": "1.2.6"

    If we compare the versions between 1.2.6 and 1.7.0 (from @AngularProUser ) the only line that changed in the snowflake layer is this one: https://github.com/brefphp/extra-php-extensions/compare/1.2.6..1.7.0#diff-cf2ca12bf4226b1c5481b7b70ae7e4fa20860d39affc2ef7ee0138697797bd77R21

  3. AngularProUser commented on Jun 20, 2025

    @AngularProUser
    Author

    I manually built and deployed an ODBC-Snowflake layer using the Dockerfile from:

    https://github.com/brefphp/extra-php-extensions/blob/master/layers/odbc-snowflake/Dockerfile

    I configured the following variables:

    PHP_VERSION = 84
    BREF_VERSION = 2
    Using the Snowflake ODBC driver version 2.25.12 (downloaded from https://sfc-repo.snowflakecomputing.com/odbc/linux/2.25.12/snowflake_linux_x8664_odbc-2.25.12.tgz), everything works without errors.

    However, when using a newer Snowflake ODBC driver (3.X.X, downloaded from https://sfc-repo.snowflakecomputing.com/odbc/linux/3.X.X/snowflake_linux_x8664_odbc-3.X.X.tgz), I encounter the following error on odbc_connect():

    odbc_connect(): SQL error: [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed, SQL state IM004 in SQLConnect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions