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

HttpServerFactory fails with swoole 6: Swoole\Runtime::enableCoroutine(): Argument #1 ($flags) must be of type int, true given #140

Open
hydrapolic opened this issue Feb 14, 2025 · 1 comment
Labels
Bug Something isn't working

Comments

@hydrapolic
Copy link

hydrapolic commented Feb 14, 2025

Bug Report

Q A
Version(s) 4.10.0

Summary

After upgrading to swoole 6.0.1 with php 8.4, this error is shown when trying to run services with coroutines enabled:

app-1      | [2025-02-14T15:34:27.287024+00:00] licensing-services-error.ERROR: Uncaught Exception TypeError: "Swoole\Runtime::enableCoroutine(): Argument #1 ($flags) must be of type int, true given" at /var/www/vendor/mezzio/mezzio-swoole/src/HttpServerFactory.php line 114 {"exception":"[object] (TypeError(code: 0): Swoole\\Runtime::enableCoroutine(): Argument #1 ($flags) must be of type int, true given at /var/www/vendor/mezzio/mezzio-swoole/src/HttpServerFactory.php:114)"} {"hostname":"9f91bcc4648d","service_id":"service"}
app-1      | 
app-1      | In HttpServerFactory.php line 114:
app-1      |                                                                                
app-1      |   Swoole\Runtime::enableCoroutine(): Argument #1 ($flags) must be of type int  
app-1      |   , true given                                                                 
app-1      |                                                                                
app-1      | 
app-1      | mezzio:swoole:start [-d|--daemonize] [-w|--num-workers NUM-WORKERS] [-t|--num-task-workers NUM-TASK-WORKERS]

src/HttpServerFactory.php has SwooleRuntime::enableCoroutine(true); (https://github.com/mezzio/mezzio-swoole/blob/4.11.x/src/HttpServerFactory.php#L114), after changing to SwooleRuntime::enableCoroutine(1); it works.

Current behavior

Server fails to start

How to reproduce

Update to swoole 6

Expected behavior

Server running

@hydrapolic hydrapolic added the Bug Something isn't working label Feb 14, 2025
@babarinde
Copy link
Contributor

babarinde commented Feb 17, 2025

Hi,
That issue is related to this.
Given that swoole 6.* has some breaking code, some work may need to be done to get mezzio-swoole to be at speed with new changes.
There is also PR here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants