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

fix: fixed swoole extension that gets the SQLSTATE[08006] error #715

Merged
merged 2 commits into from
Sep 3, 2024

Conversation

pedrovian4
Copy link
Contributor

@pedrovian4 pedrovian4 commented Aug 9, 2024

Description

While working on my server, I encountered the error SQLSTATE[08006], which is caused by the Swoole extension installed through the PPA. To resolve this issue, I reinstalled Swoole using PECL, which resolved the connection problem.

My reference to solve the problem: https://stackoverflow.com/questions/78669556/possible-bug-with-php-pdo-and-with-postgresql

image

Moved the swoole instalation to pecl instead using the ppa
@taylorotwell
Copy link
Member

Will need more community feedback and confirmation.

@taylorotwell taylorotwell marked this pull request as draft August 12, 2024 22:09
@renky
Copy link

renky commented Aug 17, 2024

Edit: (removed my first confirming answer):

I didn't get it finally running with this solution.
This solution fixes the current problem with running NON-swoole environments - but for that you can also just omit the swoole installation.

To use swoole this solution seems not to be enough because the extension is not enabled after installation with pecl. You still have to add extension=swoole.so to the php.ini
Finally I also didn't get it work. I had to manually root-bash into the app container, run pecl install swool-5.1.2 manually (confirming all questions) and finally add extension=swoole.so to the php.ini - after a manual restart my swoole sail environment worked fine...

If anybody gets it running out of the box, I appreciate the solution...

In the end, it seems to be only a temporary hiccup. swoole already fixed this issue here: swoole/swoole-src#5396
nevertheless, there is currently no new version available and finally it still has to be taken into php-swoole binaries what will for sure take some more time. But finally if we just wait 1-2 months the issue might be solved without changing the sail Dockerfile - until then, everybody using sail has either to uninstall php8.x-swoole or install it manually and activate the extension.

@beNjiox
Copy link

beNjiox commented Aug 23, 2024

Had the same issue and just found out this thread.

Doing sudo rm /etc/php/8.3/mods-available/swoole.ini solve my problem.

Found out thanks to this stack overflow issue
https://stackoverflow.com/questions/78669556/possible-bug-with-php-pdo-and-with-postgresql

Step to reproduce the issue (basically my use case)

  • one managed database from digitalocean
  • fresh laravel app, pointing to the database
  • lauching the app and seeing : "could not send SSL negotiation packet"

@pedrovian4
Copy link
Contributor Author

Had the same issue and just found out this thread.

Doing sudo rm /etc/php/8.3/mods-available/swoole.ini solve my problem.

Found out thanks to this stack overflow issue https://stackoverflow.com/questions/78669556/possible-bug-with-php-pdo-and-with-postgresql

Step to reproduce the issue (basically my use case)

* one managed database from digitalocean

* fresh laravel app, pointing to the database

* lauching the app and seeing : "could not send SSL negotiation packet"

Oh nice, I will add this to the PR, I did not get this error even using swoole on my service

@renky
Copy link

renky commented Aug 24, 2024

I can confirm, after the last change it works fine with octane environments !!

@pedrovian4 pedrovian4 marked this pull request as ready for review August 28, 2024 11:09
@EduardoCerutti
Copy link

This solution worked very well for me

@taylorotwell
Copy link
Member

But why are we permanently pinning a specific version of Swoole here?

@pedrovian4
Copy link
Contributor Author

But why are we permanently pinning a specific version of Swoole here?

Because the version of swoole in the apt repository is 6.0.0 that is in alpha, and that still got bugs, so the solution was to downgrade the swoole to get the LTS

@taylorotwell taylorotwell merged commit b4af38e into laravel:1.x Sep 3, 2024
3 checks passed
@yc01
Copy link

yc01 commented Sep 15, 2024

Happened to me as well. I was just installing a Fresh Laravel 8.3 app using Laravel Forge (connecting to a RDS Postgres db) and got the same error. I then executed the delete command as follows and it solved the problem for me.

sudo rm /etc/php/8.3/mods-available/swoole.ini

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

Successfully merging this pull request may close these issues.

6 participants