Skip to content

[Bug] PHP Fatal error: Call to undefined method Application::add() — incompatible with symfony/console ^8.0 #168

@Sinersis

Description

@Sinersis

Describe the bug

bin/rr-worker crashes immediately on every request because Symfony\Component\Console\Application::add() was renamed to addCommand() in Symfony Console 8.0. The application returns HTTP 500 with an empty body (EOF).

Expected behaviour

RoadRunner workers boot successfully and handle HTTP requests.

Actual behaviour

Every request fails with HTTP 500. RoadRunner logs show:

PHP Fatal error: Uncaught Error: Call to undefined method Symfony\Component\Console\Application::add()
in vendor/roadrunner-php/laravel-bridge/bin/rr-worker:75

Line 75 in bin/rr-worker:

$app->add(new StartCommand($basePath)); // add() does not exist in symfony/console ^8.0

Application::add() was renamed to Application::addCommand() in Symfony Console 8.0 (symfony/console CHANGELOG).

Workaround: manually patch line 75: $app->add(...) → $app->addCommand(...).

Steps to reproduce

  1. Install Laravel 13 with laravel/octane ^2 and roadrunner-php/laravel-bridge 6.0.4
  2. Ensure symfony/console ^8.0 is resolved (happens automatically with Laravel 13)
  3. Start RoadRunner server
  4. Make any HTTP request — all return 500 EOF

System information

Key Value
PHP version 8.4.19
Current package version 6.0.4
RoadRunner version 3 (via spiral/roadrunner-worker v3.6.2)
Environment docker

RoadRunner configuration file content

version: '3'

rpc:
  listen: 'tcp://127.0.0.1:6001'

server:
  command: 'php vendor/bin/rr-worker start'

http:
  address: "0.0.0.0:8080"
  pool:
    debug: true
    num_workers: 4

Package configuration file content

return [
    'cache' => [
        'storage' => 'cache',
    ],

    'grpc' => [
        'services' => [
            // GreeterInterface::class => new Greeter::class,
        ],
    ],

    'temporal' => [
        'address' => env('TEMPORAL_ADDRESS', '127.0.0.1:7233'),
        'defaultWorker' => env('TEMPORAL_TASK_QUEUE', TemporalWorkerFactoryInterface::DEFAULT_TASK_QUEUE),
        'workers' => [],
        'declarations' => [
            // 'App\Temporal\GreeterWorkflow'
        ],
    ],

    'workers' => [
        Mode::MODE_HTTP => HttpWorker::class,
        Mode::MODE_JOBS => QueueWorker::class,
        Mode::MODE_GRPC => GrpcWorker::class,
        Mode::MODE_TEMPORAL => TemporalWorker::class,
    ],
];

Additional context

symfony/console v8.0.8 is pulled in transitively by laravel/framework v13.3.0. The fix is a one-liner in bin/rr-worker:

-$app->add(new StartCommand($basePath));
+$app->addCommand(new StartCommand($basePath));

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions