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

event_machine_projection keeps failing: call to a member function run() on null #18

Open
pmartelletti opened this issue Oct 14, 2018 · 4 comments

Comments

@pmartelletti
Copy link

@codeliner was trying to create prototype suggested here: proophsoftware/es-emergency-call#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

@pmartelletti
Copy link
Author

@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?

@codeliner
Copy link
Member

@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

@pmartelletti
Copy link
Author

@codeliner ups - didn't get to that point, as I focused on trying to understand why the service was not starting 😟

Thanks for that 👍

@codeliner
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants