在中止workerman的时候 发生了loop事件库错误(Warning: EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195)

admin

问题描述

这里详细描述问题

程序代码

从workerman官网下载的原生 gatewayworker

Dockerfile 

FROM alpine:latest

#安装init
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
    && apk update \
    && apk add git wget curl nload php8-cli php8-redis php8-pcntl php8-posix php8-iconv php8-pdo php8-gd php8-pdo_mysql \
      php8-pecl-event  php8-curl php8-json php8-xml  php8-openssl   php8-mysqli php8-common php8-ctype php8-phar php8-mbstring php8-bcmath  \
    && php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" \
    && php composer-setup.php \
    && php -r "unlink('composer-setup.php');" \
    && php composer.phar config -g repo.packagist composer https://mirrors.aliyun.com/composer/ \
    && ln -s /app/composer.phar /usr/bin/composer

WORKDIR /app
#COPY / /app

RUN   mkdir -p /tmp/logs \
      && mkdir -p /tmp/sessions \
      && mkdir -p /tmp/views \
      && rm -rf /app/runtime \
      && ln -s /tmp  /app/runtime

#暴露 http 与 websocket_attach
EXPOSE 1238 2346 2900 2901 2902 2903
VOLUME /app
# DockerSocket
VOLUME /var/run/docker.sock

CMD ["php","/app/start.php","start"]

报错信息

EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195

Warning: EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195
PHP Warning:  EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195PHP Warning:  EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195PHP Warning:  EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195PHP Warning:  EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195

Warning: EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195

Warning: EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195

Warning: EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195

Warning: EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195
Workerman[start.php] has been stopped

操作系统及workerman/webman等框架组件具体版本

alpine linux container

1290 2 0
2个回答

walkor 打赏

php --ri event ,看下event扩展版本

  • admin 2022-12-01
    /app # php --ri event 
    
    event
    
    Event support => enabled
    Sockets support => enabled
    Debug support => disabled
    Extra functionality support including HTTP, DNS, and RPC => enabled
    OpenSSL support => enabled
    Thread safety support => disabled
    Extension version => 3.0.7
    libevent2 headers version => 2.1.12-stable
  • walkor 2022-12-01

    报错里看不出什么问题,可以把event升级到3.0.8试下

  • admin 2022-12-01

    先留着吧,我想其他用docker的并且也是用官方的alpine镜像的也会来这里看看的

  • 黑老怪 2022-12-08

    升级到了3.0.8也是一样会出现, Ubuntu20,PHP8.1 之前使用PHP7.4是没有出现

  • admin 2022-12-12

    大佬,我突然想起来,这个错误 仅仅在 ctrl+c 结束进程时(非 -d 进程守护) 模式下 的错误,好像没有任何影响,但是就是结束进程的时候发生的错误

= - =

https://github.com/mouyong/docker-environment/blob/master/php/Dockerfile 可作为 webman、webman gatewayworker 开发与线上部署的容器

  • admin 2022-12-12

    和我的Dockerfile安装方式没有任何区别,我是alpine linux,你这个不也是 直接用的官方包管理器安装的,没啥用。只不过是换了个操作系统换了个包管理器,本质问题还是没有解决,

    ps: 我使用alpine linux 镜像包构建完毕后20Mb,你看看是否能压缩到这个大小

年代过于久远,无法发表回答
×
🔝