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

php-swoole 6.0.0 is leading to issues with PDO connections to postgres #5386

Closed
reubenfirmin opened this issue Jun 27, 2024 · 11 comments
Closed

Comments

@reubenfirmin
Copy link

Please answer these questions before submitting your issue.

  1. What did you do? If possible, provide a simple script for reproducing the error.

Please see https://stackoverflow.com/questions/78669556/possible-bug-with-php-pdo-and-with-postgresql - this issue is happening for multiple teams. (We found this thread after this started happening to us yesterday).

  1. What did you expect to see?

  2. What did you see instead?

  3. What version of Swoole are you using (show your php --ri swoole)?

6.0.0 - we appear to have picked this up along with security patches in PHP 8.2.20 / Ubuntu 20.04.

  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?

Linux e7843275b2ee78 5.15.98-fly #gac12cf665d SMP Thu Jun 20 16:59:12 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

PHP 8.2.20 (cli) (built: Jun 8 2024 21:37:34) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.20, Copyright (c) Zend Technologies
with Zend OPcache v8.2.20, Copyright (c), by Zend Technologies

@pixelart7
Copy link

Just wanted to add that if Swoole 6.0.0 has unexpectedly appeared in your Docker image, it might be due to the popular apt package repository (deb.sury.org) updating the php-swoole package to 6.0.0. I've opened an issue there to address this: oerdnj/deb.sury.org#2152.

As recommended by a StackOverflow user (https://stackoverflow.com/a/78675991/2560112), removing or downgrading Swoole when possible might help resolve the issue.

@cworreschk
Copy link

I have the same issues with PHP 8.3.8, but with Swoole 5.1.3. The only thing they have in common is that PHP 8.3.8 was also built on July 8 🤔

If I deactivate Swoole, everything works.

PDOException: SQLSTATE[08006] [7] could not send SSL negotiation packet: Resource temporarily unavailable
PHP 8.3.8 (cli) (built: Jun  8 2024 21:34:22) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.8, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.8, Copyright (c), by Zend Technologies

@ohmydevops
Copy link

We had the same problem. We disabled swoole extension. But we need to downgrade to 5.1.1 for permanent fix.

@cworreschk
Copy link

Maybe the Kernel optimization Synchronize PDO operation code across different versions of PHP for 6.0 and 5.3.1 is the reason for the PDO problem. @NathanFreeman

@NathanFreeman
Copy link
Member

Perhaps it is related to the SSL changes in PHP versions above 8.2 that I have not synchronized with Swoole. I need to take some time to look into this.

@NathanFreeman
Copy link
Member

Do you have SSL mode enabled in your PDO constructor?

@yoyoyeahyoyo
Copy link

yoyoyeahyoyo commented Jul 2, 2024

@NathanFreeman
Running
$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
And it works fine with a localhost/127.0.0.1 connection.

@NathanFreeman
Copy link
Member

@yoyoyeahyoyo @reubenfirmin Does this issue occur when PostgreSQL, PHP, and Swoole are not on the same server?

@yoyoyeahyoyo
Copy link

yoyoyeahyoyo commented Jul 3, 2024

@yoyoyeahyoyo @reubenfirmin Does this issue occur when PostgreSQL, PHP, and Swoole are not on the same server?

Not sure what you mean. It works fine when trying to connect to a local postgres server, but anything outside of localhost instantly fails. The main servers have php and swoole and postgresql client installed. The php ini configuration for swoole:
swoole
Author => Swoole Team [email protected]
swoole.display_errors => On => On
swoole.enable_coroutine => On => On
swoole.enable_fiber_mock => Off => Off
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.unixsock_buffer_size => 8388608 => 8388608
swoole.use_shortname => On => On

I was able to reproduce the error by setting up an ubuntu virtual box instance, installing postgres with pdo, and then installing swoole from ppa:ondrej.

@NathanFreeman
Copy link
Member

fixed by #5396

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

8 participants