event-machine-skeleton
                                
                                 event-machine-skeleton copied to clipboard
                                
                                    event-machine-skeleton copied to clipboard
                            
                            
                            
                        event_machine_projection keeps failing: call to a member function run() on null
@codeliner was trying to create prototype suggested here: https://github.com/proophsoftware/es-emergency-call/issues/8
But I'm having issues running the docker image; on particular, the event_machine_projection service keeps failing to start. The logs show the following:
event_machine_projection_1  | Fatal error: Uncaught Error: Call to a member function run() on null in /app/vendor/proophsoftware/event-machine/src/Projecting/ProjectionRunner.php:93
event_machine_projection_1  | Stack trace:
event_machine_projection_1  | #0 /app/vendor/proophsoftware/event-machine/src/EventMachine.php(617): Prooph\EventMachine\Projecting\ProjectionRunner->run(false, NULL)
event_machine_projection_1  | #1 /app/bin/event_machine_projection.php(21): Prooph\EventMachine\EventMachine->runProjections(false)
event_machine_projection_1  | #2 {main}
event_machine_projection_1  |   thrown in /app/vendor/proophsoftware/event-machine/src/Projecting/ProjectionRunner.php on line 93
I've checked the code, and seems like EventMachine.php is trying to create a projection runner, but the projection manager in the service container is null.
$this->container->get(self::SERVICE_ID_PROJECTION_MANAGER)
Any ideas why this could be happening? Have you heard this issue before?
Thanks
@codeliner actually, the null is not here, but in the constructor of the projection runner:
$this->projection = $projectionManager->createReadModelProjection(
            self::eventMachineProjectionName($eventMachine->appVersion()),
            new ReadModelProxy(
                $projectionDescriptions,
                $eventMachine
            ),
            $projectionOptions
        );
$this->projection is NULL. any ideas?
@pmartelletti I guess you don't have a projection registered, yet. Did you do the tutorial?
Registering Projections: https://proophsoftware.github.io/event-machine/tutorial/partIV.html#2-5-1
Just add a first aggregate and activate an AggregateProjection like described in the tutorial. The projection container should start to work then. Anyway, a better error handling would be a good idea here. Thx for reporting
@codeliner ups - didn't get to that point, as I focused on trying to understand why the service was not starting 😟
Thanks for that 👍
yeah, I realized that we need a better error reporting here for the devs who want to start with a fully working system right away ;) I keep the issue open as a reminder.