Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug with PHP PDO and with PostgreSQL #14665

Closed
gofish543 opened this issue Jun 26, 2024 · 8 comments
Closed

Possible bug with PHP PDO and with PostgreSQL #14665

gofish543 opened this issue Jun 26, 2024 · 8 comments

Comments

@gofish543
Copy link

Description

https://stackoverflow.com/questions/78669556/possible-bug-with-php-pdo-and-with-postgresql/78670026#78670026

What information do you need?

PHP Version

PHP 8.2.20

Operating System

Ubuntu 22.04 LTS

@JDare
Copy link

JDare commented Jun 26, 2024

I've noticed the same issue on a production server (Ubuntu 22) which got updated to PHP 8.3.8 running laravel 11.x connecting to postgres (16.2).

@davidldear
Copy link

More info as well. We are seeing this on various Laravel apps across PHP 8.2/8.3 and Ubuntu 22/24 while connecting to Postgres.

@yoyoyeahyoyo
Copy link

yoyoyeahyoyo commented Jun 26, 2024

Usage: /usr/bin/php-config [OPTION] Options: --prefix [/usr] --includes [-I/usr/include/php/20220829 -I/usr/include/php/20220829/main -I/usr/include/php/20220829/TSRM -I/usr/include/php/20220829/Zend -I/usr/include/php/20220829/ext -I/usr/include/php/20220829/ext/date/lib ] --ldflags [-L/usr/lib/php/20220829 ] --libs [-lcrypt -lrt -lm -lxml2 -lssl -lcrypto -lpcre2-8 -lz -lsodium -largon2 -lrt -ldl -lcrypt ] --extension-dir [/usr/lib/php/20220829] --include-dir [/usr/include/php/20220829] --man-dir [/usr/share/man] --php-binary [/usr/bin/php8.2] --php-sapis [cli fpm phpdbg ] --phpapi [20220829] --ini-path [/etc/php/8.2/cli] --ini-dir [/etc/php/8.2/cli/conf.d] --configure-options [--includedir=/usr/include --mandir=/usr/share/man --infodir=/usr/share/info --disable-option-checking --disable-silent-rules --libdir=/usr/lib/x86_64-linux-gnu --libexecdir=/usr/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --prefix=/usr --enable-cli --disable-cgi --disable-phpdbg --with-config-file-path=/etc/php/8.2/cli --with-config-file-scan-dir=/etc/php/8.2/cli/conf.d --build=x86_64-linux-gnu --host=x86_64-linux-gnu --config-cache --cache-file=/tmp/buildd/nonexistent/config.cache --libdir=${prefix}/lib/php --libexecdir=${prefix}/lib/php --datadir=${prefix}/share/php/8.2 --program-suffix=8.2 --sysconfdir=/etc --localstatedir=/var --mandir=/usr/share/man --disable-all --disable-debug --disable-rpath --disable-static --enable-dtrace --with-pic --with-layout=GNU --without-pear --enable-filter --with-openssl --with-password-argon2=/usr --with-external-pcre --enable-hash --with-mhash=/usr --with-libxml --enable-session --with-sodium --with-system-tzdata --with-zlib=/usr --with-zlib-dir=/usr --enable-pcntl --with-libedit=shared,/usr build_alias=x86_64-linux-gnu host_alias=x86_64-linux-gnu CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -O2 -Wall -pedantic -fsigned-char -fno-strict-aliasing -DOPENSSL_SUPPRESS_DEPRECATED -g] --version [8.2.20] --vernum [80220]

PDO doesn't work. pg_connect works.
PDO errors: with sslmode='disable'

Running command:
$pdo = new PDO($dsn, null, null, [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);
Errors:
With sslmode 'disable'
SQLSTATE[08006] [7] could not send startup packet: Resource temporarily unavailable
With sslmode 'require'
SQLSTATE[08006] [7] could not send SSL negotiation packet: Resource temporarily unavailable
Its happening in newly created aws and digital ocean ubuntu servers with laravel forge server management. build flags shown above for one of them.

@devnexen
Copy link
Member

devnexen commented Jun 26, 2024

Weird I see no change in pdo pgsql between those releases (8.2.20/8.2.19). About Docker, were they always the same images or were they updated as a whole ?

@yoyoyeahyoyo
Copy link

yoyoyeahyoyo commented Jun 26, 2024

Temp fix
setting this up as a service:
socat TCP4-LISTEN:{PORT},fork TCP4:{EXTERNAL_HOST}:{EXTERNAL_PORT}
Which details that the loopback connections work. Its specifically the connection to another interface where it fails.

Weird I see no change in pdo pgsql between those releases (8.2.20/8.2.19).

I made a build of php 8.2.19, and it had the same bug, however I can't confirm which pdo_pgsql this build was running.

@devnexen
Copy link
Member

between php 8.1 and php 8.2 there is no real major changes, pgsqlGetnotify mind you but that s past the connection.

@yoyoyeahyoyo
Copy link

yoyoyeahyoyo commented Jun 26, 2024

Here are some packages that were updated with the unattended-upgrades around the time pdo stopped working:
google-chrome-stable libcups2 php8.0-swoole php8.2-swoole
This swoole issue has the same error message
swoole/swoole-src#5374

Update: I replaced php8.2-swoole 6.0.0-2 with version 5.1.3 configured with "--use-openssl" flag, and did not get this error when using pdo_pgsql. I don't think it is a problem with pdo_psql.
But I don't know what is causing it. The swoole version on this ticket (swoole/swoole-src#5374 ) is 5.1.2 and the same error .

Copy link

No feedback was provided. The issue is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so. Thank you.

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

No branches or pull requests

5 participants