Giter Club home page Giter Club logo

Comments (11)

wolfy-j avatar wolfy-j commented on May 19, 2024

Ok, I managed to recreate this issue by corrupting the config file. Can you make sure that http.workers.pool section presented? Can you post your config file sample here?

I have to add more validations for the config to track scenarios when config sections are omitted.

from roadrunner.

Firehed avatar Firehed commented on May 19, 2024

Ah, that makes sense. I was providing the minimal config that didn't give a validation error, assuming it would fill in default values as necessary. Here's what I had:

rpc:
  enable: false
http:
  enable: true
  address: 0.0.0.0:8000
  workers:
    command: php rr-entrypoint.php
    relay: pipes
  uploads:
    forbid: []
static:
  enable: true
  dir: public
  forbid:
    - .php

from roadrunner.

wolfy-j avatar wolfy-j commented on May 19, 2024

That explains :) We have slipped couple validations but I will keep this ticket open until your config given a proper error. We do not have default values for pool options, they always are custom.

Try:

rpc:
  enable: false
http:
  enable: true
  address: 0.0.0.0:8000
  workers:
    command: php rr-entrypoint.php
    relay: pipes
    pool:
       numWorkers: 4
       allocateTimeout: 600000000
       destroyTimeout:  600000000  
  uploads:
      forbid: []
static:
  enable: true
  dir: public
  forbid:
    - .php

from roadrunner.

wolfy-j avatar wolfy-j commented on May 19, 2024

You can also write configs in json btw.

from roadrunner.

wolfy-j avatar wolfy-j commented on May 19, 2024

Will be included into next release #13

from roadrunner.

Firehed avatar Firehed commented on May 19, 2024

Adding the http.workers.pool section appears to have fixed the crash-on-startup, but an immediately-dying worker (I made a typo and did require_once 'vendor/autoloaad.php';) just put this in the output, which is not terribly useful for debugging:

rr_1            | time="2018-06-19T19:15:56Z" level=error msg="[http]: unable to connect to worker: unexpected response, header is missing: signal: killed"

I was only able to figure out the actual source of the issue by trying to run the worker command myself in a shell; at no point was I able to actually find the PHP error itself when served by rr. Though to be fair, that could be due to bad php.ini settings - I haven't poked at it a whole lot.

Having additional documentation on the config would be super valuable here. For example, I have absolutely no idea how the RPC section works or what it's supposed to accomplish.

from roadrunner.

wolfy-j avatar wolfy-j commented on May 19, 2024

That's weird, this has been properly tested:
download

I would have to take a look at this docker container and build our own version later.

from roadrunner.

wolfy-j avatar wolfy-j commented on May 19, 2024

@Firehed would you mind creating a ticket for that?

Having additional documentation on the config would be super valuable here. For example, I have absolutely no idea how the RPC section works or what it's supposed to accomplish.

from roadrunner.

Firehed avatar Firehed commented on May 19, 2024

Will do!

What are your log settings if you run php -i? The base image I started off with has fairly dumb defaults, which could be part of the issue.

If it's relevant, my application's internal logger goes to STDOUT (which is what Docker generally wants), and the front-controller script I'm trying rr with looks like this:

// autoload, framework setup, etc...
$relay = new Spiral\Goridge\StreamRelay(STDIN, STDOUT);
$psr7 = new Spiral\RoadRunner\PSR7Client(new Spiral\RoadRunner\Worker($relay));

while ($req = $psr7->acceptRequest()) {
    try {
        $response = $dispatcher->setRequest($req)->dispatch();
        $psr7->respond($response);
    } catch (\Throwable $e) {
        $psr7->getWorker()->error((string)$e);
    }
}

from roadrunner.

wolfy-j avatar wolfy-j commented on May 19, 2024

Try setting ini_set('display_errors', 'stderr'); in your script, rr will handle error buffer in this case and forward it to parent docker container with proper error management before that (like displaying in the log).

In some cases (fatal errors on bootload stage) php dies even before stderr can be set, running script manually php script.php actually very solid solution to check if worker bootloads (script must be awaiting for stdin input).

from roadrunner.

wolfy-j avatar wolfy-j commented on May 19, 2024

Config validation issue has been resolved in 1.0.2

from roadrunner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.