mlocati / docker-php-extension-installer

Easily install PHP extensions in Docker containers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pdo_sqlsrv and sqlsrv no more supported on bookworm with PHP 8.3.0RC5

llaville opened this issue · comments

Version of install-php-extensions

2.1.58

Error description

See Monitoring 8.3 Workflow => https://github.com/mlocati/docker-php-extension-installer/actions/runs/6663508324/job/18109503989

While it was supported on 8.3.0RC4

Docker image

php:8.3-rc-cli-bookworm

Minimal Dockerfile

No response

@mlocati FYI, it seems also unsupported on PHP 8.1.25

My local attempt with php:8.1-fpm (bookworm : https://hub.docker.com/layers/library/php/8.1-fpm/images/sha256-1a51b538f212121882d98c27bd015d5d72336b373c65d05dfde150c5fc12c684?context=explore)

#24 [build-version-8125 14/63] RUN install-php-extensions pdo_sqlsrv
#24 0.615 install-php-extensions v.2.1.58
#24 0.615 #StandWithUkraine
#24 3.065 Updating channel "pecl.php.net"
#24 3.249 Channel "pecl.php.net" is up to date
#24 3.360 Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
#24 3.431 Get:2 http://deb.debian.org/debian bookworm-updates InRelease [52.1 kB]
#24 3.441 Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
#24 3.584 Get:4 http://deb.debian.org/debian bookworm/main amd64 Packages [8780 kB]
#24 5.744 Get:5 http://deb.debian.org/debian bookworm-updates/main amd64 Packages [6408 B]
#24 5.745 Get:6 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [88.9 kB]
#24 6.924 Fetched 9127 kB in 4s (2535 kB/s)
#24 6.924 Reading package lists...
#24 10.46 ### INSTALLING REQUIRED PACKAGES ###
#24 10.46 # Packages to be kept after installation: libltdl7 libodbc2 libodbcinst2 unixodbc unixodbc-common
#24 10.46 # Packages to be used only for installation: apt-transport-https dirmngr gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm libassuan0 libksba8 libnpth0 libodbccr2 pinentry-curses unixodbc-dev
#24 13.51 debconf: delaying package configuration, since apt-utils is not installed
#24 13.62 Selecting previously unselected package apt-transport-https.
(Reading database ... 13909 files and directories currently installed.)
#24 13.64 Preparing to unpack .../00-apt-transport-https_2.6.1_all.deb ...
#24 13.65 Unpacking apt-transport-https (2.6.1) ...
#24 13.76 Selecting previously unselected package libassuan0:amd64.
#24 13.76 Preparing to unpack .../01-libassuan0_2.5.5-5_amd64.deb ...
#24 13.79 Unpacking libassuan0:amd64 (2.5.5-5) ...
#24 13.88 Selecting previously unselected package gpgconf.
#24 13.88 Preparing to unpack .../02-gpgconf_2.2.40-1.1_amd64.deb ...
#24 13.90 Unpacking gpgconf (2.2.40-1.1) ...
#24 14.05 Selecting previously unselected package libksba8:amd64.
#24 14.05 Preparing to unpack .../03-libksba8_1.6.3-2_amd64.deb ...
#24 14.07 Unpacking libksba8:amd64 (1.6.3-2) ...
#24 14.19 Selecting previously unselected package libnpth0:amd64.
#24 14.20 Preparing to unpack .../04-libnpth0_1.6-3_amd64.deb ...
#24 14.21 Unpacking libnpth0:amd64 (1.6-3) ...
#24 14.32 Selecting previously unselected package dirmngr.
#24 14.33 Preparing to unpack .../05-dirmngr_2.2.40-1.1_amd64.deb ...
#24 14.37 Unpacking dirmngr (2.2.40-1.1) ...
#24 14.49 Selecting previously unselected package gnupg-l10n.
#24 14.49 Preparing to unpack .../06-gnupg-l10n_2.2.40-1.1_all.deb ...
#24 14.50 Unpacking gnupg-l10n (2.2.40-1.1) ...
#24 14.68 Selecting previously unselected package gnupg-utils.
#24 14.68 Preparing to unpack .../07-gnupg-utils_2.2.40-1.1_amd64.deb ...
#24 14.69 Unpacking gnupg-utils (2.2.40-1.1) ...
#24 14.84 Selecting previously unselected package gpg.
#24 14.84 Preparing to unpack .../08-gpg_2.2.40-1.1_amd64.deb ...
#24 14.85 Unpacking gpg (2.2.40-1.1) ...
#24 15.01 Selecting previously unselected package pinentry-curses.
#24 15.01 Preparing to unpack .../09-pinentry-curses_1.2.1-1_amd64.deb ...
#24 15.02 Unpacking pinentry-curses (1.2.1-1) ...
#24 15.14 Selecting previously unselected package gpg-agent.
#24 15.14 Preparing to unpack .../10-gpg-agent_2.2.40-1.1_amd64.deb ...
#24 15.15 Unpacking gpg-agent (2.2.40-1.1) ...
#24 15.28 Selecting previously unselected package gpg-wks-client.
#24 15.28 Preparing to unpack .../11-gpg-wks-client_2.2.40-1.1_amd64.deb ...
#24 15.30 Unpacking gpg-wks-client (2.2.40-1.1) ...
#24 15.41 Selecting previously unselected package gpg-wks-server.
#24 15.41 Preparing to unpack .../12-gpg-wks-server_2.2.40-1.1_amd64.deb ...
#24 15.43 Unpacking gpg-wks-server (2.2.40-1.1) ...
#24 15.54 Selecting previously unselected package gpgsm.
#24 15.54 Preparing to unpack .../13-gpgsm_2.2.40-1.1_amd64.deb ...
#24 15.56 Unpacking gpgsm (2.2.40-1.1) ...
#24 15.68 Selecting previously unselected package gnupg.
#24 15.68 Preparing to unpack .../14-gnupg_2.2.40-1.1_all.deb ...
#24 15.70 Unpacking gnupg (2.2.40-1.1) ...
#24 15.86 Selecting previously unselected package libltdl7:amd64.
#24 15.87 Preparing to unpack .../15-libltdl7_2.4.7-5_amd64.deb ...
#24 15.88 Unpacking libltdl7:amd64 (2.4.7-5) ...
#24 16.01 Selecting previously unselected package libodbc2:amd64.
#24 16.02 Preparing to unpack .../16-libodbc2_2.3.11-2+deb12u1_amd64.deb ...
#24 16.03 Unpacking libodbc2:amd64 (2.3.11-2+deb12u1) ...
#24 16.16 Selecting previously unselected package libodbccr2:amd64.
#24 16.17 Preparing to unpack .../17-libodbccr2_2.3.11-2+deb12u1_amd64.deb ...
#24 16.18 Unpacking libodbccr2:amd64 (2.3.11-2+deb12u1) ...
#24 16.33 Selecting previously unselected package unixodbc-common.
#24 16.34 Preparing to unpack .../18-unixodbc-common_2.3.11-2+deb12u1_all.deb ...
#24 16.36 Unpacking unixodbc-common (2.3.11-2+deb12u1) ...
#24 16.50 Selecting previously unselected package libodbcinst2:amd64.
#24 16.50 Preparing to unpack .../19-libodbcinst2_2.3.11-2+deb12u1_amd64.deb ...
#24 16.52 Unpacking libodbcinst2:amd64 (2.3.11-2+deb12u1) ...
#24 16.65 Selecting previously unselected package unixodbc.
#24 16.65 Preparing to unpack .../20-unixodbc_2.3.11-2+deb12u1_amd64.deb ...
#24 16.66 Unpacking unixodbc (2.3.11-2+deb12u1) ...
#24 16.75 Selecting previously unselected package unixodbc-dev:amd64.
#24 16.75 Preparing to unpack .../21-unixodbc-dev_2.3.11-2+deb12u1_amd64.deb ...
#24 16.77 Unpacking unixodbc-dev:amd64 (2.3.11-2+deb12u1) ...
#24 16.93 Setting up libksba8:amd64 (1.6.3-2) ...
#24 16.97 Setting up apt-transport-https (2.6.1) ...
#24 17.01 Setting up libnpth0:amd64 (1.6-3) ...
#24 17.05 Setting up libassuan0:amd64 (2.5.5-5) ...
#24 17.08 Setting up gnupg-l10n (2.2.40-1.1) ...
#24 17.12 Setting up unixodbc-common (2.3.11-2+deb12u1) ...
#24 17.17 Setting up libltdl7:amd64 (2.4.7-5) ...
#24 17.22 Setting up libodbc2:amd64 (2.3.11-2+deb12u1) ...
#24 17.26 Setting up gpgconf (2.2.40-1.1) ...
#24 17.30 Setting up gpg (2.2.40-1.1) ...
#24 17.34 Setting up libodbccr2:amd64 (2.3.11-2+deb12u1) ...
#24 17.38 Setting up gnupg-utils (2.2.40-1.1) ...
#24 17.42 Setting up pinentry-curses (1.2.1-1) ...
#24 17.49 Setting up libodbcinst2:amd64 (2.3.11-2+deb12u1) ...
#24 17.53 Setting up gpg-agent (2.2.40-1.1) ...
#24 18.16 Setting up unixodbc (2.3.11-2+deb12u1) ...
#24 18.20 Setting up gpgsm (2.2.40-1.1) ...
#24 18.23 Setting up dirmngr (2.2.40-1.1) ...
#24 18.45 Setting up gpg-wks-server (2.2.40-1.1) ...
#24 18.49 Setting up unixodbc-dev:amd64 (2.3.11-2+deb12u1) ...
#24 18.54 Setting up gpg-wks-client (2.2.40-1.1) ...
#24 18.59 Setting up gnupg (2.2.40-1.1) ...
#24 18.64 Processing triggers for libc-bin (2.36-9+deb12u3) ...
#24 18.75 ### INSTALLING REMOTE MODULE pdo_sqlsrv ###
#24 18.76 Installing the Microsoft SQL Server ODBC Driver
#24 18.76 - installing the Microsoft APT key
#24 19.97 - adding the Microsoft APT source list
#24 20.25 Hit:1 http://deb.debian.org/debian bookworm InRelease
#24 20.25 Hit:2 http://deb.debian.org/debian bookworm-updates InRelease
#24 20.26 Hit:3 http://deb.debian.org/debian-security bookworm-security InRelease
#24 20.34 Get:4 https://packages.microsoft.com/debian/11/prod bullseye InRelease [3629 B]
#24 20.81 Get:5 https://packages.microsoft.com/debian/11/prod bullseye/main arm64 Packages [27.4 kB]
#24 20.86 Get:6 https://packages.microsoft.com/debian/11/prod bullseye/main armhf Packages [25.3 kB]
#24 20.86 Get:7 https://packages.microsoft.com/debian/11/prod bullseye/main amd64 Packages [125 kB]
#24 20.89 Get:8 https://packages.microsoft.com/debian/11/prod bullseye/main all Packages [1149 B]
#24 20.94 Fetched 183 kB in 1s (238 kB/s)
#24 20.94 Reading package lists...
#24 21.52 - installing the APT package
#24 23.31 debconf: delaying package configuration, since apt-utils is not installed
#24 23.38 Selecting previously unselected package autotools-dev.
(Reading database ... 14234 files and directories currently installed.)
#24 23.39 Preparing to unpack .../0-autotools-dev_20220109.1_all.deb ...
#24 23.41 Unpacking autotools-dev (20220109.1) ...
#24 23.48 Selecting previously unselected package automake.
#24 23.48 Preparing to unpack .../1-automake_1%3a1.16.5-1.3_all.deb ...
#24 23.49 Unpacking automake (1:1.16.5-1.3) ...
#24 23.68 Selecting previously unselected package libltdl-dev:amd64.
#24 23.68 Preparing to unpack .../2-libltdl-dev_2.4.7-5_amd64.deb ...
#24 23.69 Unpacking libltdl-dev:amd64 (2.4.7-5) ...
#24 23.83 Selecting previously unselected package libodbc1:amd64.
#24 23.83 Preparing to unpack .../3-libodbc1_2.3.11-3_amd64.deb ...
#24 23.84 Unpacking libodbc1:amd64 (2.3.11-3) ...
#24 23.84 dpkg: error processing archive /tmp/apt-dpkg-install-XBRfX8/3-libodbc1_2.3.11-3_amd64.deb (--unpack):
#24 23.84  trying to overwrite '/usr/lib/x86_64-linux-gnu/libodbc.so.2.0.0', which is also in package libodbc2:amd64 2.3.11-2+deb12u1
#24 23.84 dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
#24 23.91 Selecting previously unselected package odbcinst1debian2:amd64.
#24 23.91 Preparing to unpack .../4-odbcinst1debian2_2.3.11-3_amd64.deb ...
#24 23.92 Unpacking odbcinst1debian2:amd64 (2.3.11-3) ...
#24 23.93 dpkg: error processing archive /tmp/apt-dpkg-install-XBRfX8/4-odbcinst1debian2_2.3.11-3_amd64.deb (--unpack):
#24 23.93  trying to overwrite '/usr/lib/x86_64-linux-gnu/libodbcinst.so.2.0.0', which is also in package libodbcinst2:amd64 2.3.11-2+deb12u1
#24 23.99 Selecting previously unselected package odbcinst.
#24 23.99 Preparing to unpack .../5-odbcinst_2.3.11-3_amd64.deb ...
#24 24.00 Unpacking odbcinst (2.3.11-3) ...
#24 24.00 dpkg: error processing archive /tmp/apt-dpkg-install-XBRfX8/5-odbcinst_2.3.11-3_amd64.deb (--unpack):
#24 24.00  trying to overwrite '/etc/odbc.ini', which is also in package unixodbc-common 2.3.11-2+deb12u1
#24 24.04 Preparing to unpack .../6-unixodbc_2.3.11-3_amd64.deb ...
#24 24.07 Unpacking unixodbc (2.3.11-3) over (2.3.11-2+deb12u1) ...
#24 24.21 Selecting previously unselected package msodbcsql18.
#24 24.22 Preparing to unpack .../7-msodbcsql18_18.3.2.1-1_amd64.deb ...
#24 24.35 Unpacking msodbcsql18 (18.3.2.1-1) ...
#24 24.54 Preparing to unpack .../8-unixodbc-dev_2.3.11-3_amd64.deb ...
#24 24.58 Unpacking unixodbc-dev (2.3.11-3) over (2.3.11-2+deb12u1) ...
#24 24.70 Errors were encountered while processing:
#24 24.70  /tmp/apt-dpkg-install-XBRfX8/3-libodbc1_2.3.11-3_amd64.deb
#24 24.70  /tmp/apt-dpkg-install-XBRfX8/4-odbcinst1debian2_2.3.11-3_amd64.deb
#24 24.70  /tmp/apt-dpkg-install-XBRfX8/5-odbcinst_2.3.11-3_amd64.deb
#24 24.71 E: Sub-process /usr/bin/dpkg returned an error code (1)
#24 ERROR: process "/bin/sh -c install-php-extensions pdo_sqlsrv" did not complete successfully: exit code: 100

Same problem with php:8.2-cli-bookworm and sqlsrv extension:

82.41 ### INSTALLING REMOTE MODULE sqlsrv ###
82.41 Installing the Microsoft SQL Server ODBC Driver
82.41 - installing the Microsoft APT key
82.70 - adding the Microsoft APT source list
83.06 Hit:1 http://deb.debian.org/debian bookworm InRelease
83.15 Hit:2 http://deb.debian.org/debian bookworm-updates InRelease
83.25 Hit:3 http://deb.debian.org/debian-security bookworm-security InRelease
83.47 Get:4 https://packages.microsoft.com/debian/11/prod bullseye InRelease [3629 B]
83.60 Get:5 https://packages.microsoft.com/debian/11/prod bullseye/main all Packages [1149 B]
83.65 Get:6 https://packages.microsoft.com/debian/11/prod bullseye/main armhf Packages [25.3 kB]
83.70 Get:7 https://packages.microsoft.com/debian/11/prod bullseye/main amd64 Packages [125 kB]
83.79 Get:8 https://packages.microsoft.com/debian/11/prod bullseye/main arm64 Packages [27.4 kB]
83.80 Fetched 183 kB in 1s (211 kB/s)
83.80 Reading package lists...
84.36 - installing the APT package
85.01 debconf: delaying package configuration, since apt-utils is not installed
85.07 Selecting previously unselected package libodbc1:amd64.
(Reading database ... 56413 files and directories currently installed.)
85.10 Preparing to unpack .../0-libodbc1_2.3.11-3_amd64.deb ...
85.10 Unpacking libodbc1:amd64 (2.3.11-3) ...
85.11 dpkg: error processing archive /tmp/apt-dpkg-install-YJEHsg/0-libodbc1_2.3.11-3_amd64.deb (--unpack):
85.11  trying to overwrite '/usr/lib/x86_64-linux-gnu/libodbc.so.2.0.0', which is also in package libodbc2:amd64 2.3.11-2+deb12u1
85.11 dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
85.13 Selecting previously unselected package odbcinst1debian2:amd64.
85.13 Preparing to unpack .../1-odbcinst1debian2_2.3.11-3_amd64.deb ...
85.14 Unpacking odbcinst1debian2:amd64 (2.3.11-3) ...
85.14 dpkg: error processing archive /tmp/apt-dpkg-install-YJEHsg/1-odbcinst1debian2_2.3.11-3_amd64.deb (--unpack):
85.14  trying to overwrite '/usr/lib/x86_64-linux-gnu/libodbcinst.so.2.0.0', which is also in package libodbcinst2:amd64 2.3.11-2+deb12u1
85.16 Selecting previously unselected package odbcinst.
85.17 Preparing to unpack .../2-odbcinst_2.3.11-3_amd64.deb ...
85.17 Unpacking odbcinst (2.3.11-3) ...
85.17 dpkg: error processing archive /tmp/apt-dpkg-install-YJEHsg/2-odbcinst_2.3.11-3_amd64.deb (--unpack):
85.17  trying to overwrite '/etc/odbc.ini', which is also in package unixodbc-common 2.3.11-2+deb12u1
85.20 Preparing to unpack .../3-unixodbc_2.3.11-3_amd64.deb ...
85.21 Unpacking unixodbc (2.3.11-3) over (2.3.11-2+deb12u1) ...
85.26 Selecting previously unselected package msodbcsql18.
85.26 Preparing to unpack .../4-msodbcsql18_18.3.2.1-1_amd64.deb ...
85.33 Unpacking msodbcsql18 (18.3.2.1-1) ...
85.42 Preparing to unpack .../5-unixodbc-dev_2.3.11-3_amd64.deb ...
85.44 Unpacking unixodbc-dev (2.3.11-3) over (2.3.11-2+deb12u1) ...
85.49 Errors were encountered while processing:
85.49  /tmp/apt-dpkg-install-YJEHsg/0-libodbc1_2.3.11-3_amd64.deb
85.49  /tmp/apt-dpkg-install-YJEHsg/1-odbcinst1debian2_2.3.11-3_amd64.deb
85.49  /tmp/apt-dpkg-install-YJEHsg/2-odbcinst_2.3.11-3_amd64.deb
85.56 E: Sub-process /usr/bin/dpkg returned an error code (1)

I confirmed that we have the same issue with PHP 8.2.12 bookworm (pdo_sqlsrv and sqlsrv extensions)

Repro Dockerfile:

FROM php:8.2

COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
RUN install-php-extensions pdo_sqlsrv

failing on PHP 8.1 - 8.3-RC on Debian, PHP < 8.1 or any Alpine is unaffected

The cause of this problem is 007638d included in #765 (which was ported from 11d237a of #761)

I never liked it since I knew it would have caused problems, and I won't accept such hacks anymore.

Fixed by #820

Thank you very much for looking into this ❤️

The cause of this problem is 007638d included in #765 (which was ported from 11d237a of #761)
I never liked it since I knew it would have caused problems, and I won't accept such hacks anymore.

Although I agree the commit was pretty ugly and hacky (I called it that myself in #761 (comment)) it was the quickest and cleanest way to trick the install-php-extensions script into using https://packages.microsoft.com/debian/11/prod/ when installing pdo_sqlsrv/sqlsrv extensions on bookworm until Microsoft made msodbcsql available in debian/12

I monitored https://packages.microsoft.com/debian/12/prod/dists/bookworm/main/binary-amd64/Packages for quite a while, but it took them over 4 months...

Without the change the script would've failed with errors when installing pdo_sqlsrv/sqlsrv on the official PHP 8 images (as well as any other bookworm based image) in the past few months.
I wonder what alternative solution you would've proposed @mlocati?

PS: as mentioned in #761 (comment) this commit: fad3078 should probably also be reverted now (in https://packages.microsoft.com/debian/12/prod/dists/bookworm/main/binary-amd64/Packages both msodbcsql17 and msodbcsql18 are available)

it was the quickest and cleanest way to trick the install-php-extensions script into using https://packages.microsoft.com/debian/11/prod/

Since install-php-extensions is very widely used, we have a huge responsibility. And force using in a system X a library written for system Y is not very responsible.
I'm just saying that I won't do/accept it anymore, and I'll wait for official releases to be ready (install-php-extensions is not the only way to install msodbcsql: people can still do any hack they want).

PS: as mentioned in #761 (comment) this commit: fad3078 should probably also be reverted now (in https://packages.microsoft.com/debian/12/prod/dists/bookworm/main/binary-amd64/Packages both msodbcsql17 and msodbcsql18 are available)

PR welcome! And thanks for your efforts, Dick!

PR welcome! And thanks for your efforts, Dick!

Here you go: #824 and welcome!